/* ============================================================
   RESET & БАЗОВЫЕ СТИЛИ
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8faff;
    color: #1a2332;
    min-height: 100vh;
    line-height: 1.5;
}

a {
    color: #0b5e8a;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   СТАРТОВАЯ СТРАНИЦА (ПЕРЕПУТЬЕ)
   ============================================================ */
.page-home {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #ffffff;
}

.page-home .container {
    max-width: 1500px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 60px;
    align-items: center;
}

.page-home .side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    text-align: center;
}

.page-home .side .subtitle {
    font-size: 15px;
    color: #6b7f94;
    line-height: 1.6;
    max-width: 280px;
    text-align: center;
}

.page-home .center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-home .logo {
    width: 500px;
    height: auto;
    max-width: 100%;
    animation: softPulse 4s ease-in-out infinite;
    transform-origin: center;
    filter: drop-shadow(0 4px 20px rgba(11, 94, 138, 0.08));
}

@keyframes softPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.95;
    }
}

.page-home .footer {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: #9aa9bc;
}

.page-home .footer a {
    color: #6b7f94;
    text-decoration: none;
    margin: 0 12px;
}

.page-home .footer a:hover {
    color: #0b5e8a;
}

/* ============================================================
   КНОПКИ (ОБЩИЕ)
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-ru {
    background: #0b5e8a;
    color: #ffffff;
}

.btn-ru:hover {
    background: #094a6e;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(11, 94, 138, 0.25);
    text-decoration: none;
}

.btn-cn {
    background: #c41e24;
    color: #ffffff;
}

.btn-cn:hover {
    background: #a0181d;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(196, 30, 36, 0.25);
    text-decoration: none;
}

.btn-blue {
    padding: 14px 28px;
    background: #0b5e8a;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-blue:hover {
    background: #094a6e;
}

.btn-outline {
    padding: 12px 24px;
    background: transparent;
    color: #4a5a6e;
    border: 1px solid #d0d8e4;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
}

.btn-outline:hover {
    background: #f0f4f8;
}

.btn-full {
    width: 100%;
}

/* ============================================================
   AUTH PAGES (ВХОД / РЕГИСТРАЦИЯ)
   ============================================================ */
.page-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #f8faff;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    text-align: center;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(11, 94, 138, 0.08);
}

.auth-container-wide {
    max-width: 620px;
}

.auth-logo {
    margin-bottom: 24px;
}

.logo-small {
    width: 120px;
    height: auto;
    animation: softPulse 4s ease-in-out infinite;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: #0b1a2b;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 14px;
    color: #6b7f94;
    margin-bottom: 32px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field {
    text-align: left;
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4a5a6e;
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d0d8e4;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    background: #ffffff;
    color: #1a2332;
}

.field input:focus {
    border-color: #0b5e8a;
}

.field input::placeholder {
    color: #9aa9bc;
}

.error {
    font-size: 13px;
    color: #c0392b;
    min-height: 18px;
    text-align: left;
    margin-bottom: 8px;
}

.success {
    font-size: 13px;
    color: #00883a;
    min-height: 18px;
    text-align: left;
    margin-bottom: 8px;
}

.auth-footer {
    font-size: 14px;
    color: #6b7f94;
    margin-top: 24px;
}

.auth-footer a {
    color: #0b5e8a;
}

.auth-back {
    font-size: 13px;
    margin-top: 16px;
}

.auth-back a {
    color: #9aa9bc;
}

/* ============================================================
   APP PAGE (КАБИНЕТ)
   ============================================================ */
.app-page {
    background: #f8faff;
    min-height: 100vh;
}

.header {
    background: #ffffff;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-logo {
    height: 36px;
    width: auto;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4a5a6e;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.nav-btn:hover {
    background: #f0f4f8;
}

.nav-btn.active {
    background: #0b5e8a;
    color: #ffffff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    font-size: 14px;
    color: #4a5a6e;
}

.btn-logout {
    padding: 8px 16px;
    border: 1px solid #d0d8e4;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5a6e;
    cursor: pointer;
    font-family: inherit;
}

.btn-logout:hover {
    background: #f0f4f8;
}

.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: #0b1a2b;
    margin-bottom: 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    background: #ffffff;
    padding: 20px 24px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(11, 94, 138, 0.06);
}

.stat-label {
    font-size: 13px;
    color: #6b7f94;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #0b1a2b;
}

/* ============================================================
   ACTIONS
   ============================================================ */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.action-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 14px;
    text-align: left;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(11, 94, 138, 0.06);
}

