/* =============================================================
   base.css  --  design tokens, reset, layout primitives
   Imported by every page via base.html.
   ============================================================= */

:root {
    --bg:          #0f0f0f;
    --surface:     #1a1a1a;
    --surface2:    #242424;
    --border:      #2e2e2e;
    --accent:      #5b8dee;
    --accent-dim:  #3a5fa8;
    --text:        #e8e8e8;
    --text-dim:    #888;
    --text-muted:  #555;
    --success:     #4caf7d;
    --warning:     #e8a838;
    --danger:      #e05a5a;
    --radius:      6px;
    --font:        'Segoe UI', system-ui, sans-serif;
    --font-mono:   'Cascadia Code', 'Fira Code', monospace;
}

/* --- Reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout -------------------------------------------------- */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Nav ---------------------------------------------------- */
nav {
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 0;
}
nav .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 2rem;
}
nav .brand {
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text);
    font-size: 1rem;
    text-decoration: none;
}
nav .brand:hover { text-decoration: none; }
nav .brand span { color: var(--accent); }

nav .nav-links {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
nav .nav-link {
    font-size: 0.85rem;
    color: var(--text-dim);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    cursor: pointer;
    text-decoration: none;
}
nav .nav-link:hover {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface);
    text-decoration: none;
}
nav .nav-link.active {
    color: var(--accent);
    border-color: var(--border);
    background: var(--surface);
}
nav .nav-sep {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 0.25rem;
}

/* --- Beta banner -------------------------------------------- */
.beta-banner {
    background: color-mix(in srgb, var(--warning) 8%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--warning) 25%, transparent);
    padding: 0.45rem 1.5rem;
    text-align: center;
    font-size: 0.82rem;
    color: color-mix(in srgb, var(--warning) 90%, var(--text));
    line-height: 1.4;
}
.beta-banner a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}
.beta-banner a:hover { opacity: 0.8; }

/* --- Typography --------------------------------------------- */
h1 { font-size: 1.75rem; font-weight: 600; margin-bottom: 0.75rem; }
h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.5rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.35rem; }
p  { margin-bottom: 0.75rem; color: var(--text-dim); }

/* --- Cards -------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* --- Buttons ------------------------------------------------ */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: opacity 0.15s;
    text-decoration: none;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
}

/* --- Footer ------------------------------------------------- */
footer {
    border-top: 1px solid var(--border);
    padding: 1.75rem 0;
    margin-top: 4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
footer .inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
footer a { color: var(--text-muted); text-decoration: underline; }
footer a:hover { color: var(--text-dim); }

/* =============================================================
   Responsive: mobile (max 640px)
   ============================================================= */
@media (max-width: 640px) {
    html { font-size: 15.5px; }

    .container { padding: 0 1rem; }

    nav .inner { padding: 0 1rem; }
    nav .brand { font-size: 0.92rem; }
    nav .nav-link { font-size: 0.78rem; padding: 0.25rem 0.5rem; }
    nav .nav-sep { margin: 0 0.1rem; }

    .beta-banner { font-size: 0.75rem; padding: 0.4rem 1rem; }

    footer .inner { padding: 0 1rem; flex-direction: column; gap: 0.4rem; text-align: center; }

    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.1rem; }
    h3 { font-size: 1rem; }
}

/* ── Feedback dialog ─────────────────────────────────────────────────────── */

.footer-feedback-btn {
    background: none;
    border: none;
    color: var(--accent, #6ea8fe);
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
}

#feedback-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
#feedback-overlay.open { display: flex; }

.feedback-dialog {
    background: var(--card-bg, #1a1f26);
    border: 1px solid var(--border, #2a3138);
    border-radius: 10px;
    max-width: 480px;
    width: 100%;
    padding: 1.25rem 1.4rem;
}
.feedback-dialog h3 { margin: 0 0 0.4rem; }
.feedback-dialog p  { margin: 0 0 0.8rem; font-size: 0.9rem; opacity: 0.85; }

.feedback-dialog textarea,
.feedback-dialog input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    background: var(--input-bg, #12161b);
    color: inherit;
    border: 1px solid var(--border, #2a3138);
    border-radius: 6px;
    padding: 0.55rem 0.7rem;
    font: inherit;
    margin-bottom: 0.6rem;
}
.feedback-dialog textarea { min-height: 110px; resize: vertical; }

/* Honeypot: visually removed, still fillable by naive bots */
#feedback-website {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    opacity: 0;
}

.feedback-status { min-height: 1.2em; font-size: 0.85rem; margin-bottom: 0.5rem; }
.feedback-status.success { color: #6fcf87; }
.feedback-status.error   { color: #e57373; }

.feedback-actions { display: flex; gap: 0.6rem; justify-content: flex-end; }

/* ── Questionnaire retention helpers (shared toast) ─────────────────────── */

.qn-toast {
    position: fixed;
    left: 50%;
    bottom: 1.2rem;
    transform: translateX(-50%);
    background: var(--card-bg, #1a1f26);
    border: 1px solid var(--border, #2a3138);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    z-index: 150;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
    display: flex;
    gap: 0.8rem;
    align-items: center;
    max-width: min(92vw, 480px);
}
.qn-toast button {
    background: none;
    border: none;
    color: var(--accent, #6ea8fe);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    padding: 0;
    white-space: nowrap;
}
