/* Vazirmatn FD: Farsi-digit build, renders all digits as Persian (۱۲۳) */
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-FD-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-FD-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-FD-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-FD-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Lalezar: display face for highlighted heading words (Arabic-script subset only; digits and Latin fall back to Vazirmatn) */
@font-face {
    font-family: 'Lalezar';
    src: url('fonts/Lalezar-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
    font-family: 'Hero Tahoma';
    src: local('Tahoma');
    font-weight: 400;
    size-adjust: 95%;
}

@font-face {
    font-family: 'Hero Tahoma';
    src: local('Tahoma Bold');
    font-weight: 600;
    size-adjust: 80%;
}

:root {
    /* Brand: magenta from the GitiHesab logo, amber accent from its mark */
    --brand-950: #2B0314;
    --brand-900: #4A0222;
    --brand-800: #6C022B;
    --brand-700: #8C0B4C;
    --brand-600: #B40461;
    --brand-500: #DE2D8D;
    --brand-100: #FBE3EF;
    --brand-50: #FDF3F8;
    --tint: color-mix(in srgb, var(--brand-50) 40%, var(--surface)); /* faint wash for big backgrounds (hero, page headers): less pink than --brand-50 */
    --accent: #FBBA00;
    --accent-600: #E5A800;
    --accent-ink: #3A2A00;

    --ink: #1F1720;
    --ink-2: #4B4250;
    --muted: #6F6676;
    --surface: #FFFFFF;
    --surface-2: #FAF8F9;
    --border: #E8E1E6;

    --success: #17733F;
    /* Capability badges and instructional icons; soft colors are for dark panels. */
    --ic-blue: #2563C9;
    --ic-blue-bg: #E8F0FD;
    --ic-blue-soft: #8DB8FF;
    --ic-green-soft: #5FD39A;
    --success-bg: #E6F5EC;
    --danger: #C62828;

    --focus-ring: 0 0 0 0.15rem var(--surface), 0 0 0 0.35rem rgba(180, 4, 97, 0.45);
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 1px 2px rgba(40, 10, 30, 0.04);
    --shadow: 0 12px 32px -16px rgba(40, 10, 30, 0.22);
    --container: 1200px;
    --header-h: 4.25rem;

    /* Fixed brand fills (not themed) */
    --brand-deep: #8C0B4C;
    --brand-solid: #B40461;
    --live-ring-colors: var(--accent), color-mix(in srgb, var(--accent) 45%, #fff), var(--brand-solid), var(--brand-deep), var(--accent);

    /* Tokens that differ between themes */
    --header-bg: rgba(255, 255, 255, 0.92);
    --stats-sheen: rgb(255 255 255 / 78%);
    --home-heading-hatch: rgba(120, 108, 116, 0.085);
    --eyebrow-bg: #F1E4EB;
    --eyebrow-dot: #B40461; /* amber is too faint on the pink pill in the light theme */
    --highlight-ink: var(--brand-600);
    --marker: rgba(251, 186, 0, 0.4);
    --marker-link: rgba(251, 186, 0, 0.32);

    /* Raised card: layered shadow + faint top highlight instead of a border */
    --danger-bg: #FDECEC;
    --card-raised: #fff;
    --shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(40, 10, 30, 0.06), 0 10px 20px -8px rgba(40, 10, 30, 0.14), 0 30px 44px -26px rgba(40, 10, 30, 0.3);
    --shadow-raised-hover: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 4px rgba(40, 10, 30, 0.08), 0 16px 28px -8px rgba(40, 10, 30, 0.22), 0 36px 52px -26px rgba(40, 10, 30, 0.38);
    --shadow-soft: 0 1px 2px rgba(40, 10, 30, 0.07), 0 6px 12px -6px rgba(40, 10, 30, 0.18);
}

/* Dark theme: <html data-theme="dark">, set by the inline script in App.razor and the header toggle */
:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #F4EAF0;
    --ink-2: #D2C4CD;
    --muted: #A395A0;
    --surface: #150F18;
    --surface-2: #1C1420;
    --border: #33283A;

    --brand-50: #2A1426;
    --brand-100: #43203A;
    --brand-600: #F26DB5;
    --brand-700: #F58CC6;
    --brand-800: #FAB0D8;

    --success: #4CC38A;
    --ic-blue: #7FB2FF;
    --ic-blue-bg: #1B2B47;
    --success-bg: #12301F;
    --danger: #FF6B6B;

    --header-bg: rgba(21, 15, 24, 0.88);
    --stats-sheen: rgb(255 255 255 / 8%);
    --home-heading-hatch: rgba(200, 188, 196, 0.07);
    --eyebrow-bg: #38203A;
    --eyebrow-dot: var(--accent);
    --highlight-ink: #FFD35C;
    --marker: rgba(251, 186, 0, 0.2);
    --marker-link: rgba(251, 186, 0, 0.2);
    --danger-bg: #3A1517;
    --card-raised: #211727;
    --shadow-raised: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 24px -8px rgba(0, 0, 0, 0.55), 0 30px 44px -26px rgba(0, 0, 0, 0.75);
    --shadow-raised-hover: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 2px 4px rgba(0, 0, 0, 0.45), 0 18px 32px -8px rgba(0, 0, 0, 0.65), 0 38px 54px -26px rgba(0, 0, 0, 0.85);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.45), 0 6px 12px -6px rgba(0, 0, 0, 0.6);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 16px 36px -16px rgba(0, 0, 0, 0.6);
}

