/* ==========================================================================
   Qvicom Core — public site + auth surfaces
   Design tokens, marketing sections, and the sign-in experience.
   No external fonts, no CDN: everything renders offline.
   ========================================================================== */

:root {
    --bg: #070c17;
    --bg-soft: #0b1220;
    --panel: #0f1729;
    --panel-2: #131d33;
    --line: #21304d;
    --line-soft: rgba(33, 48, 77, .6);
    --text: #e9effb;
    --muted: #93a4c2;
    --muted-2: #6e7f9e;
    --brand: #3d7bfd;
    --brand-2: #7c4dff;
    --accent: #17c3b2;
    --ok: #22c55e;
    --warn: #f59e0b;
    --bad: #ef4444;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 24px 60px -28px rgba(3, 8, 20, .9);
    --max: 1200px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
    --bg: #f4f7fd;
    --bg-soft: #ffffff;
    --panel: #ffffff;
    --panel-2: #f7f9fe;
    --line: #dfe6f2;
    --line-soft: rgba(210, 220, 236, .9);
    --text: #0d1628;
    --muted: #5a6b86;
    --muted-2: #7b8aa3;
    --shadow: 0 22px 50px -30px rgba(20, 40, 90, .35);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -.022em; margin: 0 0 .5em; font-weight: 680; }
h1 { font-size: clamp(2rem, 4.4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.15rem); }
h3 { font-size: 1.16rem; }
p { margin: 0 0 1rem; }
small { font-size: .82rem; }

img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(61, 123, 253, .55); outline-offset: 3px; border-radius: 6px; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--brand); color: #fff; padding: .75rem 1.1rem; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

.shell { max-width: var(--max); margin: 0 auto; padding: 0 22px; }

/* ------------------------------------------------------------------- header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: saturate(160%) blur(14px);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    border-bottom: 1px solid var(--line-soft);
}
.site-header .shell { display: flex; align-items: center; gap: 28px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -.01em; color: var(--text); font-size: 1.06rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; font-weight: 800; font-size: .98rem;
    box-shadow: 0 10px 26px -10px rgba(61, 123, 253, .9);
}
.brand-text small { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
    color: var(--muted); font-size: .92rem; font-weight: 550; padding: .5rem .78rem;
    border-radius: 9px; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav .nav-cta { margin-left: 8px; }

.theme-toggle {
    width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
    background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }

.menu-toggle { display: none; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); width: 40px; height: 40px; border-radius: 11px; cursor: pointer; }

/* ------------------------------------------------------------------ buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .72rem 1.2rem; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-size: .93rem; font-weight: 620; cursor: pointer; transition: transform .15s, filter .15s, background .15s, border-color .15s;
    text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 14px 30px -16px rgba(61, 123, 253, .95); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-sm { padding: .45rem .8rem; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4.5rem); }
.hero::before, .hero::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; pointer-events: none;
}
.hero::before { width: 620px; height: 620px; background: radial-gradient(circle, rgba(61, 123, 253, .55), transparent 62%); top: -280px; left: -180px; }
.hero::after { width: 540px; height: 540px; background: radial-gradient(circle, rgba(124, 77, 255, .42), transparent 64%); top: -180px; right: -160px; }
.hero-grid {
    position: absolute; inset: 0; pointer-events: none; opacity: .28;
    background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}
.hero .shell { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; gap: 52px; align-items: center; }

.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem; font-size: .74rem; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
    background: rgba(23, 195, 178, .1); border: 1px solid rgba(23, 195, 178, .28);
    padding: .38rem .78rem; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { margin-bottom: 18px; }
.hero h1 .grad { background: linear-gradient(115deg, var(--brand) 8%, var(--brand-2) 52%, var(--accent) 96%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: clamp(1rem, 1.35vw, 1.16rem); color: var(--muted); max-width: 56ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 30px; }

.hero-metrics { display: flex; gap: 30px; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.hero-metrics div strong { display: block; font-size: 1.32rem; letter-spacing: -.02em; }
.hero-metrics div span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* console mock */
.console {
    background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0)), var(--panel);
    border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden;
}
.console-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dot.red { background: #ef4444aa; } .dot.amber { background: #f59e0baa; } .dot.green { background: #22c55eaa; }
.console-title { margin-left: 8px; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); font-weight: 650; }
.console-body { padding: 18px; display: grid; gap: 14px; }
.console-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.mini-stat b { display: block; font-size: 1.15rem; letter-spacing: -.02em; }
.mini-stat span { font-size: .68rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: .09em; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 54px; }
.spark i { flex: 1; background: linear-gradient(180deg, var(--brand), rgba(61, 123, 253, .18)); border-radius: 3px 3px 0 0; display: block; }
.console-list { display: grid; gap: 8px; font-size: .82rem; }
.console-list div { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.pill-dot.warn { background: var(--warn); } .pill-dot.bad { background: var(--bad); }

/* ----------------------------------------------------------------- sections */
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section-head { max-width: 62ch; margin-bottom: 42px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.02rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0)), var(--panel);
    border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
    transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .93rem; margin-bottom: 0; }
