/* ── Theme Tokens ──────────────────────────────────────────────────────── */
:root {
    --color-primary: #2563eb;
    --color-primary-rgb: 37, 99, 235;
    --color-secondary: #0ea5e9;
    --color-bg: 248 250 252; /* #f8fafc */
    --color-nav: 255 255 255;
    --color-text: 15 23 42; /* #0f172a */
    --color-muted: 100 116 139;
    --color-surface: 255 255 255;
    --color-surface-soft: 248 250 252;
    --color-border: 226 232 240;
}
/* Apple-blue theme (no data-theme set) */
:root:not([data-theme]) {
    --color-primary: #2563eb;
    --color-primary-rgb: 37, 99, 235;
    --color-secondary: #0ea5e9;
    --color-bg: 248 250 252;
    --color-nav: 255 255 255;
    --color-text: 15 23 42;
    --color-muted: 100 116 139;
    --color-surface: 255 255 255;
    --color-surface-soft: 248 250 252;
    --color-border: 226 232 240;
}

:root[data-theme="light"] {
    color-scheme: light;
    --color-bg: 248 250 252;
    --color-nav: 255 255 255;
    --color-text: 15 23 42;
    --color-muted: 100 116 139;
    --color-surface: 255 255 255;
    --color-surface-soft: 248 250 252;
    --color-border: 226 232 240;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --color-bg: 2 6 23;
    --color-nav: 15 23 42;
    --color-text: 226 232 240;
    --color-muted: 148 163 184;
    --color-surface: 15 23 42;
    --color-surface-soft: 30 41 59;
    --color-border: 51 65 85;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] {
        color-scheme: dark;
        --color-bg: 2 6 23;
        --color-nav: 15 23 42;
        --color-text: 226 232 240;
        --color-muted: 148 163 184;
        --color-surface: 15 23 42;
        --color-surface-soft: 30 41 59;
        --color-border: 51 65 85;
    }
}

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
    background-color: rgb(var(--color-bg));
    color: rgb(var(--color-text));
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s ease;
}

/* ── Navigation Glass ──────────────────────────────────────────────────── */
.apple-glass {
    background: rgba(var(--color-nav), 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgb(var(--color-border) / 0.65);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background-color 0.5s ease;
}

/* ── Hero Gradient ─────────────────────────────────────────────────────── */
.hero-gradient {
    background: linear-gradient(180deg, rgb(var(--color-surface)) 0%, rgb(var(--color-bg)) 100%);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.apple-btn {
    background-color: rgb(var(--color-surface));
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 980px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}
.apple-btn:hover {
    background-color: rgb(var(--color-surface-soft));
    transform: scale(1.02);
}
.apple-btn-blue {
    background-color: var(--color-primary);
    color: #ffffff;
    border-radius: 980px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    display: inline-block;
}
.apple-btn-blue:hover {
    background-color: #1d4ed8;
    transform: scale(1.01);
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.unlock-card {
    background: rgb(var(--color-surface));
    border: 1px solid rgb(var(--color-border));
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* Dashboard glassmorphism card – used across dashboard & modals */
.dash-card {
    background: rgb(var(--color-surface));
    border: 1px solid rgb(var(--color-border));
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

/* ── Glass Inputs ──────────────────────────────────────────────────────── */
.input-glass {
    background: rgb(var(--color-surface));
    border: 1px solid rgb(var(--color-border));
    color: rgb(var(--color-text));
    transition: all 0.3s ease;
}
.input-glass:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
    outline: none;
}
.input-glass::placeholder { color: rgb(var(--color-muted)); }

.svc-item.selected {
    background-color: rgb(var(--color-surface-soft));
    border-left: 3px solid var(--color-primary);
}
.svc-item.selected > div:first-child div:first-child { color: var(--color-primary) !important; }

.nav-link.active {
    background-color: rgb(var(--color-surface-soft));
    color: rgb(var(--color-text));
    font-weight: bold;
}

:root[data-theme="dark"] body,
:root[data-theme="system"] body {
    background-color: rgb(var(--color-bg));
    color: rgb(var(--color-text));
}

:root[data-theme="dark"] .bg-white,
:root[data-theme="system"] .bg-white {
    background-color: rgb(var(--color-surface)) !important;
}

:root[data-theme="dark"] .bg-slate-50,
:root[data-theme="system"] .bg-slate-50 {
    background-color: rgb(var(--color-bg)) !important;
}

:root[data-theme="dark"] .bg-slate-100,
:root[data-theme="system"] .bg-slate-100 {
    background-color: rgb(var(--color-surface-soft)) !important;
}

:root[data-theme="dark"] .text-slate-900,
:root[data-theme="dark"] .text-slate-800,
:root[data-theme="dark"] .text-slate-700,
:root[data-theme="system"] .text-slate-900,
:root[data-theme="system"] .text-slate-800,
:root[data-theme="system"] .text-slate-700 {
    color: rgb(var(--color-text)) !important;
}

:root[data-theme="dark"] .text-slate-600,
:root[data-theme="dark"] .text-slate-500,
:root[data-theme="dark"] .text-slate-400,
:root[data-theme="system"] .text-slate-600,
:root[data-theme="system"] .text-slate-500,
:root[data-theme="system"] .text-slate-400 {
    color: rgb(var(--color-muted)) !important;
}

:root[data-theme="dark"] .border-slate-100,
:root[data-theme="dark"] .border-slate-200,
:root[data-theme="dark"] .border-slate-300,
:root[data-theme="system"] .border-slate-100,
:root[data-theme="system"] .border-slate-200,
:root[data-theme="system"] .border-slate-300 {
    border-color: rgb(var(--color-border)) !important;
}

:root[data-theme="dark"] .shadow-sm,
:root[data-theme="dark"] .shadow-md,
:root[data-theme="dark"] .shadow-lg,
:root[data-theme="dark"] .shadow-xl,
:root[data-theme="dark"] .shadow-2xl,
:root[data-theme="system"] .shadow-sm,
:root[data-theme="system"] .shadow-md,
:root[data-theme="system"] .shadow-lg,
:root[data-theme="system"] .shadow-xl,
:root[data-theme="system"] .shadow-2xl {
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28) !important;
}

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes shimmer {
    100% { transform: translateX(100%); }
}
@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fade-in 0.35s ease-out both; }
