/* ============================================================
   NOCOSTACK AUTH PAGES — shared styles
   Used by: login.php, signup.php, verify_code.php, confirm.php,
            request_reset.php, reset_password.php, mfa.php
   Copy this file to /css/auth.css.
   Brand: indigo #4F46E5 primary, teal #14B8A6 accent (matches
   the marketing site's offset-cards logo + Space Grotesk wordmark).
   ============================================================ */

:root {
    --brand:       #4F46E5;              /* indigo-600 — primary action */
    --brand-hover: #4338CA;              /* indigo-700 — hover */
    --brand-soft:  rgba(79, 70, 229, 0.12); /* focus ring */
    --brand-disabled: #A5B4FC;           /* indigo-300 — disabled button */
    --accent:      #14B8A6;              /* teal-500 — accent */
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #0f172a;
}

.auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
}

/* ── Logo / brand ─────────────────────────────────────────── */

.logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-mark svg {
    width: 30px;
    height: 30px;
    display: block;
}

.brand-name {
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: #0f172a;          /* "NoCo" */
}

.brand-name b {
    color: var(--brand);     /* "Stack" */
    font-weight: 700;
}

.logo-sub {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 400;
}

/* ── Fields ───────────────────────────────────────────────── */

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    margin: 0;
}

.field input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.field input::placeholder { color: #94a3b8; }

.field-hint {
    display: block;
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 5px;
}

/* ── Divider ──────────────────────────────────────────────── */

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.divider-line { flex: 1; height: 1px; background: #f1f5f9; }
.divider-text { font-size: 12px; color: #cbd5e1; }

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

.btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    letter-spacing: 0.01em;
}

.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { background: var(--brand-disabled); cursor: not-allowed; transform: none; }

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

.alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
}

.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ── Links / footer ───────────────────────────────────────── */

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 13px;
    color: #94a3b8;
    text-decoration: none;
    margin-top: 20px;
    transition: color 0.15s ease;
}

.back-link:hover { color: var(--brand); }

.footer-row {
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 20px;
}

.footer-row a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}

.footer-row a:hover { text-decoration: underline; }

.terms {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    margin-top: 16px;
    line-height: 1.6;
}

.terms a { color: var(--brand); text-decoration: none; }
.terms a:hover { text-decoration: underline; }

/* ── Phone input ──────────────────────────────────────────── */

.phone-wrap {
    display: flex;
    gap: 0;
}

.phone-prefix {
    padding: 10px 12px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    color: #64748b;
    white-space: nowrap;
    font-family: inherit;
}

.phone-wrap input {
    border-radius: 0 8px 8px 0 !important;
}

/* ── Section divider ──────────────────────────────────────── */

.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
}

.section-divider-line { flex: 1; height: 1px; background: #f1f5f9; }

.section-divider-text {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #cbd5e1;
}

/* ── Spinner ──────────────────────────────────────────────── */

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Turnstile / footer ───────────────────────────────────── */

.cf-turnstile { display: flex; justify-content: center; margin-bottom: 16px; }

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 11.5px;
    color: #cbd5e1;
}

/* login-card is an alias for auth-card */
.login-card,
.auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
}

/* ── Forgot-password row ──────────────────────────────────── */

.forgot-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: -8px;
    margin-bottom: 20px;
}

.forgot-link {
    font-size: 12px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .auth-card,
    .login-card { padding: 28px 20px; }
}