.card-icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
    background: rgba(61, 123, 253, .12); border: 1px solid rgba(61, 123, 253, .26); color: var(--brand);
}
.card-icon svg { width: 22px; height: 22px; }
.card ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }
.card ul li { margin-bottom: 4px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 11px; color: var(--muted); font-size: .95rem; }
.checklist li::before {
    content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
    background: rgba(34, 197, 94, .13); color: #4ade80; font-size: .76rem; font-weight: 800; margin-top: 2px;
}

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; counter-reset: step; }
.step-card { position: relative; padding-top: 30px; }
.step-card::before {
    counter-increment: step; content: "0" counter(step);
    font-family: var(--mono); font-size: .8rem; font-weight: 700; color: var(--brand);
    position: absolute; top: 0; left: 0; letter-spacing: .1em;
}

/* ------------------------------------------------------------------- login */
.login-band { padding: clamp(2.5rem, 5vw, 4rem) 0; background: var(--bg-soft); border-block: 1px solid var(--line-soft); }
.login-band .split { gap: 40px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.login-card h3 { margin-bottom: 6px; }
.login-card .hint { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: .8rem; font-weight: 650; color: var(--muted); margin-bottom: 6px; letter-spacing: .015em; }
.field input, .field select, .field textarea {
    width: 100%; padding: .74rem .9rem; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
    font-family: inherit; font-size: .94rem; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(61, 123, 253, .17);
}
.field .help { font-size: .78rem; color: var(--muted-2); margin-top: 5px; }
.field.error input, .field.error textarea, .field.error select { border-color: var(--bad); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* -------------------------------------------------------------- auth screens */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
    position: relative; overflow: hidden; padding: 44px;
    background: linear-gradient(160deg, #0a1220, #101b34 52%, #1a1440);
    display: flex; flex-direction: column; justify-content: space-between; color: #e9effb;
}
.auth-side::after {
    content: ""; position: absolute; inset: 0; opacity: .3;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 52px 52px; mask-image: radial-gradient(circle at 30% 20%, #000, transparent 70%);
}
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { font-size: 1.85rem; letter-spacing: -.03em; }
.auth-side p { color: #a9bad6; font-size: .96rem; }
.auth-side ul { list-style: none; padding: 0; display: grid; gap: 12px; margin-top: 18px; }
.auth-side li { display: flex; gap: 10px; font-size: .92rem; color: #c3d2e9; }
.auth-side li::before { content: "→"; color: var(--accent); font-weight: 700; }
.auth-main { display: grid; place-items: center; padding: 40px 22px; background: var(--bg); }
.auth-form { width: 100%; max-width: 420px; }
.auth-form .brand { margin-bottom: 26px; }
.auth-form h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-form .sub { color: var(--muted); font-size: .92rem; margin-bottom: 26px; }
.auth-links { display: flex; justify-content: space-between; font-size: .85rem; margin-top: 16px; flex-wrap: wrap; gap: 8px; }
.auth-foot { margin-top: 26px; font-size: .8rem; color: var(--muted-2); text-align: center; }

/* ------------------------------------------------------------------- alerts */
.alert { border-radius: var(--radius-sm); padding: .85rem 1rem; font-size: .9rem; margin-bottom: 16px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert-ok { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .35); color: #6ee7a0; }
.alert-bad { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); color: #fca5a5; }
.alert-warn { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); color: #fcd34d; }
.alert-info { background: rgba(61, 123, 253, .1); border-color: rgba(61, 123, 253, .35); color: #a9c6ff; }
[data-theme="light"] .alert-ok { color: #15803d; }
[data-theme="light"] .alert-bad { color: #b91c1c; }
[data-theme="light"] .alert-warn { color: #b45309; }
[data-theme="light"] .alert-info { color: #1d4ed8; }

/* ------------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line-soft); background: var(--bg-soft); padding: 46px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.site-footer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .13em; color: var(--muted-2); margin-bottom: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-links a { color: var(--muted); font-size: .88rem; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted-2); }

/* ------------------------------------------------------------------- legal */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 2rem; font-size: 1.25rem; }
.prose p, .prose li { color: var(--muted); }

/* ---------------------------------------------------------------- utilities */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack { display: grid; gap: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; letter-spacing: .03em; }
.badge-ok { background: rgba(34, 197, 94, .14); color: #4ade80; }
.badge-info { background: rgba(61, 123, 253, .14); color: #93b4ff; }
.badge-warn { background: rgba(245, 158, 11, .14); color: #fbbf24; }
.badge-bad { background: rgba(239, 68, 68, .14); color: #f87171; }
.badge-muted { background: rgba(147, 164, 194, .14); color: var(--muted); }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
    .hero .shell { grid-template-columns: 1fr; gap: 36px; }
    .hero::before, .hero::after { opacity: .34; }
    .split { grid-template-columns: 1fr; gap: 28px; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .nav a:not(.nav-cta) { display: none; }
    .menu-toggle { display: grid; place-items: center; }
    .nav.open { position: absolute; top: 70px; left: 0; right: 0; background: var(--panel); border-bottom: 1px solid var(--line); padding: 14px; flex-direction: column; align-items: stretch; gap: 4px; }
    .nav.open a { display: block; padding: .7rem .8rem; }
}

@media (max-width: 680px) {
    body { font-size: 15.4px; }
    .shell { padding: 0 16px; }
    .console-row { grid-template-columns: 1fr 1fr; }
    .hero-metrics { gap: 18px; }
    .grid-2 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .card { padding: 20px; }
    .login-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
    .site-header, .site-footer, .hero-actions, .nav { display: none !important; }
    body { background: #fff; color: #000; }
}
