@import url("https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
    color-scheme: dark;
    --bg: #070b14;
    --bg-soft: #0c1424;
    --surface: rgba(14, 24, 42, 0.86);
    --surface-strong: rgba(18, 31, 54, 0.96);
    --surface-light: rgba(255, 255, 255, 0.06);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --border: rgba(151, 178, 226, 0.18);
    --border-strong: rgba(151, 178, 226, 0.32);
    --text: #f8fbff;
    --muted: #aab8cf;
    --muted-2: #7989a3;
    --blue: #3b82f6;
    --blue-strong: #2563eb;
    --blue-soft: rgba(59, 130, 246, 0.16);
    --cyan: #5eead4;
    --green: #7ff2bd;
    --red: #fb7185;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    --shadow-soft: 0 14px 42px rgba(4, 12, 28, 0.28);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Heebo", Arial, sans-serif;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, transparent 28%),
        linear-gradient(215deg, rgba(94, 234, 212, 0.09) 0%, transparent 24%),
        linear-gradient(180deg, #070b14 0%, #0a1220 42%, #0d1627 100%);
    letter-spacing: 0;
}

html[lang="en"] body {
    font-family: "Inter", Arial, sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 78%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

.hidden {
    display: none !important;
}

.app-shell {
    width: min(1400px, calc(100% - 36px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 82px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
    background: rgba(7, 11, 20, 0.82);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(22px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    font-size: 26px;
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(59, 130, 246, 0.3);
}

.brand strong {
    font-size: 28px;
    font-weight: 900;
}

.nav-tabs,
.top-actions,
.auth-tabs,
.oauth-row,
.profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-tabs {
    justify-content: center;
}

.nav-tab,
.auth-tab {
    min-height: 42px;
    border-radius: 8px;
    padding: 0 16px;
    color: var(--muted);
    background: transparent;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    cursor: pointer;
}

.nav-tab:hover,
.auth-tab:hover {
    color: white;
    background: var(--surface-light);
}

.nav-tab.active,
.auth-tab.active {
    color: white;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(94, 234, 212, 0.1));
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.28);
}

.btn,
.icon-btn {
    min-height: 46px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--blue-strong));
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
    transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.btn:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.btn-secondary {
    color: white;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-danger {
    background: var(--red);
    box-shadow: none;
}

.icon-btn {
    width: 46px;
    padding: 0;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    box-shadow: none;
}

.full-width {
    width: 100%;
}

.inline-form {
    display: inline;
    margin: 0;
}

.language-toggle {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    color: var(--cyan);
    background: rgba(94, 234, 212, 0.08);
    font-weight: 900;
    white-space: nowrap;
}

.language-toggle:hover {
    background: rgba(94, 234, 212, 0.14);
}

main {
    padding-bottom: 56px;
}

.hero {
    min-height: 470px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 22px;
    align-items: stretch;
    padding: 42px 0 26px;
}

.hero-copy,
.hero-panel,
.panel,
.market-panel,
.chat-list,
.chat-window,
.auth-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.hero-copy {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 5vw, 54px);
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(94, 234, 212, 0.08) 48%, rgba(255, 255, 255, 0.04)),
        rgba(12, 20, 36, 0.9);
}

.hero-copy::after {
    content: "";
    position: absolute;
    inset-inline-start: 36px;
    inset-block-end: 32px;
    width: min(360px, 42%);
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cyan), var(--blue), transparent);
    opacity: 0.85;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 900px;
    margin-bottom: 18px;
    font-size: clamp(40px, 5.4vw, 76px);
    line-height: 1.02;
    font-weight: 900;
}

h2 {
    margin-bottom: 8px;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.15;
    font-weight: 900;
}

h3 {
    margin-bottom: 8px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 900;
}

p {
    line-height: 1.62;
}

.hero-copy p,
.section-head p,
.panel p,
.clean-list li,
.small-note,
.product-card p,
.chat-meta,
.chat-head p,
.category-card span,
.product-category,
.chat-item span,
.message span,
.admin-card p {
    color: var(--muted);
    font-weight: 500;
}

.hero-copy p {
    max-width: 720px;
    font-size: 21px;
}

.search-wrap {
    position: relative;
    max-width: 790px;
    margin-top: 32px;
}

.search-wrap input {
    width: 100%;
    min-height: 74px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0 24px 0 86px;
    color: #07111f;
    background: rgba(255, 255, 255, 0.96);
    font-size: 22px;
    font-weight: 700;
    outline: none;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.search-wrap input:focus {
    border-color: rgba(94, 234, 212, 0.72);
    box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.18), 0 18px 42px rgba(0, 0, 0, 0.22);
}

.search-wrap button {
    position: absolute;
    left: 9px;
    top: 9px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--blue), #1e40af);
    cursor: pointer;
}

.hero-panel,
.panel {
    padding: 26px;
}

.hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.18), rgba(255, 255, 255, 0.04)),
        var(--surface);
}

.hero-panel h2 {
    font-size: 36px;
}

.panel-label,
.product-category {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    border: 1px solid rgba(94, 234, 212, 0.24);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--cyan);
    background: rgba(94, 234, 212, 0.08);
    font-size: 14px;
    font-weight: 900;
}

.account-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.account-stats span {
    min-height: 92px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    place-content: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.055);
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

.account-stats strong {
    display: block;
    color: white;
    font-size: 34px;
    line-height: 1;
}

.section-block,
.page-hero,
.auth-page,
.admin-list {
    margin-top: 30px;
}

.section-head,
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 18px;
}

.category-grid,
.product-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.category-card,
.product-card,
.chat-item,
.admin-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.052);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.category-card:hover,
.product-card:hover,
.chat-item:hover,
.admin-card:hover {
    transform: translateY(-2px);
    border-color: rgba(94, 234, 212, 0.36);
    background: rgba(255, 255, 255, 0.078);
}

