html { scroll-behavior: smooth; }
body { min-height: 100vh; }

:root {
    --theme-surface: #07111f;
    --theme-surface-elevated: rgba(2, 6, 23, 0.78);
    --theme-border: rgba(30, 41, 59, 0.9);
    --theme-text: #e2e8f0;
    --theme-muted: #94a3b8;
}

html[data-theme='light'] {
    --theme-surface: #f1f5f9;
    --theme-surface-elevated: rgba(255, 255, 255, 0.92);
    --theme-border: rgba(148, 163, 184, 0.45);
    --theme-text: #0f172a;
    --theme-muted: #475569;
}

body {
    background: var(--theme-surface);
    color: var(--theme-text);
    transition: background-color 220ms ease, color 220ms ease;
}

::selection {
    background: rgba(6, 182, 212, 0.25);
    color: #ffffff;
}

.card-grid {
    display: grid;
    gap: 1.5rem;
}

.auth-shadow {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.soft-border {
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.calendar-icon-visible {
    color-scheme: light;
}

.calendar-icon-visible::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(86%) sepia(19%) saturate(1058%) hue-rotate(160deg) brightness(103%) contrast(102%);
    opacity: 1;
}

.theme-toggle {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-elevated);
    color: var(--theme-text);
    padding: 0.55rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.18);
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(6, 182, 212, 0.5);
}

.theme-toggle:focus-visible {
    outline: 2px solid rgba(6, 182, 212, 0.7);
    outline-offset: 2px;
}

.theme-toggle-icon {
    display: inline-flex;
    width: 1.1rem;
    align-items: center;
    justify-content: center;
}

