/*
 * Marketing site for extramenu.ir.
 * Mirrors the guest menu's design system (src/Menu.Guest/AppTheme.cs + wwwroot/app.css):
 * terracotta primary, deep-green secondary, warm cream background, Vazirmatn,
 * 12px house radius, outlined flat cards, opacity as the secondary-text device.
 */

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

:root {
    --primary: #B4462F;
    --primary-darken: #963a27;
    --primary-hover: rgba(180, 70, 47, 0.08);
    --primary-text: #FFFFFF;
    --secondary: #2F6B57;
    --secondary-hover: rgba(47, 107, 87, 0.1);
    --manager: #2F5D8C;
    --background: #FAF7F2;
    --background-gray: #F2EDE5;
    --surface: #FFFFFF;
    --appbar-text: #1F1B18;
    --text: #2B2622;
    --lines: rgba(0, 0, 0, 0.12);
    --divider: #E6E0D8;
    --success: #2E7D32;
    --warning: #E08600;
    --error: #D32F2F;
    --radius: 12px;
    --radius-sm: 10px;
    --radius-btn: 8px;
    --elevation-1: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12);
    --elevation-2: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);
    --elevation-6: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12);
    --container: 1120px;
    --appbar-height: 64px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary: #E4795F;
        --primary-darken: #ec917b;
        --primary-hover: rgba(228, 121, 95, 0.12);
        --primary-text: #1B1411;
        --secondary: #63B295;
        --secondary-hover: rgba(99, 178, 149, 0.14);
        --manager: #7FAFDD;
        --background: #171412;
        --background-gray: #24201D;
        --surface: #1F1B18;
        --appbar-text: #F3EDE6;
        --text: #EDE6DE;
        --lines: rgba(255, 255, 255, 0.14);
        --divider: #35302B;
        --success: #66BB6A;
        --warning: #FFB74D;
        --error: #EF5350;
        color-scheme: dark;
    }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    font-family: 'Vazirmatn', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    /* Persian ascenders and descenders need more room than Latin. */
    line-height: 1.9;
    color: var(--text);
    background: var(--background);
    text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.5; margin: 0; color: var(--appbar-text); }
p { margin: 0; }
bdi { unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; inset-inline-start: -9999px; z-index: 2000; padding: 0.5rem 1rem; background: var(--surface); border-radius: var(--radius-btn); box-shadow: var(--elevation-2); }
.skip-link:focus { inset-inline-start: 1rem; top: 1rem; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .container { padding-inline: 24px; } }

.icon { width: 24px; height: 24px; fill: currentColor; flex: 0 0 auto; }
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 40px; height: 40px; }

/* ---------- App bar (same pattern as the guest MudAppBar) ---------- */
.appbar {
    position: sticky; top: 0; z-index: 100;
    height: var(--appbar-height);
    background: var(--surface);
    color: var(--appbar-text);
    box-shadow: var(--elevation-1);
}
.appbar .container { height: 100%; display: flex; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--appbar-text); font-size: 1.25rem; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--primary); color: var(--primary-text); display: grid; place-items: center; }
.brand-mark .icon { width: 22px; height: 22px; }
.spacer { flex: 1 1 auto; }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a {
    display: inline-flex; align-items: center; gap: 0.35rem;
    color: var(--appbar-text); padding: 0.35rem 0.85rem; border-radius: var(--radius-btn);
    font-weight: 500; font-size: 0.95rem; transition: background-color 250ms cubic-bezier(0.4,0,0.2,1);
}
.nav a:hover { background: var(--primary-hover); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--primary); background: var(--primary-hover); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
    .nav-toggle {
        display: inline-grid; place-items: center; width: 44px; height: 44px;
        border: 0; border-radius: 50%; background: transparent; color: var(--appbar-text); cursor: pointer;
    }
    .nav-toggle:hover { background: var(--primary-hover); }
    .nav {
        position: fixed; inset-inline: 0; top: var(--appbar-height);
        flex-direction: column; align-items: stretch; gap: 0.25rem;
        padding: 0.75rem 16px 1rem; background: var(--surface);
        border-block-end: 1px solid var(--divider); box-shadow: var(--elevation-2);
        transform: translateY(-8px); opacity: 0; visibility: hidden;
        transition: opacity 200ms, transform 200ms, visibility 200ms;
    }
    .nav.open { transform: none; opacity: 1; visibility: visible; }
    .nav a { padding: 0.6rem 0.85rem; }
    .appbar .btn-cta { display: none; }
}

