/* Alchemis auth pages — v2 branding (dark surfaces, gold + sage, Poppins/Inter, logo lockup).
   One stylesheet + the shared _Layout drive every Account/* Razor page. */
:root {
    /* Surfaces (v2 dark theme) */
    --bg-base: #0d0d0e;
    --bg-card: #1a1a1c;
    --bg-input: #242426;
    --bg-elevated: #2d2d30;

    /* Brand */
    --gold: #d4af37;
    --gold-bright: #e6c34d;
    --gold-dim: #b8962f;
    --sage: #a3b18a;
    --frost: #88c0d0;
    --aubergine: #2c1b3f;

    /* Text */
    --text: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.55);

    /* Lines */
    --border: rgba(255, 255, 255, 0.10);
    --border-subtle: rgba(255, 255, 255, 0.06);

    /* Status */
    --amber: #ffb74d;
    --error: #e57373;

    /* Back-compat aliases (older markup referenced these) */
    --charcoal: var(--bg-base);
    --charcoal-raised: var(--bg-card);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: var(--bg-base);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient brand glow behind the card — aubergine is decorative-only, exactly this kind of use. */
.auth-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    /* Column so the language switcher sits under the card rather than beside it. */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
    overflow: hidden;
    background:
        radial-gradient(60rem 40rem at 50% -10%, rgba(44, 27, 63, 0.55), transparent 60%),
        radial-gradient(40rem 30rem at 50% 120%, rgba(212, 175, 55, 0.08), transparent 60%),
        var(--bg-base);
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 408px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 40px 34px 34px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* Hairline gold accent along the top edge of the card. */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.7), transparent);
}

/* ── Brand lockup ───────────────────────────────────────────── */
.auth-brand {
    text-align: center;
    margin-bottom: 30px;
}

.auth-brand-logo {
    display: block;
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(207, 159, 87, 0.28);
}

.auth-brand-mark {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 26px;
    color: var(--gold);
    letter-spacing: 0.5px;
}

.auth-brand-tagline {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Headings ───────────────────────────────────────────────── */
.auth-card h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 22px;
    margin: 0 0 6px;
    text-align: center;
    color: var(--text);
}

.auth-card .auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 26px;
    text-align: center;
    line-height: 1.5;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 7px;
    color: var(--text-secondary);
}

.form-group input[type='email'],
.form-group input[type='password'],
.form-group input[type='text'] {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-row input[type='checkbox'] {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 13px 16px;
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    color: #1a1208;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.22);
}

.btn-primary:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(212, 175, 55, 0.30);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.20);
}

.btn-secondary {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    margin-top: 10px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.btn-secondary:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.06);
}

/* ── Social login ───────────────────────────────────────────── */
/* Divider with a centred "or" label between the password form and the provider buttons. */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: var(--text-muted);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.social-logins {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-social {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.btn-social:hover {
    border-color: var(--gold);
    background: var(--bg-elevated);
    transform: translateY(-1px);
}

.btn-social:active {
    transform: translateY(0);
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(229, 115, 115, 0.12);
    border-left: 3px solid var(--error);
    color: #f0a5a5;
}

.alert-info {
    background: rgba(255, 183, 77, 0.10);
    border-left: 3px solid var(--amber);
    color: var(--amber);
}

.alert-success {
    background: rgba(163, 177, 138, 0.12);
    border-left: 3px solid var(--sage);
    color: var(--sage);
}

.field-error {
    color: #f0a5a5;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Quiet helper text under an input (password rules, optional-field notes). */
.field-hint {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
    margin-top: 5px;
    display: block;
}

/* ── Language switcher (under the card) ─────────────────────── */
.lang-switch {
    position: relative;
    display: flex;
    gap: 14px;
    font-size: 12.5px;
}

.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
}

.lang-switch a:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

.lang-switch a.active {
    color: var(--gold);
}

/* ── 2FA tabs ───────────────────────────────────────────────── */
.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 4px;
}

.auth-tabs button {
    flex: 1;
    padding: 9px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-tabs button.active {
    background: var(--bg-elevated);
    color: var(--gold);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ── 2FA setup / recovery ───────────────────────────────────── */
.recovery-codes {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
    font-family: ui-monospace, 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    columns: 2;
    color: var(--text);
}

.qr-wrap {
    text-align: center;
    margin: 16px 0;
}

.qr-wrap img {
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.secret-key {
    font-family: ui-monospace, 'JetBrains Mono', 'Courier New', monospace;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px;
    text-align: center;
    letter-spacing: 2px;
    word-break: break-all;
    font-size: 14px;
    margin: 12px 0;
    color: var(--text);
}

/* ── Links ──────────────────────────────────────────────────── */
.muted-link {
    color: var(--gold);
    font-size: 13px;
    text-decoration: none;
}

.muted-link:hover {
    text-decoration: underline;
}

.auth-links {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.auth-links a,
.auth-links .link-button {
    color: var(--gold);
    font-size: 13px;
    text-decoration: none;
}

.auth-links a:hover,
.auth-links .link-button:hover {
    text-decoration: underline;
}

.auth-links .muted {
    color: var(--text-muted);
}

.auth-links .link-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

/* ── Small screens ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card {
        padding: 32px 22px 26px;
        border-radius: 16px;
    }

    .auth-shell {
        padding: 16px;
    }
}

/* ── Bot trap ───────────────────────────────────────────────────
   Off-screen honeypot (never display:none — some scripts skip hidden inputs, few skip positioned ones).
   A person never sees or tabs into it; a form-filler script fills it. */
.trap-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}