/* Short color cross-fade while the theme is being switched (class set by theme.js) */
:root.theme-anim *, :root.theme-anim *::before, :root.theme-anim *::after {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, fill 0.35s ease, stroke 0.35s ease !important;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 112.5%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 2rem);
}

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

    *, *::before, *::after {
        transition: none !important;
    }

    .eyebrow-live::before {
        animation: none;
    }

    .btn-live::before {
        animation: none;
    }
}

html, body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

body {
    margin: 0;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--ink);
    background-color: var(--surface);
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.45;
    color: var(--ink);
}

h1 {
    font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);
}

h2 {
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
}

h3 {
    font-size: 1.1rem;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--brand-600);
}

/* Links inside running text: bold, no underline, with a faint amber marker band that fills on hover */
main p a:not(.btn),
.prose a {
    padding-inline: 0.1em;
    background: linear-gradient(transparent 62%, var(--marker-link) 62%);
    color: var(--brand-700);
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

    main p a:not(.btn):hover,
    .prose a:hover {
        background: var(--marker-link);
        color: var(--brand-800);
    }

    a:focus-visible, summary:focus-visible {
        outline: 2px solid var(--brand-500);
        outline-offset: 3px;
        border-radius: 4px;
    }

img {
    display: block;
    max-width: 100%;
}

code {
    font-family: Consolas, 'Courier New', monospace;
    direction: ltr;
    unicode-bidi: embed;
}

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

/* Layout */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.section {
    padding-block: clamp(2.5rem, 1.5rem + 3.5vw, 4rem);
}

.section-alt {
    background: var(--surface-2);
}

.section-head {
    max-width: 46rem;
    margin: 0 auto clamp(1.75rem, 1.25rem + 1.5vw, 2.5rem);
    text-align: center;
}

    .section-head p {
        margin: 0;
        font-size: 1.05rem;
        color: var(--muted);
    }

/* Section label above a heading: a pill badge, large enough to read comfortably */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding: 0.3rem 1.1rem;
    border-radius: 999px;
    background: var(--eyebrow-bg); /* solid matte tone, no transparency */
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.8;
    color: var(--brand-700);
}

    .eyebrow::before {
        content: "";
        flex-shrink: 0;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--eyebrow-dot);
    }

/* "Live" variant: the dot pulses a soft ring, like an online indicator */
.eyebrow-live::before {
    animation: live-pulse 1.8s ease-out infinite;
}

@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--eyebrow-dot) 70%, transparent); }
    70%, 100% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--eyebrow-dot) 0%, transparent); }
}

/* Colored word inside a heading, with a marker-style band behind its lower half */
.highlight, .accent-text {
    padding-inline: 0.12em;
    background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.highlight {
    color: var(--highlight-ink);
}

/* Page and section headings (not menu/footer labels) are set in Lalezar */
main h1,
main h2,
.highlight, .accent-text {
    font-family: 'Lalezar', 'Vazirmatn', Tahoma, sans-serif;
    font-weight: 400;
    letter-spacing: 0;
}

/* Shared title alignment. Inner pages use a short rule and two rows of amber dots. */
main :is(h1, h2) {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    text-align: center;
}

main :is(h1, h2):where(:not(.home-page *)) {
    padding-block-end: 0.65rem;
    line-height: 1.35;
}

main :is(h1, h2):where(:not(.home-page *))::before,
main :is(h1, h2):where(:not(.home-page *))::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

main :is(h1, h2):where(:not(.home-page *))::before {
    inset-inline-start: calc(50% - 1.5rem);
    inset-block-end: 0.26rem;
    width: 1.75rem;
    height: 0.18rem;
    border-radius: var(--radius);
    background: var(--heading-rule, var(--brand-700));
}

main :is(h1, h2):where(:not(.home-page *))::after {
    inset-inline-start: calc(50% + 0.45rem);
    inset-block-end: 0;
    width: 1.05rem;
    height: 0.7rem;
    background-image: radial-gradient(circle, var(--accent-600) 1.4px, transparent 1.8px);
    background-size: 0.35rem 0.35rem;
}

@media (max-width: 700px) {
    main :is(h1, h2):where(:not(.home-page *))::before {
        inset-inline: 0;
        margin-inline: auto;
    }

    main :is(h1, h2):where(:not(.home-page *))::after {
        display: none;
    }
}

/* On dark panels the word is amber, so the band is a faint amber tint instead */
.accent-text {
    color: var(--accent);
    background-image: linear-gradient(transparent 58%, rgba(251, 186, 0, 0.22) 58%, rgba(251, 186, 0, 0.22) 92%, transparent 92%);
}

/* Components */

.icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}