/* Light mode overrides for Tailwind utility-heavy markup across pages. */
html[data-theme='light'] .bg-brand-dark { background-color: #f1f5f9 !important; }
html[data-theme='light'] .bg-slate-950 { background-color: #ffffff !important; }
html[data-theme='light'] .bg-slate-950\/75,
html[data-theme='light'] .bg-slate-950\/70,
html[data-theme='light'] .bg-slate-950\/60,
html[data-theme='light'] .bg-slate-950\/80,
html[data-theme='light'] .bg-slate-900\/80,
html[data-theme='light'] .bg-slate-900\/70,
html[data-theme='light'] .bg-slate-900 { background-color: #ffffff !important; }
html[data-theme='light'] .bg-slate-950\/50 { background-color: #f8fafc !important; }

html[data-theme='light'] .border-slate-800,
html[data-theme='light'] .border-slate-800\/80,
html[data-theme='light'] .border-slate-700 { border-color: rgba(148, 163, 184, 0.45) !important; }

html[data-theme='light'] .bg-slate-950 .text-white,
html[data-theme='light'] .bg-slate-950\/75 .text-white,
html[data-theme='light'] .bg-slate-950\/70 .text-white,
html[data-theme='light'] .bg-slate-950\/60 .text-white,
html[data-theme='light'] .bg-slate-950\/50 .text-white,
html[data-theme='light'] .bg-slate-900 .text-white,
html[data-theme='light'] .bg-slate-900\/80 .text-white,
html[data-theme='light'] .bg-slate-900\/70 .text-white { color: #0f172a !important; }

html[data-theme='light'] .bg-slate-950 .text-slate-300,
html[data-theme='light'] .bg-slate-950\/75 .text-slate-300,
html[data-theme='light'] .bg-slate-950\/70 .text-slate-300,
html[data-theme='light'] .bg-slate-950\/60 .text-slate-300,
html[data-theme='light'] .bg-slate-950\/80 .text-slate-300,
html[data-theme='light'] .bg-slate-950\/50 .text-slate-300,
html[data-theme='light'] .bg-slate-900 .text-slate-300,
html[data-theme='light'] .bg-slate-900\/80 .text-slate-300,
html[data-theme='light'] .bg-slate-900\/70 .text-slate-300 { color: #334155 !important; }

html[data-theme='light'] .bg-slate-950 .text-slate-200,
html[data-theme='light'] .bg-slate-950\/80 .text-slate-200,
html[data-theme='light'] .bg-slate-900 .text-slate-200,
html[data-theme='light'] .bg-slate-900\/80 .text-slate-200 {
    color: #1e293b !important;
}

html[data-theme='light'] .bg-slate-950 .text-slate-400,
html[data-theme='light'] .bg-slate-950\/75 .text-slate-400,
html[data-theme='light'] .bg-slate-950\/70 .text-slate-400,
html[data-theme='light'] .bg-slate-950\/60 .text-slate-400,
html[data-theme='light'] .bg-slate-950\/50 .text-slate-400,
html[data-theme='light'] .bg-slate-900 .text-slate-400,
html[data-theme='light'] .bg-slate-900\/80 .text-slate-400,
html[data-theme='light'] .bg-slate-900\/70 .text-slate-400,
html[data-theme='light'] .bg-slate-950 .text-slate-500,
html[data-theme='light'] .bg-slate-950\/75 .text-slate-500,
html[data-theme='light'] .bg-slate-950\/70 .text-slate-500,
html[data-theme='light'] .bg-slate-950\/60 .text-slate-500,
html[data-theme='light'] .bg-slate-950\/50 .text-slate-500,
html[data-theme='light'] .bg-slate-900 .text-slate-500,
html[data-theme='light'] .bg-slate-900\/80 .text-slate-500,
html[data-theme='light'] .bg-slate-900\/70 .text-slate-500 { color: #64748b !important; }

html[data-theme='light'] .from-slate-950 {
    --tw-gradient-from: #ffffff var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html[data-theme='light'] .to-slate-900 {
    --tw-gradient-to: #f8fafc var(--tw-gradient-to-position) !important;
}

html[data-theme='light'] .from-slate-950 .text-white,
html[data-theme='light'] .to-slate-900 .text-white {
    color: #0f172a !important;
}

html[data-theme='light'] .from-slate-950 .text-slate-300,
html[data-theme='light'] .to-slate-900 .text-slate-300 {
    color: #334155 !important;
}

html[data-theme='light'] .from-slate-950 .text-slate-400,
html[data-theme='light'] .to-slate-900 .text-slate-400,
html[data-theme='light'] .from-slate-950 .placeholder\:text-slate-500::placeholder,
html[data-theme='light'] .to-slate-900 .placeholder\:text-slate-500::placeholder {
    color: #64748b !important;
}

html[data-theme='light'] .from-slate-950 input,
html[data-theme='light'] .from-slate-950 select,
html[data-theme='light'] .to-slate-900 input,
html[data-theme='light'] .to-slate-900 select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.45) !important;
}

html[data-theme='light'] .text-cyan-300 { color: #0f766e !important; }
html[data-theme='light'] .text-emerald-300 { color: #047857 !important; }
html[data-theme='light'] .text-amber-300 { color: #b45309 !important; }
html[data-theme='light'] .text-rose-300 { color: #be123c !important; }

html[data-theme='light'] .bg-cyan-500\/10 { background-color: rgba(8, 145, 178, 0.12) !important; }
html[data-theme='light'] .bg-emerald-500\/10 { background-color: rgba(5, 150, 105, 0.12) !important; }
html[data-theme='light'] .bg-amber-500\/10 { background-color: rgba(217, 119, 6, 0.12) !important; }

html[data-theme='light'] main {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%) !important;
}

html[data-theme='light'] .shadow-2xl,
html[data-theme='light'] .shadow-glow {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme='light'] .hero-section {
    border-bottom-color: rgba(148, 163, 184, 0.35) !important;
}

html[data-theme='light'] .hero-overlay {
    background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.14), transparent 40%),
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.12), transparent 36%),
        linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%) !important;
}

html[data-theme='light'] .hero-section .text-white {
    color: #0f172a !important;
}

html[data-theme='light'] .hero-section .text-slate-300 {
    color: #334155 !important;
}

html[data-theme='light'] .hero-section .text-slate-200 {
    color: #334155 !important;
}

html[data-theme='light'] .hero-section .text-slate-400,
html[data-theme='light'] .hero-section .text-slate-500 {
    color: #64748b !important;
}

html[data-theme='light'] #tab-signin {
    background-color: #0891b2 !important;
    color: #ffffff !important;
}

html[data-theme='light'] #tab-signup {
    color: #475569 !important;
}

html[data-theme='light'] #tab-signup:hover {
    color: #0f172a !important;
}

html[data-theme='light'] #logout-button {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.6) !important;
}

html[data-theme='light'] #logout-button:hover {
    border-color: rgba(8, 145, 178, 0.55) !important;
    color: #0b4a6f !important;
}

html[data-theme='light'] .sl-requirement-toggle {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.6) !important;
}

html[data-theme='light'] .sl-requirement-toggle:hover {
    border-color: rgba(8, 145, 178, 0.55) !important;
    color: #0b4a6f !important;
}

html[data-theme='light'] #sl-available-demos-toggle {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.6) !important;
}

html[data-theme='light'] #sl-available-demos-toggle:hover {
    border-color: rgba(8, 145, 178, 0.55) !important;
    color: #0b4a6f !important;
}

html[data-theme='light'] #sl-available-demos-toggle-declined {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.6) !important;
}

html[data-theme='light'] #sl-available-demos-toggle-declined:hover {
    border-color: rgba(8, 145, 178, 0.55) !important;
    color: #0b4a6f !important;
}

@media (max-width: 640px) {
    .theme-toggle {
        right: 0.75rem;
        bottom: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}
