:root {
    --bg: #0a0a0f;
    --bg-secondary: #111118;
    --surface: rgba(22, 22, 31, 0.88);
    --surface-strong: #181824;
    --surface-soft: rgba(255, 255, 255, 0.03);
    --text: #f0eeeb;
    --muted: #9a98a6;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #c8ff00;
    --accent-soft: rgba(200, 255, 0, 0.12);
    --accent-glow: rgba(200, 255, 0, 0.22);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
    --radius: 24px;
    --radius-sm: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(200, 255, 0, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.1), transparent 26%),
        var(--bg);
    color: var(--text);
    font-family: "DM Sans", "Segoe UI", sans-serif;
    overflow-x: hidden;
}

body.rtl {
    font-family: Tahoma, "Segoe UI", sans-serif;
}

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

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

.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
    position: fixed;
    top: 20%;
    left: 70%;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    filter: blur(18px);
    opacity: 0.55;
}

.page-shell {
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 48px;
    position: relative;
    z-index: 1;
}

.page-shell.with-global-home {
    padding-top: 94px;
}

.global-homebar {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    width: min(1220px, calc(100% - 32px));
    display: flex;
    justify-content: flex-start;
    pointer-events: none;
}

.global-homebar-link {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(200, 255, 0, 0.22);
    background: rgba(10, 10, 15, 0.88);
    color: var(--text);
    font-weight: 700;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.global-homebar-link:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38), 0 0 22px var(--accent-glow);
}

.hero,
.section,
.footer {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 32px;
    overflow: hidden;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.hero {
    min-height: 88vh;
    padding: 24px;
    margin-bottom: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, rgba(17, 17, 24, 0.96), rgba(10, 10, 15, 0.94));
    box-shadow: var(--shadow);
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 20%, rgba(200, 255, 0, 0.12), transparent 22%),
        radial-gradient(circle at 85% 25%, rgba(99, 102, 241, 0.18), transparent 24%),
        radial-gradient(circle at 72% 78%, rgba(244, 114, 182, 0.12), transparent 18%);
    pointer-events: none;
}

.topbar,
.hero-grid,
.grid-3,
.flow-grid,
.categories-grid {
    display: grid;
    gap: 18px;
}

.hero-topline {
    position: relative;
    z-index: 1;
    margin-bottom: 18px;
}

.topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
    position: relative;
    z-index: 1;
    margin-bottom: 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 18px;
}

.brand-name {
    margin: 0;
    font-family: "Sora", "Syne", "Segoe UI", sans-serif;
    font-size: clamp(1.5rem, 2.2vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
}

.brand-name-small {
    font-size: clamp(1.15rem, 1.7vw, 1.6rem);
}

.brand-tagline {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 1rem;
}

.brand-splash {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    margin-bottom: 30px;
}

.brand-splash-logo {
    width: clamp(156px, 19vw, 224px);
    height: clamp(156px, 19vw, 224px);
    flex: 0 0 auto;
    filter: drop-shadow(0 0 42px rgba(200, 255, 0, 0.28));
}

.brand-splash-name {
    margin: 0;
    font-family: "Sora", "Syne", "Segoe UI", sans-serif;
    font-size: clamp(3.1rem, 7.4vw, 6.2rem);
    font-weight: 800;
    letter-spacing: -0.07em;
    line-height: 0.92;
}

.brand-splash-tagline {
    margin: 14px 0 0;
    color: var(--text);
    max-width: 620px;
    font-size: clamp(1rem, 1.8vw, 1.28rem);
    line-height: 1.5;
}

.hero-copy-block {
    max-width: 760px;
}

.top-links,
.language-switcher,
.hero-actions,
.hero-points,
.rules-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.top-links a {
    color: var(--muted);
    font-size: 0.92rem;
    transition: color 0.25s ease;
}

.top-links a:hover {
    color: var(--text);
}

.language-switcher {
    position: relative;
    z-index: 1;
    margin: 28px 0 26px;
}

.language-switcher-top {
    margin: 0;
}

.lang-pill {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 0.84rem;
    transition: all 0.25s ease;
}

.lang-pill.is-active,
.lang-pill:hover {
    color: #0a0a0f;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 24px var(--accent-glow);
}

.hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.78fr);
    align-items: start;
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin-bottom: 16px;
    color: var(--accent);
    font-size: clamp(0.98rem, 1.4vw, 1.18rem);
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.45;
}