.icon-badge {
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: var(--ic-blue-bg);
    color: var(--ic-blue);
}

/* Boxes have no border: a raised, layered shadow separates them from the page */
.card {
    background: var(--card-raised);
    border-radius: var(--radius);
    box-shadow: var(--shadow-raised);
}

.card-hover {
    transition: box-shadow 0.2s ease;
}

    .card-hover:hover {
        box-shadow: var(--shadow-raised-hover);
    }

.checklist {
    display: grid;
    gap: 0.6rem;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}

    .checklist li {
        display: flex;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .checklist .icon {
        margin-top: 0.3rem;
        color: var(--success);
    }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    background: none;
    color: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

    .btn[href^="/consult"] {
        white-space: normal;
        text-wrap: balance;
    }

    .btn:focus-visible {
        outline: none;
        box-shadow: var(--focus-ring);
    }

.btn-lg {
    padding: 0.75rem 1.6rem;
    font-size: 1.02rem;
}

.btn-primary {
    color: #fff;
    background-color: var(--brand-solid);
    border-color: var(--brand-solid);
}

    .btn-primary:hover {
        background-color: var(--brand-deep);
        border-color: var(--brand-deep);
    }

/* The hero demo button rotates its gradient continuously by animating the angle of a masked ring. */
@property --live-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

@keyframes live-spin {
    to {
        --live-angle: 360deg;
    }
}

.btn-live {
    position: relative;
    isolation: isolate;
    color: #fff;
    border-color: transparent;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 50%),
        linear-gradient(135deg, var(--brand-solid), var(--brand-deep));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 24px -8px color-mix(in srgb, var(--brand-solid) 70%, transparent);
}

    .btn-live::before {
        content: "";
        position: absolute;
        inset: -4px;
        z-index: -1;
        padding: 3px;
        border-radius: calc(var(--radius-sm) + 4px);
        background: conic-gradient(from var(--live-angle), var(--live-ring-colors));
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        animation: live-spin 3s linear infinite;
        pointer-events: none;
    }

    .btn-live:hover {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 50%),
            linear-gradient(135deg, var(--brand-deep), var(--brand-950));
        color: #fff;
    }

.btn-outline {
    color: var(--ink);
    background-color: var(--card-raised);
    box-shadow: var(--shadow-soft);
}

    .btn-outline:hover {
        box-shadow: var(--shadow-raised-hover);
        color: var(--brand-600);
    }

.btn-accent {
    color: var(--accent-ink);
    background-color: var(--accent);
    border-color: var(--accent);
}

    .btn-accent:hover {
        background-color: var(--accent-600);
        border-color: var(--accent-600);
    }

.btn-ghost-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
}

    .btn-ghost-light:hover {
        background-color: rgba(255, 255, 255, 0.12);
    }

.table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

    .table th, .table td {
        padding: 0.5rem;
        border-bottom: 1px solid var(--border);
        text-align: start;
        vertical-align: top;
    }

    .table thead th {
        border-bottom-width: 2px;
    }

.text-danger {
    color: var(--danger);
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: var(--danger);
    font-size: 0.88rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat right 1rem center/1.8rem, #b32121;
    padding: 1rem 3.7rem 1rem 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "خطایی رخ داده است."
    }

/* ---------- Forms and account pages ---------- */

.field {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}

    .field label {
        font-weight: 600;
        font-size: 0.95rem;
    }