/* ---------- Buttons (MudButton filled / outlined / text) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-width: 64px; padding: 0.55rem 1.25rem; border-radius: var(--radius-btn);
    font: inherit; font-weight: 500; font-size: 0.95rem; line-height: 1.6;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: background-color 250ms cubic-bezier(0.4,0,0.2,1), box-shadow 250ms cubic-bezier(0.4,0,0.2,1), border 250ms cubic-bezier(0.4,0,0.2,1);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-text); box-shadow: var(--elevation-2); }
.btn-primary:hover { background: var(--primary-darken); }
.btn-outlined { border-color: var(--lines); color: var(--primary); background: transparent; }
.btn-outlined:hover { background: var(--primary-hover); }
.btn-text { color: var(--primary); background: transparent; padding-inline: 0.75rem; }
.btn-text:hover { background: var(--primary-hover); }
.btn-lg { padding: 0.75rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Chips (MudChip small) ---------- */
.chip {
    display: inline-flex; align-items: center; gap: 0.25rem; height: 26px; padding: 0 10px;
    border-radius: 13px; font-size: 0.8rem; font-weight: 500; white-space: nowrap;
}
.chip .icon { width: 16px; height: 16px; }
.chip-success { background: var(--success); color: #fff; }
.chip-warning { color: var(--warning); background: rgba(224, 134, 0, 0.1); }
.chip-secondary { color: var(--secondary); background: var(--secondary-hover); }
.chip-outlined-success { color: var(--success); border: 1px solid currentColor; }
.chip-default { background: var(--background-gray); color: var(--text); }
.chip-primary { color: var(--primary); background: var(--primary-hover); }

/* ---------- Sections ---------- */
.section { padding-block: 4rem; }
.section-alt { background: var(--surface); border-block: 1px solid var(--divider); }
.section-head { max-width: 680px; margin-inline: auto; text-align: center; margin-block-end: 2.5rem; }
.eyebrow { display: inline-block; color: var(--primary); font-weight: 700; font-size: 0.9rem; margin-block-end: 0.5rem; }
.section-title { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 700; }
.section-lead { margin-top: 0.75rem; opacity: 0.8; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { padding-block: 3.5rem 4rem; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); font-weight: 700; line-height: 1.45; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero-lead { margin-top: 1rem; font-size: 1.15rem; opacity: 0.85; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero-points { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1.5rem 0 0; padding: 0; list-style: none; font-size: 0.95rem; opacity: 0.85; }
.hero-points li { display: inline-flex; align-items: center; gap: 0.35rem; }
.hero-points .icon { width: 18px; height: 18px; color: var(--secondary); }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .hero { padding-block: 2rem 3rem; }
}

/* ---------- Phone mock showing the real guest menu look ---------- */
.phone {
    position: relative; width: min(340px, 100%); margin-inline: auto;
    border-radius: 38px; padding: 12px; background: #1F1B18;
    box-shadow: 0 30px 60px -20px rgba(31, 27, 24, 0.45), var(--elevation-6);
}
.phone-screen { border-radius: 28px; overflow: hidden; background: var(--background); height: 600px; display: flex; flex-direction: column; position: relative; }
.phone-appbar { height: 48px; flex: 0 0 auto; background: var(--surface); box-shadow: var(--elevation-1); display: flex; align-items: center; padding-inline: 14px; font-weight: 700; font-size: 0.9rem; color: var(--appbar-text); gap: 0.5rem; }
.phone-body { padding: 12px; overflow: hidden; flex: 1 1 auto; font-size: 0.85rem; }
.mock-cover { height: 92px; border-radius: var(--radius); background: linear-gradient(135deg, #B4462F 0%, #d9825f 55%, #f0c48f 100%); position: relative; }
.mock-cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.35) 0 6%, transparent 7%), radial-gradient(circle at 75% 65%, rgba(255,255,255,.25) 0 9%, transparent 10%); }
.mock-identity { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem; }
.mock-logo { width: 42px; height: 42px; border-radius: 50%; background: var(--secondary); color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.mock-name { font-weight: 700; font-size: 1.05rem; line-height: 1.5; color: var(--appbar-text); }
.mock-search { margin-top: 0.6rem; display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.6rem; border: 1px solid var(--lines); border-radius: var(--radius-btn); background: var(--surface); opacity: 0.9; }
.mock-search .icon { width: 18px; height: 18px; opacity: 0.6; }
.mock-section-title { margin-top: 0.8rem; font-weight: 700; font-size: 0.95rem; color: var(--appbar-text); }
.phone .menu-item-list { margin-top: 0.4rem; }
.phone .menu-item-image { width: 58px; height: 58px; }
.phone .menu-item-body { padding: 0.55rem; gap: 0.55rem; }
.phone .menu-item-description { font-size: 0.75rem; }
.phone .chip { height: 20px; font-size: 0.68rem; padding: 0 6px; }
.phone .chip .icon { width: 13px; height: 13px; }
.mock-fab {
    position: absolute; inset-inline-end: 12px; bottom: 14px;
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.9rem;
    border-radius: 999px; background: var(--primary); color: var(--primary-text);
    font-weight: 500; font-size: 0.8rem; box-shadow: var(--elevation-6);
}
.mock-fab .icon { width: 18px; height: 18px; }

/* Food thumbnails drawn with gradients — no stock photos needed. */
.food { background: var(--background-gray); position: relative; overflow: hidden; }
.food::before { content: ""; position: absolute; inset: 18%; border-radius: 50%; }
.food-1 { background: #f3e2c9; } .food-1::before { background: radial-gradient(circle at 40% 40%, #e9b44c 0 30%, #c7672f 31% 55%, #7a3a1c 56%); }
.food-2 { background: #e3efe6; } .food-2::before { background: radial-gradient(circle at 50% 50%, #79b26b 0 35%, #4e8a43 36% 60%, #e9e2c9 61%); }
.food-3 { background: #f6dcd5; } .food-3::before { background: radial-gradient(circle at 50% 45%, #fff3e0 0 25%, #d9534f 26% 55%, #8f2d22 56%); }
.food-4 { background: #efe5da; } .food-4::before { inset: 22% 26%; border-radius: 30% 30% 45% 45%; background: linear-gradient(#7b4a2b 0 35%, #f5e6d3 36%); }

/* ---------- Guest menu item card (verbatim pattern from guest app.css) ---------- */
.menu-item-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.menu-item { background: var(--surface); border: 1px solid var(--lines); border-radius: var(--radius); overflow: hidden; }
.menu-item-unavailable { opacity: 0.62; }
.menu-item-body { display: flex; gap: 0.75rem; padding: 0.75rem; align-items: flex-start; }
.menu-item-image { width: 84px; height: 84px; border-radius: var(--radius-sm); flex: 0 0 auto; }
.menu-item-text { min-width: 0; flex: 1 1 auto; }
.menu-item-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.menu-item-name { font-weight: 600; line-height: 1.6; color: var(--appbar-text); }
.menu-item-description { margin: 0.15rem 0 0; font-size: 0.875rem; opacity: 0.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.7; }
.menu-item-meta { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.35rem; }
.price-tag { display: inline-flex; align-items: baseline; gap: 0.4rem; white-space: nowrap; }
.price-now { font-weight: 700; }
.price-was { text-decoration: line-through; opacity: 0.6; font-size: 0.85em; }

/* ---------- Feature cards (outlined, flat — like guest item cards) ---------- */
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (max-width: 380px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--lines); border-radius: var(--radius); padding: 1.35rem; }
.card h3 { font-size: 1.1rem; font-weight: 700; margin-top: 0.75rem; }
.card p { margin-top: 0.4rem; opacity: 0.8; font-size: 0.95rem; }
.card ul { margin: 0.6rem 0 0; padding-inline-start: 1.2rem; font-size: 0.93rem; opacity: 0.85; }
.card li + li { margin-top: 0.2rem; }
.card-icon { width: 48px; height: 48px; border-radius: var(--radius); display: grid; place-items: center; background: var(--primary-hover); color: var(--primary); }
.card-icon.green { background: var(--secondary-hover); color: var(--secondary); }
.card-icon.blue { background: rgba(47, 93, 140, 0.1); color: var(--manager); }
.card-elevated { border: 0; box-shadow: var(--elevation-1); }

/* ---------- Stat cards (manager dashboard pattern) ---------- */
.stat-card { display: flex; align-items: center; gap: 0.85rem; padding: 1rem 1.15rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--elevation-1); }
.stat-card-value { font-size: 1.6rem; font-weight: 700; line-height: 1.3; color: var(--appbar-text); }
.stat-card-label { font-size: 0.88rem; opacity: 0.75; }

/* ---------- Split feature rows ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.split + .split { margin-top: 4rem; }
.split.reverse > :first-child { order: 2; }
.split h2 { font-size: clamp(1.4rem, 2.8vw, 1.85rem); font-weight: 700; }
.split p { margin-top: 0.75rem; opacity: 0.85; }
.check-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.check-list li { display: flex; gap: 0.5rem; align-items: flex-start; }
.check-list .icon { width: 20px; height: 20px; color: var(--secondary); margin-top: 0.3rem; }
@media (max-width: 860px) {
    .split { grid-template-columns: 1fr; gap: 1.75rem; }
    .split.reverse > :first-child { order: 0; }
}

.panel { background: var(--surface); border: 1px solid var(--lines); border-radius: var(--radius); padding: 1rem; }

/* Assistant chat (guest assistant bubbles) */
.chat { display: flex; flex-direction: column; gap: 0.6rem; }
.chat-header { display: flex; align-items: center; gap: 0.5rem; padding-block-end: 0.75rem; border-block-end: 1px solid var(--divider); font-weight: 700; }
.chat-header .icon { color: var(--primary); }
.bubble { padding: 0.55rem 0.85rem; border-radius: 14px; max-width: 88%; line-height: 1.8; font-size: 0.93rem; }
.bubble-guest { align-self: flex-end; background: var(--primary); color: var(--primary-text); }
.bubble-model { align-self: flex-start; background: var(--background-gray); }
.typing { display: inline-flex; gap: 4px; align-self: flex-start; padding: 0.7rem 0.9rem; border-radius: 14px; background: var(--background-gray); }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.4; animation: pulse 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } }

/* Manager-style rows */
.ordered-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem; border: 1px solid var(--divider); border-radius: var(--radius); background: var(--surface); }
.ordered-row + .ordered-row { margin-top: 0.5rem; }
.ordered-row-title { font-weight: 600; flex: 1 1 auto; }
.ordered-row-meta { font-size: 0.8rem; opacity: 0.75; }
.drag { opacity: 0.4; }

/* QR block */
.qr { width: 150px; height: 150px; padding: 10px; border-radius: var(--radius); background: #fff; border: 1px solid var(--lines); }
.qr svg { width: 100%; height: 100%; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { position: relative; background: var(--surface); border: 1px solid var(--lines); border-radius: var(--radius); padding: 1.35rem; padding-top: 1.1rem; }
.step::before {
    counter-increment: step; content: counter(step, persian);
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); color: var(--primary-text); font-weight: 700; font-size: 1.1rem; margin-block-end: 0.6rem;
}
.step h3 { font-size: 1.05rem; font-weight: 700; }
.step p { margin-top: 0.35rem; opacity: 0.8; font-size: 0.93rem; }

/* ---------- Tutorial (guide) layout ---------- */
.page-head { padding-block: 2.5rem 1.5rem; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; }
.page-head p { margin-top: 0.6rem; opacity: 0.85; font-size: 1.08rem; max-width: 720px; }
.breadcrumb { display: flex; gap: 0.4rem; flex-wrap: wrap; padding: 0; margin: 0 0 0.75rem; list-style: none; font-size: 0.88rem; opacity: 0.8; }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 0.4rem; opacity: 0.6; }

.doc-layout { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; align-items: start; padding-block-end: 4rem; }
.toc { position: sticky; top: calc(var(--appbar-height) + 1rem); background: var(--surface); border-radius: var(--radius); box-shadow: var(--elevation-1); padding: 0.75rem 0.5rem; max-height: calc(100vh - var(--appbar-height) - 2rem); overflow-y: auto; }
.toc-title { font-weight: 700; padding: 0.25rem 0.75rem 0.5rem; font-size: 0.95rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 0.3rem 0.75rem; margin: 2px 0; border-radius: var(--radius-btn); color: var(--text); font-size: 0.9rem; border-inline-end: 2px solid transparent; }
.toc a:hover { background: var(--primary-hover); text-decoration: none; }
.toc a.active { color: var(--primary); background: var(--primary-hover); border-inline-end-color: var(--primary); }
@media (max-width: 900px) {
    .doc-layout { grid-template-columns: 1fr; }
    .toc { position: static; max-height: none; }
}

.doc { min-width: 0; }
.doc section { background: var(--surface); border: 1px solid var(--lines); border-radius: var(--radius); padding: 1.5rem; scroll-margin-top: calc(var(--appbar-height) + 1rem); }
.doc section + section { margin-top: 1rem; }
.doc h2 { font-size: 1.35rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.doc h2 .icon { color: var(--primary); }
.doc h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.25rem; }
.doc p { margin-top: 0.6rem; }
.doc ol, .doc ul { margin: 0.6rem 0 0; padding-inline-start: 1.4rem; }
.doc li + li { margin-top: 0.3rem; }
.doc kbd, .doc code { font-family: 'Vazirmatn', ui-monospace, monospace; background: var(--background-gray); padding: 0.05rem 0.4rem; border-radius: 4px; font-size: 0.9em; }

.callout { display: flex; gap: 0.6rem; margin-top: 1rem; padding: 0.85rem 1rem; border-radius: var(--radius); background: var(--secondary-hover); border-inline-start: 4px solid var(--secondary); font-size: 0.95rem; }
.callout .icon { color: var(--secondary); margin-top: 0.2rem; }
.callout-warn { background: rgba(224, 134, 0, 0.1); border-inline-start-color: var(--warning); }
.callout-warn .icon { color: var(--warning); }

/* ---------- Marketer kit ---------- */
.script-card { position: relative; background: var(--surface); border: 1px solid var(--lines); border-radius: var(--radius); padding: 1.25rem; padding-block-end: 3.5rem; }
.script-card h3 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.script-card .script-body { margin-top: 0.6rem; white-space: pre-line; opacity: 0.9; font-size: 0.95rem; }
.copy-btn { position: absolute; inset-inline-end: 1rem; bottom: 0.85rem; }
.copy-btn.copied { color: var(--success); }

.objection { border-block-end: 1px solid var(--divider); }
.objection:last-child { border-block-end: 0; }

/* ---------- FAQ (MudExpansionPanels flat) ---------- */
.faq { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--lines); max-width: 820px; margin-inline: auto; }
.faq details { border-block-end: 1px solid var(--divider); }
.faq details:last-child { border-block-end: 0; }
.faq summary {
    list-style: none; cursor: pointer; padding: 1rem 1.25rem; font-weight: 600;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--appbar-text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform 200ms; opacity: 0.7; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq .answer { padding: 0 1.25rem 1.1rem; opacity: 0.85; }

/* ---------- Pricing/credit ---------- */
.price-card { display: flex; flex-direction: column; }
.price-card .btn { margin-top: auto; }
.price-card .price-big { font-size: 2rem; font-weight: 700; color: var(--appbar-text); margin-top: 0.5rem; }
.price-card.featured { border: 2px solid var(--primary); }

/* ---------- CTA band ---------- */
.cta-band { border-radius: 20px; padding: 2.5rem 1.5rem; text-align: center; background: var(--primary); color: var(--primary-text); position: relative; overflow: hidden; }
.cta-band h2 { color: inherit; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
.cta-band p { margin-top: 0.6rem; opacity: 0.92; }
.cta-band .hero-actions { justify-content: center; }
.cta-band .btn-primary { background: var(--primary-text); color: var(--primary); }
.cta-band .btn-primary:hover { background: rgba(255,255,255,.9); }
.cta-band .btn-outlined { border-color: rgba(255,255,255,.6); color: var(--primary-text); }
.cta-band .btn-outlined:hover { background: rgba(255,255,255,.12); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .cta-band .btn-primary { background: #1B1411; color: var(--primary); }
    :root:not([data-theme="light"]) .cta-band .btn-outlined { border-color: rgba(0,0,0,.4); }
}

/* ---------- Footer ---------- */
.footer { margin-top: 4rem; background: var(--surface); border-block-start: 1px solid var(--divider); padding-block: 2.5rem 1.5rem; font-size: 0.93rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 2rem; }
.footer h2 { font-size: 1rem; font-weight: 700; margin-block-end: 0.6rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.footer a { color: var(--text); opacity: 0.85; }
.footer a:hover { color: var(--primary); opacity: 1; }
.footer-note { opacity: 0.75; margin-top: 0.6rem; }
.footer-bottom { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--divider); font-size: 0.85rem; opacity: 0.7; text-align: center; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
.no-js .reveal { opacity: 1; transform: none; }

/* Toast */
.toast { position: fixed; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); inset-inline-start: 50%; transform: translateX(50%) translateY(20px); background: #323232; color: #fff; padding: 0.6rem 1.1rem; border-radius: var(--radius-btn); box-shadow: var(--elevation-6); opacity: 0; transition: opacity 200ms, transform 200ms; z-index: 1500; font-size: 0.93rem; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.break { overflow-wrap: anywhere; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 3rem 1.5rem; text-align: center; }
.empty-state > .icon { opacity: 0.5; }

/* ---------- Forms (MudTextField outlined look) ---------- */
.form-card { background: var(--surface); border: 1px solid var(--lines); border-radius: var(--radius); padding: 1.35rem; margin: 0 0 1rem; min-width: 0; }
.form-card legend, .form-card > h2 { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; padding: 0; color: var(--appbar-text); margin-block-end: 0.75rem; }
/* A legend only sits inside the border when floated. An h2 must not float, or
   the grid and flex blocks after it shrink to nothing beside it. */
.form-card legend { float: inline-start; width: 100%; }
.form-card legend + * { clear: both; }
.form-card legend .icon { color: var(--primary); }
.form-card legend small, .field label small { font-weight: 400; opacity: 0.7; }
.form-card.invalid { border-color: var(--error); }
.field { display: flex; flex-direction: column; gap: 0.3rem; margin-block-end: 1rem; }
.field label, .field .label { font-weight: 500; font-size: 0.93rem; }
.field input, .field textarea, .dash-search input {
    font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--lines); border-radius: var(--radius-btn);
    padding: 0.6rem 0.8rem; width: 100%; line-height: 1.6;
    transition: border-color 150ms, box-shadow 150ms;
}
.field input:hover, .field textarea:hover { border-color: var(--text); }
.field input:focus, .field textarea:focus, .dash-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.field input[dir="ltr"] { text-align: left; }
.field textarea { resize: vertical; min-height: 6rem; }
.field-hint { font-size: 0.83rem; opacity: 0.72; }
.field-error { font-size: 0.85rem; color: var(--error); font-weight: 500; }
.field-error:empty { display: none; }
.field.invalid input, .field.invalid textarea, .field.invalid .file-drop { border-color: var(--error); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.file-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 1.5rem 1rem; border: 2px dashed var(--lines); border-radius: var(--radius);
    background: var(--background); text-align: center; cursor: pointer; font-size: 0.93rem;
    transition: border-color 150ms, background-color 150ms;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--primary); background: var(--primary-hover); }
.file-drop .icon { color: var(--primary); opacity: 0.85; }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-drop:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.file-list { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.file-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.6rem; border-radius: var(--radius-btn); background: var(--background-gray); font-size: 0.88rem; }
.file-list li .muted { margin-inline-start: auto; }
.file-list li.bad { color: var(--error); }

.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 2rem; align-items: start; padding-block-end: 2rem; }
.order-aside { position: sticky; top: calc(var(--appbar-height) + 1rem); }
@media (max-width: 960px) { .order-layout { grid-template-columns: 1fr; } .order-aside { position: static; } }

/* ---------- Dashboard: the manager app's palette ---------- */
.theme-manager {
    --primary: #2F5D8C;
    --primary-darken: #264c73;
    --primary-hover: rgba(47, 93, 140, 0.08);
    --secondary: #B4462F;
    --background: #F5F7FA;
    --background-gray: #EDF1F6;
    --appbar-text: #17202B;
    --text: #1F2933;
    --divider: #E1E6ED;
}
@media (prefers-color-scheme: dark) {
    :root.theme-manager:not([data-theme="light"]) {
        --primary: #7FAFDD;
        --primary-darken: #9cc2e6;
        --primary-hover: rgba(127, 175, 221, 0.12);
        --primary-text: #0F1720;
        --secondary: #E4795F;
        --background: #11161C;
        --background-gray: #1B222B;
        --surface: #171D24;
        --appbar-text: #E8EEF5;
        --text: #DCE3EA;
        --divider: #2A333D;
    }
}
.dash-main { padding-block: 1.5rem 3rem; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-block-end: 1rem; }
.page-heading h1 { font-size: 1.5rem; font-weight: 700; }
.page-heading h1 small { font-size: 0.95rem; font-weight: 500; }
.dash-search { display: flex; gap: 0.5rem; flex: 1 1 280px; max-width: 460px; }
.dash-search .btn { padding-inline: 0.85rem; }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none; } }