h1,
h2 {
    font-family: "Syne", "Segoe UI", sans-serif;
    letter-spacing: -0.05em;
}

h1 {
    font-size: clamp(2.4rem, 5.8vw, 4.2rem);
    line-height: 0.96;
    max-width: 12ch;
    margin-bottom: 16px;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
    margin-bottom: 12px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.hero-copy,
.section-heading p,
.panel p,
.flow-card p,
.rule-item p,
.empty-state p,
.core-item p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

.hero-copy {
    max-width: 640px;
    font-size: 1.05rem;
    margin-bottom: 22px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--accent);
    color: #0a0a0f;
    box-shadow: 0 0 24px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-color: var(--line);
}

.hero-points {
    list-style: none;
    margin: 26px 0 0;
    padding: 0;
}

.hero-points li,
.rule-item,
.soft-pill,
.accent-pill {
    border-radius: 999px;
}

.hero-points li {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 0.9rem;
}

.hero-card,
.panel,
.flow-card,
.category-card,
.empty-state,
.rule-item {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 24px;
    border-radius: 28px;
}

.card-label,
.panel-index,
.flow-step,
.muted-line {
    color: var(--muted);
}

.card-label,
.panel-index,
.flow-step {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.core-item {
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.core-item:first-of-type {
    border-top: 0;
    padding-top: 8px;
}

.section {
    margin-bottom: 22px;
    padding: 28px;
    background: linear-gradient(180deg, rgba(17, 17, 24, 0.9), rgba(12, 12, 18, 0.92));
}

.section-heading {
    margin-bottom: 24px;
    max-width: 760px;
}

.grid-3,
.flow-grid,
.categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.panel,
.flow-card,
.category-card,
.empty-state {
    padding: 22px;
    border-radius: 24px;
}

.panel-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.soft-pill,
.accent-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

.soft-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    color: var(--text);
}

.accent-pill {
    background: var(--accent);
    color: #0a0a0f;
}

.category-card {
    min-height: 160px;
    display: grid;
    align-items: end;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        var(--surface-strong);
}

.category-card h3 {
    font-family: "Syne", "Segoe UI", sans-serif;
    font-size: 1.35rem;
    margin: 0;
}

.rules-list {
    gap: 14px;
}

.rule-item {
    padding: 16px 18px;
}

.empty-state {
    text-align: center;
    padding: 38px 24px;
    background:
        linear-gradient(180deg, rgba(200, 255, 0, 0.04), rgba(255, 255, 255, 0.01)),
        var(--surface);
}

.footer {
    padding: 22px 24px;
    background: rgba(255, 255, 255, 0.02);
    text-align: center;
}

.footer p {
    margin: 0;
    color: var(--muted);
}

.test-form {
    display: grid;
    gap: 14px;
}

.test-form label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 500;
}

.test-form input,
.test-form select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
}

.full-width {
    width: 100%;
}

.hero-compact {
    min-height: auto;
}

.brand-back {
    text-decoration: none;
}

.brand-mini-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(200, 255, 0, 0.2));
}

.auth-grid,
.stack-grid,
.metric-grid,
.account-hero {
    display: grid;
    gap: 18px;
}

.auth-grid,
.account-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    align-items: start;
    position: relative;
    z-index: 1;
}

.stack-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card,
.flash,
.data-row {
    border-radius: 24px;
    border: 1px solid var(--line);
}

.metric-card {
    padding: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card strong {
    display: block;
    margin: 14px 0 10px;
    font-family: "Sora", "Syne", "Segoe UI", sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    letter-spacing: -0.05em;
}

.metric-card p {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 0;
}

.auth-card {
    display: grid;
    gap: 16px;
}

.form-separator {
    height: 1px;
    background: var(--line);
    margin: 4px 0;
}

.flash {
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.03);
}

