/* ============================================
   Districts — districts.appgeniusstudios.com
   Shared palette for login + dashboard.
   ============================================ */

:root {
    --district-bg-1: #0F172A;
    --district-bg-2: #1E293B;
    --district-card: #FFFFFF;
    --district-border: #E2E8F0;
    --district-primary: #3B82F6;
    --district-primary-2: #2563EB;
    --district-accent: #6366F1;
    --district-text: #0F172A;
    --district-muted: #64748B;
    --district-success: #16A34A;
    --district-danger: #DC2626;
    --district-warn: #F59E0B;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--district-bg-1) 0%, var(--district-bg-2) 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    color: #E2E8F0;
}

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

button {
    font-family: inherit;
    cursor: pointer;
}

.shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Top bar ─────────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(15,23,42,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    color: #F1F5F9;
    font-size: 1.1rem;
}
.topbar .brand .badge {
    background: linear-gradient(135deg, var(--district-primary), var(--district-accent));
    color: #fff;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.topbar .actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar .who {
    color: #94A3B8;
    font-size: 0.85rem;
}
.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: #F1F5F9;
    border: 1px solid rgba(255,255,255,0.10);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-secondary:hover { background: rgba(255,255,255,0.10); }

/* ─── Main content ───────────────────────────────────────────── */
.main {
    flex: 1;
    padding: 32px 24px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.card {
    background: var(--district-card);
    color: var(--district-text);
    border: 1px solid var(--district-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.h1 {
    color: #F1F5F9;
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 6px;
}
.muted { color: var(--district-muted); font-size: 0.9rem; }
.muted-light { color: #94A3B8; font-size: 0.9rem; }

/* ─── District chooser cards ────────────────────────────────── */
.chooser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.chooser-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.chooser-card:hover {
    background: rgba(99,102,241,0.10);
    border-color: rgba(99,102,241,0.45);
    transform: translateY(-2px);
}
.chooser-card .name {
    color: #F1F5F9;
    font-weight: 700;
    font-size: 1.05rem;
}
.chooser-card .meta {
    color: #94A3B8;
    font-size: 0.82rem;
    margin-top: 4px;
}
.chooser-card .super-tag {
    display: inline-block;
    background: rgba(245,158,11,0.18);
    color: var(--district-warn);
    border: 1px solid rgba(245,158,11,0.45);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 8px;
}

/* ─── Section grid (placeholder dashboard) ───────────────────── */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.dash-tile {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 22px;
    color: #F1F5F9;
}
.dash-tile .icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: block;
}
.dash-tile .title {
    font-weight: 700;
    font-size: 1.05rem;
}
.dash-tile .desc {
    color: #94A3B8;
    font-size: 0.85rem;
    margin-top: 4px;
}
.dash-tile .pill {
    display: inline-block;
    margin-top: 10px;
    padding: 3px 9px;
    background: rgba(99,102,241,0.15);
    color: var(--district-accent);
    border: 1px solid rgba(99,102,241,0.35);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ─── Login page ──────────────────────────────────────────── */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    background: var(--district-card);
    color: var(--district-text);
    border-radius: 18px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-card h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    color: var(--district-primary-2);
}
.login-card .sub {
    color: var(--district-muted);
    font-size: 0.9rem;
    margin-bottom: 22px;
}

.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--district-muted);
    margin-bottom: 6px;
}
.field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--district-border);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--district-text);
    background: #FFFFFF;
}
.field input:focus {
    outline: none;
    border-color: var(--district-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

.btn-primary {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--district-primary) 0%, var(--district-primary-2) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.divider {
    text-align: center;
    color: var(--district-muted);
    font-size: 0.8rem;
    margin: 18px 0;
    position: relative;
}
.divider::before, .divider::after {
    content: '';
    position: absolute; top: 50%;
    width: calc(50% - 24px);
    height: 1px;
    background: var(--district-border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

.sso-grid {
    display: grid;
    gap: 8px;
}
.sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    color: var(--district-text);
    border: 1px solid var(--district-border);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.15s;
}
.sso-btn:hover { background: #F8FAFC; }
.sso-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sso-btn svg { flex-shrink: 0; }

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 12px;
    border: 1px solid transparent;
}
.alert-error {
    background: rgba(220,38,38,0.08);
    border-color: rgba(220,38,38,0.3);
    color: var(--district-danger);
}
.alert-info {
    background: rgba(59,130,246,0.08);
    border-color: rgba(59,130,246,0.3);
    color: var(--district-primary-2);
}

.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Empty / blocked ─────────────────────────────────────── */
.gate-block {
    max-width: 520px;
    margin: 64px auto;
    text-align: center;
    background: var(--district-card);
    color: var(--district-text);
    padding: 36px 28px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.gate-block .icon {
    font-size: 2.4rem;
    margin-bottom: 8px;
}
.gate-block h2 { margin: 0 0 8px; color: var(--district-danger); }
.gate-block p { color: var(--district-muted); margin: 0 0 18px; }

@media (max-width: 720px) {
    .topbar { padding: 12px 16px; }
    .main { padding: 20px 16px; }
}