.status-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; border-block-end: 1px solid var(--divider); padding-block-end: 0.75rem; }
.status-tabs a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.85rem; border-radius: 999px; color: var(--text); font-weight: 500; font-size: 0.9rem; border: 1px solid var(--lines); background: var(--surface); }
.status-tabs a:hover { background: var(--primary-hover); text-decoration: none; }
.status-tabs a[aria-current="page"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.status-tabs .count { font-size: 0.78rem; opacity: 0.8; }

.order-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.order-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.85rem 1rem; border: 1px solid var(--divider); border-radius: var(--radius); background: var(--surface); color: var(--text); transition: border-color 150ms, box-shadow 150ms; }
.order-row:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--elevation-1); }
.order-row-id { font-weight: 700; color: var(--primary); min-width: 3rem; }
.order-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.order-row-title { font-weight: 600; color: var(--appbar-text); }
.order-row-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.85rem; opacity: 0.8; }
.order-row-meta > span { display: inline-flex; align-items: center; gap: 0.25rem; }
.order-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; text-align: end; flex: 0 0 auto; }
@media (max-width: 640px) {
    .order-row { flex-wrap: wrap; }
    .order-row-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}

.status-chip { border: 1px solid currentColor; }
.status-new { color: #1565C0; }
.status-contacted { color: #6A1B9A; }
.status-inprogress { color: #E08600; }
.status-done { color: var(--success); }
.status-rejected { color: #757575; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .status-new { color: #64B5F6; }
    :root:not([data-theme="light"]) .status-contacted { color: #CE93D8; }
    :root:not([data-theme="light"]) .status-rejected { color: #BDBDBD; }
}

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; }

.order-detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .order-detail { grid-template-columns: 1fr; } }
.order-detail h2 { font-size: 1.1rem; }
.order-detail h3 { font-size: 0.95rem; margin-top: 1rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; margin: 0; }
.facts dt { font-weight: 500; opacity: 0.7; font-size: 0.9rem; }
.facts dd { margin: 0; display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; min-width: 0; }
.facts dd .btn { padding: 0.15rem 0.4rem; min-width: 0; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; gap: 0.1rem; } .facts dd { margin-block-end: 0.5rem; } }

.status-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.status-option { position: relative; cursor: pointer; }
.status-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.status-option span { display: inline-block; padding: 0.3rem 0.85rem; border-radius: 999px; border: 1px solid currentColor; font-weight: 500; font-size: 0.9rem; }
.status-option input:checked + span { background: color-mix(in srgb, currentColor 16%, transparent); box-shadow: inset 0 0 0 1px currentColor; font-weight: 700; }
.status-option input:checked + span::before { content: "✓ "; }
.status-option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.attachment-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; }
.attachment-grid a { display: flex; flex-direction: column; gap: 0.35rem; color: var(--text); }
.attachment-grid img, .attachment-pdf { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--lines); background: var(--background-gray); }
.attachment-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; font-weight: 700; color: var(--error); }
.attachment-name { font-size: 0.78rem; opacity: 0.8; overflow-wrap: anywhere; }
.danger-zone { display: flex; justify-content: flex-end; }
.btn-danger { color: var(--error); border-color: currentColor; }
.btn-danger:hover { background: rgba(211, 47, 47, 0.08); }

.login-wrap { display: grid; place-items: center; min-height: calc(100vh - var(--appbar-height) - 6rem); }
.login-card { width: min(444px, 100%); box-shadow: var(--elevation-2); border: 0; padding: 2rem; }
.login-card h1 { font-size: 1.5rem; margin-block-end: 1.25rem; }

.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.muted { opacity: 0.75; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media print {
    .appbar, .footer, .toc, .copy-btn, .hero-actions { display: none !important; }
    body { background: #fff; color: #000; }
    .section, .doc section, .card { break-inside: avoid; }
}