.flash strong {
    display: block;
    margin-bottom: 8px;
}

.flash p {
    margin: 0;
    color: var(--text);
    line-height: 1.65;
}

.flash-success {
    background: rgba(200, 255, 0, 0.08);
    border-color: rgba(200, 255, 0, 0.35);
}

.flash-error {
    background: rgba(255, 95, 95, 0.08);
    border-color: rgba(255, 95, 95, 0.28);
}

.inline-code {
    margin-top: 12px !important;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    font-family: Consolas, "Courier New", monospace;
    color: #dfe5cf !important;
}

.list-card {
    min-height: 100%;
}

.data-list {
    display: grid;
    gap: 12px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.03);
}

.data-row-block {
    align-items: flex-start;
}

.data-row h3 {
    margin-bottom: 4px;
}

.data-row p,
.data-row .muted-line {
    margin-bottom: 0;
}

.data-row-meta {
    display: grid;
    gap: 6px;
    justify-items: end;
    text-align: right;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-stack {
    display: grid;
    gap: 10px;
    width: min(280px, 100%);
}

.compact-form {
    gap: 10px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-pill-pending {
    background: rgba(250, 204, 21, 0.14);
    color: #f8d34a;
    border: 1px solid rgba(250, 204, 21, 0.28);
}

.status-pill-approved,
.status-pill-completed {
    background: rgba(34, 197, 94, 0.12);
    color: #8df5b0;
    border: 1px solid rgba(34, 197, 94, 0.24);
}

.status-pill-rejected {
    background: rgba(255, 95, 95, 0.1);
    color: #ff9b9b;
    border: 1px solid rgba(255, 95, 95, 0.22);
}

.response-box {
    margin: 0;
    padding: 18px;
    min-height: 180px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: #dfe5cf;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.6;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.footer-links a {
    color: var(--text);
    opacity: 0.9;
}

.legal-page .panel h3 {
    font-size: 1.18rem;
}

.legal-stack {
    display: grid;
    gap: 16px;
}

.cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 7, 10, 0.55);
    backdrop-filter: blur(4px);
    z-index: 90;
}

.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    width: min(980px, calc(100% - 24px));
    padding: 22px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(18, 18, 26, 0.98), rgba(12, 12, 18, 0.98));
    box-shadow: var(--shadow);
    z-index: 91;
}

.cookie-copy h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.cookie-kicker {
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.cookie-copy p,
.cookie-option p {
    color: var(--muted);
    line-height: 1.7;
}

.cookie-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1.4rem;
}

.cookie-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.cookie-panel {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.cookie-toggle input {
    width: 22px;
    height: 22px;
    accent-color: var(--accent);
}

.cookie-lock {
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}

body.rtl .topbar,
body.rtl .hero-grid {
    direction: rtl;
}

@media (max-width: 860px) {
    .page-shell {
        width: min(100% - 18px, 1220px);
    }

    .page-shell.with-global-home {
        padding-top: 86px;
    }

    .hero,
    .section {
        padding: 18px;
        border-radius: 26px;
    }

    .topbar,
    .hero-grid,
    .auth-grid,
    .account-hero {
        grid-template-columns: 1fr;
    }

    .brand-splash {
        align-items: flex-start;
        gap: 18px;
        margin-bottom: 24px;
    }

    .brand-splash-logo {
        width: 120px;
        height: 120px;
    }

    .cookie-banner {
        bottom: 12px;
        padding: 18px;
    }

    .global-homebar {
        width: min(100% - 18px, 1220px);
        top: 12px;
    }

    .global-homebar-link {
        min-height: 42px;
        padding: 0 14px;
        font-size: 0.92rem;
    }

    .cookie-option {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-links {
        justify-content: flex-start;
    }

    .data-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .data-row-meta {
        justify-items: start;
        text-align: left;
    }

    h1 {
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .btn,
    .lang-pill,
    .top-links a {
        transition: none;
    }
}
