/* ============================================================
   Thriveo · Design System — dark-first, light-mode toggle
   ============================================================ */

/* ── Dark (default) ─────────────────────────────────────── */
:root {
    --bg:           #0a1628;
    --surface:      #122136;
    --surface-2:    #1a2d45;
    --surface-3:    #0d1e33;

    --teal:         #14b8a6;
    --teal-dim:     rgba(20, 184, 166, 0.15);
    --teal-border:  rgba(20, 184, 166, 0.35);

    --gold:         #c9a84c;
    --gold-dim:     rgba(201, 168, 76, 0.12);
    --gold-border:  rgba(201, 168, 76, 0.30);

    --text:         #f8fafc;
    --text-dim:     rgba(248, 250, 252, 0.50);
    --text-muted:   rgba(248, 250, 252, 0.30);

    --border:       rgba(255, 255, 255, 0.10);
    --border-hover: rgba(255, 255, 255, 0.20);

    --overlay-1:    rgba(255, 255, 255, 0.03);
    --overlay-2:    rgba(255, 255, 255, 0.06);
    --overlay-3:    rgba(255, 255, 255, 0.09);

    --input-bg:     rgba(255, 255, 255, 0.05);
    --input-focus:  rgba(255, 255, 255, 0.09);

    --shadow-sm:    0 4px 6px -1px rgba(0, 0, 0, 0.40);
    --shadow-md:    0 10px 20px -5px rgba(0, 0, 0, 0.50);
    --shadow-lg:    0 25px 50px -12px rgba(0, 0, 0, 0.60);

    --error-bg:     rgba(220, 38, 38, 0.12);
    --error-text:   #fca5a5;
    --error-border: rgba(220, 38, 38, 0.30);

    --success-bg:   rgba(20, 184, 166, 0.12);
    --success-text: #5eead4;
    --success-border: rgba(20, 184, 166, 0.30);

    --scrollbar-track: var(--bg);
    --scrollbar-thumb: var(--border);
}

/* ── Light override ──────────────────────────────────────── */
[data-theme="light"] {
    --bg:           #f8fafc;
    --surface:      #ffffff;
    --surface-2:    #f1f5f9;
    --surface-3:    #e8eef5;

    --teal:         #0d9488;
    --teal-dim:     rgba(13, 148, 136, 0.08);
    --teal-border:  rgba(13, 148, 136, 0.30);

    --gold:         #b8922e;
    --gold-dim:     rgba(184, 146, 46, 0.10);
    --gold-border:  rgba(184, 146, 46, 0.30);

    --text:         #0a1628;
    --text-dim:     #64748b;
    --text-muted:   #94a3b8;

    --border:       #e2e8f0;
    --border-hover: #cbd5e1;

    --overlay-1:    rgba(0, 0, 0, 0.02);
    --overlay-2:    rgba(0, 0, 0, 0.04);
    --overlay-3:    rgba(0, 0, 0, 0.06);

    --input-bg:     #ffffff;
    --input-focus:  #ffffff;

    --shadow-sm:    0 4px 6px -1px rgba(0, 0, 0, 0.07);
    --shadow-md:    0 10px 20px -5px rgba(0, 0, 0, 0.10);
    --shadow-lg:    0 25px 50px -12px rgba(0, 0, 0, 0.14);

    --error-bg:     #fef2f2;
    --error-text:   #991b1b;
    --error-border: #fee2e2;

    --success-bg:   #f0fdfa;
    --success-text: #0d9488;
    --success-border: #ccfbf1;

    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;
}

/* ── Base reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.25s, color 0.25s;
    font-size: 16px;
    line-height: 1.6;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar              { width: 8px; height: 8px; }
::-webkit-scrollbar-track        { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb        { background: var(--scrollbar-thumb); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover  { background: var(--text-muted); }

/* ── Theme toggle button ─────────────────────────────────── */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--overlay-2);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--overlay-3);
    color: var(--text);
    border-color: var(--border-hover);
}
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }

/* ── Shared header ───────────────────────────────────────── */
.th-header {
    padding: 18px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.th-header-left { display: flex; align-items: center; gap: 14px; }
.th-logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
    letter-spacing: -0.5px;
}
.th-logo span { color: var(--teal); }
.th-header-right { display: flex; align-items: center; gap: 16px; }

/* ── Shared button styles ────────────────────────────────── */
.btn-teal {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: var(--teal);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-teal:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-gold {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: var(--gold);
    color: var(--bg);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--overlay-2);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-ghost:hover { background: var(--overlay-3); color: var(--text); }

/* ── Card ────────────────────────────────────────────────── */
.th-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: background 0.25s, border-color 0.25s;
}
.th-card:hover { border-color: var(--border-hover); }

/* ── Badge ───────────────────────────────────────────────── */
.badge-teal { background: var(--teal-dim); color: var(--teal); border: 1px solid var(--teal-border); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.badge-gold { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-border); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

/* ── Form inputs ─────────────────────────────────────────── */
.th-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: 0.25s;
    font-family: inherit;
}
.th-input::placeholder { color: var(--text-muted); }
.th-input:focus {
    border-color: var(--teal);
    background: var(--input-focus);
    box-shadow: 0 0 0 3px var(--teal-dim);
}
select.th-input option { background: var(--surface); color: var(--text); }

/* ── Error box ───────────────────────────────────────────── */
.th-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ── Typing animation ────────────────────────────────────── */
.typing { display: flex; gap: 5px; padding: 10px 15px; background: var(--surface-2); border-radius: 12px; width: fit-content; }
.dot { width: 8px; height: 8px; background: var(--gold); border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

/* ── Utility ─────────────────────────────────────────────── */
.text-teal   { color: var(--teal); }
.text-gold   { color: var(--gold); }
.text-dim    { color: var(--text-dim); }
.text-muted  { color: var(--text-muted); }
