/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg:        #0d0d0d;
    --color-surface:   #1a1a1a;
    --color-border:    #2e2e2e;
    --color-text:      #e8e8e8;
    --color-muted:     #888;
    --color-accent:    #c9952a;   /* Amber gold */
    --color-danger:    #e05252;
    --font-sans:       'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:       'JetBrains Mono', 'Fira Code', monospace;
    --radius:          6px;
    --max-w:           760px;
}

html { font-size: 16px; }

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--color-border);
}

.site-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.site-header nav a {
    color: var(--color-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.site-header nav a:hover { color: var(--color-text); }

.nav-user { color: var(--color-muted); }

main {
    flex: 1;
    max-width: var(--max-w);
    width: 100%;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.site-footer {
    padding: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-muted);
    border-top: 1px solid var(--color-border);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }

.btn--primary  { background: var(--color-accent); color: #000; }
.btn--secondary { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.alert--error   { background: rgba(224,82,82,0.15); border: 1px solid var(--color-danger); color: #f09090; }
.alert--success { background: rgba(29,185,84,0.12); border: 1px solid var(--color-accent); color: #6ee49a; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 4rem 0;
}
.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin-bottom: 1.2rem;
}
.hero p {
    font-size: 1.1rem;
    color: var(--color-muted);
    max-width: 520px;
    margin: 0 auto 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; }

/* ── Auth forms ───────────────────────────────────────────────────────────── */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
}
.auth-form h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.auth-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 0.3rem;
    margin-top: 1rem;
}
.auth-form label:first-of-type { margin-top: 0; }
.auth-form .optional { font-size: 0.75rem; }

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}
.auth-form input:focus { border-color: var(--color-accent); }

.auth-form .btn { width: 100%; margin-top: 1.5rem; text-align: center; }
.auth-form p    { margin-top: 1.2rem; font-size: 0.85rem; color: var(--color-muted); }
.auth-form p a  { color: var(--color-text); }

/* ── Dashboard ────────────────────────────────────────────────────────────── */
.dashboard h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
}
.dashboard h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.dashboard .platform-connections > p {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.platform-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.platform-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.2rem 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    min-width: 160px;
    transition: border-color 0.15s;
}
.platform-card:hover { border-color: var(--color-accent); }
.platform-card--disabled { opacity: 0.4; cursor: default; }
.platform-card .platform-name   { font-weight: 600; }
.platform-card .platform-action { font-size: 0.8rem; color: var(--color-muted); }

/* ── Error pages ──────────────────────────────────────────────────────────── */
.error-page { text-align: center; padding: 4rem 0; }
.error-page h1 { font-size: 4rem; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 1rem; }
.error-page p  { color: var(--color-muted); margin-bottom: 2rem; }

/* ── Alert info ───────────────────────────────────────────────────────────── */
.alert--info { background: rgba(59,130,246,0.12); border: 1px solid #3b82f6; color: #93c5fd; }

/* ── Dashboard v2 ─────────────────────────────────────────────────────────── */
.dash-header { margin-bottom: 2.5rem; }
.dash-header h1 { font-size: 2rem; font-weight: 700; }

.platform-section { margin-bottom: 2.5rem; }
.platform-section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.platform-section > p { color: var(--color-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.platform-connected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    gap: 1rem;
}
.platform-connected__info { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.platform-connected__label { font-weight: 600; font-size: 0.9rem; }
.platform-connected__meta  { font-size: 0.8rem; color: var(--color-muted); }

.platform-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.platform-badge--spotify { background: var(--color-accent); color: #000; }
.platform-badge--tidal   { background: #00ffff; color: #000; }

.sync-status { font-size: 0.85rem; color: var(--color-muted); }
.sync-status--pending { color: #f0a500; }

.btn--sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }

.stat-strip {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}
.stat-strip__item { display: flex; flex-direction: column; gap: 0.1rem; }
.stat-strip__value { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-strip__label { font-size: 0.75rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em; }