.action-card:hover {
    border-color: #0b5e8a;
    transform: translateY(-2px);
}

.action-title {
    font-size: 16px;
    font-weight: 600;
    color: #0b5e8a;
    margin-bottom: 6px;
}

.action-desc {
    font-size: 13px;
    color: #6b7f94;
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-box input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid #d0d8e4;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    background: #ffffff;
    color: #1a2332;
}

.search-box input:focus {
    border-color: #0b5e8a;
}

.offer-card {
    background: #ffffff;
    padding: 20px 24px;
    border-radius: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(11, 94, 138, 0.06);
}

.offer-rank {
    width: 40px;
    height: 40px;
    background: #f0f4f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0b5e8a;
    flex-shrink: 0;
}

.offer-info {
    flex: 1;
}

.offer-supplier {
    font-weight: 600;
    color: #0b1a2b;
}

.offer-desc {
    font-size: 13px;
    color: #6b7f94;
}

.offer-meta {
    font-size: 12px;
    color: #9aa9bc;
}

.offer-price {
    font-size: 20px;
    font-weight: 700;
    color: #0b5e8a;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-block {
    background: #ffffff;
    padding: 24px;
    border-radius: 14px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(11, 94, 138, 0.06);
}

.form-block h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0b1a2b;
    margin-bottom: 16px;
}

/* ============================================================
   LIST CARDS
   ============================================================ */
.list-card {
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(11, 94, 138, 0.06);
}

.list-title {
    font-weight: 600;
    color: #0b1a2b;
    margin-bottom: 4px;
}

.list-meta {
    font-size: 13px;
    color: #6b7f94;
}

/* ============================================================
   CHAT
   ============================================================ */
.chat-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(11, 94, 138, 0.06);
    min-height: 400px;
}

.chat-list {
    border-right: 1px solid #eef2f7;
    padding-right: 20px;
}

.chat-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4a5a6e;
}

.chat-item:hover {
    background: #f0f4f8;
}

.chat-item.active {
    background: #e8f0f7;
    color: #0b5e8a;
    font-weight: 500;
}

.chat-window {
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.message {
    padding: 10px 14px;
    background: #f0f4f8;
    border-radius: 12px;
    margin-bottom: 8px;
    max-width: 70%;
    font-size: 14px;
}

.message.sent {
    background: #0b5e8a;
    color: #ffffff;
    margin-left: auto;
}

.chat-input {
    display: flex;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef2f7;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d0d8e4;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #ffffff;
    color: #1a2332;
}

.chat-input input:focus {
    border-color: #0b5e8a;
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile-block {
    background: #ffffff;
    padding: 24px;
    border-radius: 14px;
    max-width: 500px;
    box-shadow: 0 2px 8px rgba(11, 94, 138, 0.06);
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 1200px) {
    .page-home .logo {
        width: 400px;
    }
    .page-home .container {
        gap: 40px;
    }
}

@media (max-width: 900px) {
    .page-home .container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .page-home .center {
        order: -1;
    }

    .page-home .logo {
        width: 320px;
    }

    .page-home .side .subtitle {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .nav-btn {
        white-space: nowrap;
    }

    .main {
        padding: 24px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .chat-layout {
        grid-template-columns: 1fr;
    }

    .chat-list {
        border-right: none;
        border-bottom: 1px solid #eef2f7;
        padding-right: 0;
        padding-bottom: 12px;
    }

    .search-box {
        flex-direction: column;
    }

    .page-title {
        font-size: 22px;
    }
}

@media (max-width: 560px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-container {
        padding: 28px 20px;
    }
}

@media (max-width: 480px) {
    .page-home {
        padding: 20px 16px;
    }

    .page-home .logo {
        width: 240px;
    }

    .page-home .btn {
        padding: 14px 32px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }
}