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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ──────────────────────────────────────────── */
.app-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.brand-icon { font-size: 1.2rem; }

.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-email { font-size: .85rem; color: var(--text-muted); }
.nav-link { font-size: .875rem; color: var(--text-muted); }

/* ── Flash messages ──────────────────────────────── */
.flash-wrap {
    max-width: 1100px;
    margin: 1rem auto 0;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

/* ── Main layout ─────────────────────────────────── */
.app-main { padding: 2rem 1.5rem; }

.page-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.page-sub { color: var(--text-muted); margin-top: .25rem; }

/* ── Auth ─────────────────────────────────────────── */
.auth-wrap {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
}

.auth-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: .5rem;
}

.auth-sub {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .875rem;
    color: var(--text-muted);
}

/* ── Form fields ─────────────────────────────────── */
.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .4rem;
    color: var(--text);
}

.field label small { color: var(--text-muted); font-weight: 400; }

.field sl-input { width: 100%; }

/* ── Sites grid ──────────────────────────────────── */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.site-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
}

.site-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }

.site-name {
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-url {
    font-size: .8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-row {
    display: flex;
    gap: 1.5rem;
    padding: .75rem;
    background: var(--bg);
    border-radius: 6px;
}

.score-item { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.score-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.score-val { font-size: 1.4rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }

.score-good { color: var(--success); }
.score-needs-work { color: var(--warning); }
.score-poor { color: var(--danger); }

.no-audit-msg { font-size: .875rem; color: var(--text-muted); }

.site-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.last-audit { font-size: .8rem; color: var(--text-muted); }

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

.field-hint { font-size: .8rem; color: var(--text-muted); margin-top: .35rem; }

/* ── Steps ───────────────────────────────────────── */
.steps {
    display: flex;
    align-items: center;
    margin-bottom: 1.75rem;
    gap: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    flex-shrink: 0;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
}

.step-label { font-size: .72rem; color: var(--text-muted); text-align: center; white-space: nowrap; }

.step-active .step-num  { background: var(--primary); color: white; }
.step-active .step-label { color: var(--primary); font-weight: 600; }
.step-done .step-num    { background: var(--success); color: white; }
.step-done .step-label  { color: var(--success); }
.step-inactive .step-num { background: var(--border); color: var(--text-muted); }

.step-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
    margin-bottom: 18px;
}
.step-line-done { background: var(--success); }

/* ── Info box ─────────────────────────────────────── */
.info-box {
    display: flex;
    gap: .75rem;
    padding: 1rem 1.25rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    font-size: .875rem;
    color: #1e40af;
    margin-bottom: 1rem;
}

/* ── Status rows ─────────────────────────────────── */
.status-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .75rem;
    border-radius: 6px;
    font-size: .875rem;
}
.status-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.status-error   { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* ── Empty state ─────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-state h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
}

.empty-state p { color: var(--text-muted); max-width: 400px; }
