/* ─── Sign-in screen — Bridgeland Map ───────────────────────── */

:root {
    --login-bg: #f1f5f9;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --brand-navy: #1B2A4A;
    --brand-blue: #3D5A8C;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --success: #15803d;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;
}

[data-theme="dark"] {
    --login-bg: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --brand-navy: #e2e8f0;
    --brand-blue: #7d9dd1;
    --danger: #fca5a5;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.3);
    --success: #86efac;
    --success-bg: rgba(34, 197, 94, 0.12);
    --success-border: rgba(34, 197, 94, 0.3);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--login-bg);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.login-main {
    width: 100%;
    max-width: 26rem;
    margin: 0 auto;
    padding: 3.5rem 1rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

/* ─── Brand ─────────────────────────────────────────────────── */

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-logo {
    height: 34px;
    width: auto;
    max-width: 100%;
}

[data-theme="dark"] .brand-logo text[fill="#1B2A4A"] { fill: #e2e8f0; }
[data-theme="dark"] .brand-logo text[fill="#3D5A8C"] { fill: #7d9dd1; }
[data-theme="dark"] .brand-logo path[stroke="#3D5A8C"] { stroke: #7d9dd1; }

.login-tagline {
    margin: 0.85rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ─── Card ──────────────────────────────────────────────────── */

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
}

.login-step {
    display: flex;
    flex-direction: column;
}

/* display:flex above would otherwise win over the hidden attribute */
.login-step[hidden],
.alert[hidden] {
    display: none;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.field-hint {
    margin: 0 0 0.7rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.text-input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-color);
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.text-input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgb(61 90 140 / 0.15);
}

.code-input {
    text-align: center;
    font-size: 1.6rem;
    letter-spacing: 0.5em;
    text-indent: 0.5em;   /* centre the text against its own letter-spacing */
    padding: 0.65rem 0.5rem;
}

/* Hidden from people, filled in by naive bots. */
.honeypot {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ─── Buttons ───────────────────────────────────────────────── */

.btn-primary {
    margin-top: 1rem;
    width: 100%;
    padding: 0.72rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--brand-navy);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover:not(:disabled) { background: #26385f; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

[data-theme="dark"] .btn-primary {
    background: var(--brand-blue);
    color: #0f172a;
}
[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #93b0de; }

.btn-link {
    margin-top: 0.75rem;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
}

.btn-link:hover { color: var(--text-color); }

/* ─── Alerts ────────────────────────────────────────────────── */

.alert {
    margin-top: 0.85rem;
    padding: 0.6rem 0.75rem;
    border-radius: 9px;
    font-size: 0.82rem;
    line-height: 1.45;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
}

.alert-success {
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

/* ─── Footer ────────────────────────────────────────────────── */

.login-footer {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .login-main { padding-top: 2.5rem; }
    .brand-logo { height: 26px; }
}