.input {
    width: 100%;
    padding: 0.7rem 0.95rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    box-shadow: inset 0 1px 3px rgba(40, 10, 30, 0.14);
    color: var(--ink);
    transition: box-shadow 0.15s;
}

    .input[dir="ltr"] {
        text-align: left;
    }

    .input::placeholder {
        color: var(--muted);
    }

    .input:focus {
        outline: none;
        box-shadow: inset 0 1px 3px rgba(40, 10, 30, 0.14), 0 0 0 3px var(--brand-100);
    }

.field .hint {
    color: var(--muted);
    font-size: 0.85rem;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    cursor: pointer;
}

    .check input {
        width: 1.1rem;
        height: 1.1rem;
        accent-color: var(--brand-solid);
    }

.form-alert {
    margin-bottom: 1.25rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 0.95rem;
    line-height: 1.8;
}

.form-alert.ok {
    color: var(--success);
    background: var(--success-bg);
}

.auth-forgot {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.95rem;
}

.auth-wrap {
    max-width: 34rem;
}

.auth-card {
    padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

    .auth-card h1 {
        margin-bottom: 0.5rem;
        font-size: 1.8rem;
    }

.auth-lead {
    margin: 0.75rem 0 1.5rem;
    color: var(--muted);
}

.auth-submit {
    width: 100%;
}

.auth-switch {
    margin: 1.5rem 0 0;
    text-align: center;
    color: var(--ink-2);
}

.auth-center {
    text-align: center;
}

    .auth-center h1 {
        margin-inline: auto;
    }

.auth-code {
    margin: 0;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--brand-600);
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.auth-center .auth-actions {
    justify-content: center;
}

.logout-form {
    display: contents;
}

.profile-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

    .profile-head h1 {
        margin: 0;
        font-size: 1.6rem;
    }

.profile-avatar {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    background: var(--brand-deep);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
}

.profile-email {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.profile-list {
    display: grid;
    gap: 0.6rem;
    margin: 0 0 1.75rem;
}

    .profile-list div {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding-block: 0.6rem;
        border-top: 1px solid var(--border);
    }

    .profile-list dt {
        color: var(--muted);
    }

    .profile-list dd {
        margin: 0;
        font-weight: 600;
    }

.btn-danger {
    color: #fff;
    background-color: #C62828;
    border-color: #C62828;
}

    .btn-danger:hover {
        background-color: #A31F1F;
        border-color: #A31F1F;
    }

/* ---- Story viewer (built by js/stories.js; the covers live in Sections/StoriesStrip) ----
   A dark media overlay in both themes, so these colors are deliberately fixed. */
.sv {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: rgba(12, 8, 16, 0.86);
}

.sv-stage {
    position: relative;
    height: min(92vh, 54rem);
    aspect-ratio: 9 / 16;
    max-width: 100vw;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.sv-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sv-bars {
    position: absolute;
    inset: 0.6rem 0.75rem auto;
    z-index: 2;
    display: flex;
    gap: 0.25rem;
}

.sv-bar {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.35);
}

    .sv-bar i {
        display: block;
        height: 100%;
        background: #fff;
        transform: scaleX(0);
        transform-origin: right; /* RTL: fills from the right */
    }

.sv-head {
    position: absolute;
    inset: 1.4rem 0.75rem auto;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
}

    .sv-avatar {
        display: grid;
        place-items: center;
        width: 2.1rem;
        height: 2.1rem;
        border-radius: 50%;
        background: var(--brand-solid);
    }

    .sv-head strong {
        margin-inline-end: auto;
        padding: 0.1rem 0.6rem;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.4);
        font-size: 0.85rem;
        font-weight: 600;
    }

.sv-btn, .sv-nav {
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
}

.sv-btn {
    width: 2.1rem;
    height: 2.1rem;
    background: rgba(0, 0, 0, 0.4);
}

    .sv-btn:hover {
        background: rgba(0, 0, 0, 0.6);
    }

.sv-nav {
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    background: rgba(255, 255, 255, 0.92);
    color: #1d1426;
}

    .sv-nav:hover {
        background: #fff;
    }

    .sv-btn svg, .sv-nav svg {
        width: 1.2rem;
        height: 1.2rem;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .sv-btn:focus-visible, .sv-nav:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

/* invisible tap zones over the video: left half = next, right half = previous (RTL) */
.sv-tap {
    position: absolute;
    top: 4.5rem;
    bottom: 0;
    z-index: 1;
    width: 50%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.sv-tap-next {
    left: 0;
}

.sv-tap-prev {
    right: 0;
}

@media (max-width: 640px) {
    .sv-stage {
        width: 100vw;
        height: 100dvh;
        aspect-ratio: auto;
        border-radius: 0;
    }

    .sv-nav {
        display: none;
    }
}