.category-card {
    min-height: 162px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px;
}

.category-card strong {
    font-size: 22px;
    line-height: 1.18;
}

.category-card span {
    line-height: 1.5;
}

.market-panel {
    margin-top: 28px;
    padding: 26px;
    background: var(--surface-strong);
}

.product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-card {
    min-height: 315px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.product-card form {
    margin: 0;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    color: var(--muted);
}

.product-meta strong {
    color: white;
    font-size: 26px;
    font-weight: 900;
}

.empty-state {
    grid-column: 1 / -1;
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
    padding: 34px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    text-align: center;
    font-weight: 700;
}

.compact-hero {
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(94, 234, 212, 0.07)),
        var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 38px;
    box-shadow: var(--shadow-soft);
}

.compact-hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(36px, 5vw, 64px);
}

.compact-hero p {
    color: var(--muted);
    max-width: 820px;
}

.back-link {
    color: var(--cyan);
    font-weight: 900;
}

.flash {
    margin: 18px 0 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 14px 18px;
    background: rgba(28, 52, 96, 0.86);
    color: var(--text);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.flash-error {
    border-color: rgba(255, 96, 96, 0.44);
    background: rgba(95, 23, 37, 0.88);
}

.flash-success {
    border-color: rgba(68, 217, 150, 0.44);
    background: rgba(14, 87, 70, 0.88);
}

.auth-page {
    min-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
    padding: 32px 0;
}

.auth-panel {
    position: relative;
    overflow: hidden;
    width: min(100%, 560px);
    padding: clamp(24px, 4vw, 38px);
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.16), rgba(255, 255, 255, 0.04)),
        var(--surface-strong);
}

.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.auth-panel h1 {
    margin-bottom: 8px;
    font-size: clamp(36px, 5vw, 54px);
}

.oauth-grid,
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.oauth-btn {
    min-height: 52px;
}

.auth-tabs {
    margin-bottom: 18px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 4px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

.form-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.checkbox-label {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: start;
    gap: 10px;
    color: var(--muted);
    font-weight: 700;
}

.checkbox-label input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    accent-color: var(--blue);
}

.otp-details {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.otp-details summary {
    color: var(--cyan);
    cursor: pointer;
    font-weight: 800;
}

.setup-status {
    display: grid;
    gap: 8px;
    margin: 18px 0;
}

.setup-status span {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 12px;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.045);
}

.setup-status .ready {
    border-color: rgba(68, 217, 150, 0.42);
    color: #7ff2bd;
}

.setup-status .missing {
    border-color: rgba(255, 96, 96, 0.44);
    color: #ffb2b2;
}

.flat-form {
    background: transparent;
    border: 0;
    padding: 0;
    margin-top: 18px;
}

.narrow-form {
    width: min(100%, 720px);
    margin: 28px auto 0;
}

.form-panel {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 900;
}

input,
select,
textarea {
    width: 100%;
    min-height: 54px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.075);
    color: var(--text);
    padding: 0 14px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(94, 234, 212, 0.68);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.12);
}

select option {
    color: #0a1020;
}

textarea {
    min-height: 140px;
    padding-top: 14px;
    resize: vertical;
}

.seller-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 22px;
    margin-top: 24px;
}

.chat-layout {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 18px;
    margin-top: 24px;
}

.single-column {
    grid-template-columns: 1fr;
}

.chat-list,
.full-list {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.chat-item {
    display: grid;
    gap: 6px;
    padding: 16px;
}

.chat-item strong {
    font-size: 18px;
}

.messages {
    display: grid;
    align-content: start;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-height: 480px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.045);
}

.message {
    width: fit-content;
    max-width: min(650px, 88%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.07);
}

.message.own {
    justify-self: end;
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.36);
}

.message p {
    margin-bottom: 6px;
}

.message-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 12px;
}

.admin-list {
    display: grid;
    gap: 16px;
}

.admin-card {
    display: grid;
    gap: 10px;
}

@media (max-width: 1120px) {
    .topbar,
    .hero,
    .seller-layout,
    .profile-grid,
    .chat-layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        position: relative;
    }

    .nav-tabs,
    .top-actions {
        justify-content: stretch;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .nav-tab,
    .top-actions .btn {
        flex: 1 0 auto;
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .app-shell {
        width: min(100% - 22px, 1400px);
    }

    .topbar {
        min-height: auto;
        gap: 12px;
    }

    .brand {
        justify-content: space-between;
    }

    .brand strong {
        font-size: 23px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        font-size: 23px;
    }

    .hero {
        min-height: auto;
        padding-top: 20px;
    }

    .hero-copy,
    .hero-panel,
    .panel,
    .market-panel,
    .compact-hero,
    .auth-panel {
        padding: 20px;
    }

    .hero-copy::after {
        display: none;
    }

    h1 {
        font-size: 38px;
    }

    .hero-copy p {
        font-size: 18px;
    }

    .search-wrap input {
        min-height: 62px;
        padding-inline-start: 68px;
        font-size: 18px;
    }

    .search-wrap button {
        width: 46px;
        height: 46px;
    }

    .section-head,
    .panel-head,
    .message-form,
    .compact-hero,
    .oauth-grid,
    .profile-grid,
    .category-grid,
    .product-grid,
    .account-stats {
        grid-template-columns: 1fr;
        display: grid;
    }

    .form-grid-two {
        grid-template-columns: 1fr;
    }

    .category-card {
        min-height: 136px;
    }

    .product-card {
        min-height: auto;
    }

    .messages {
        min-height: 420px;
    }

    .message {
        max-width: 96%;
    }
}
