/* Tokens (--brand, --ink, --muted, --danger*, etc.) come from tokens.css,
   loaded before this file — see wwwroot/assets/css/tokens.css. */

/* ── Body / Background — flat, no pattern ───────────── */
body {
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--sage-pale);
    color: var(--ink);
}

/* ── Auth wrap ──────────────────────────────────────── */
.auth-wrap {
    min-height: 100vh;
    position: relative;
}

.auth-wrap,
.auth-wrap > * {
    position: relative;
    z-index: 1;
}

/* ── Brand header (above card, legacy) ──────────────── */
.brand-logo-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--brand);
    display: grid;
    place-items: center;
    color: var(--text-on-brand);
    font-size: 1.4rem;
}

.brand-name {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.3px;
    margin-bottom: 0.2rem;
    line-height: 1;
}

.brand-tagline {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 0;
}

/* ── Logo mark + wordmark ────────────────────────────── */
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.login-logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-on-brand);
    flex-shrink: 0;
}

.login-logo-name {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.4px;
}

.login-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    text-align: center;
    margin: 0 0 6px;
    line-height: 1.3;
}

.login-subtitle {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin: 0 0 28px;
    line-height: 1.5;
}

/* ── Auth Card — flat, app-standard radius ──────────── */
.auth-card {
    background: var(--surface-input);
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 6px 20px rgba(15,23,42,.07);
    position: relative;
    overflow: hidden;
}

/* Single solid brand accent line at top */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--brand);
}

/* ── Card ornamental divider (legacy, unused by login) ─ */
.card-ornament {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 170px;
}
.ornament-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line));
}
.ornament-line:last-child {
    background: linear-gradient(90deg, var(--line), transparent);
}
.ornament-icon {
    color: var(--brand);
    font-size: 1.05rem;
}

.card-heading {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.card-subheading {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 0;
}

/* ── Form labels — sentence case ─────────────────────── */
.auth-card .form-label {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--ink-medium);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    margin-bottom: 6px;
}

/* ── Input group (legacy — still used by ForgotPassword) ─ */
.auth-card .input-group-text {
    background: var(--surface-input);
    border: 1px solid var(--line);
    border-right: none;
    border-radius: 6px 0 0 6px !important;
    color: var(--muted-light);
    padding: 0.6rem 0.85rem;
    min-width: 40px;
    justify-content: center;
}

.auth-card .form-control {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--surface-input);
    border: 1px solid var(--line);
    border-left: none;
    border-radius: 0 !important;
    padding: 0.6rem 0.85rem;
    color: var(--ink-medium);
    font-size: 13.5px;
    font-weight: 500;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-card .form-control:focus {
    background: var(--surface-input);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
    color: var(--ink-medium);
}

.auth-card .form-control::placeholder {
    color: var(--muted-light);
    font-weight: 400;
}

.auth-card .input-group > .form-control:last-child {
    border-radius: 0 6px 6px 0 !important;
}

.auth-card .btn-outline-secondary {
    background: var(--surface-input);
    border: 1px solid var(--line);
    border-left: none;
    border-radius: 0 6px 6px 0 !important;
    color: var(--muted-light);
    padding: 0.6rem 0.75rem;
    transition: all 0.15s ease;
}
.auth-card .btn-outline-secondary:hover,
.auth-card .btn-outline-secondary:focus {
    background: var(--surface-subtle);
    border-color: var(--line);
    color: var(--ink-medium);
    box-shadow: none;
}

/* ── Unified field pattern (login page) ─────────────── */
.login-field { margin-bottom: 18px; }

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.field-label-row .field-label { margin-bottom: 0; }

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-medium);
    margin-bottom: 6px;
}

.input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 0 12px;
    background: var(--surface-input);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.input-wrap.input-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(226, 75, 74, 0.10);
}

.input-icon {
    font-size: 15px;
    color: var(--muted-light);
    flex-shrink: 0;
}

.field-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13.5px;
    color: var(--ink-medium);
    padding: 10px 0;
    background: transparent;
    font-family: inherit;
}
.field-input::placeholder { color: var(--muted-light); }
.field-input:disabled { opacity: 0.6; cursor: not-allowed; }

.field-helper {
    font-size: 11px;
    color: var(--muted-light);
    margin: 4px 0 0;
}

.toggle-pw {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--muted-light);
    font-size: 15px;
    line-height: 1;
    border-radius: 4px;
    flex-shrink: 0;
}
.toggle-pw:hover { color: var(--ink-medium); }
.toggle-pw:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

/* ── Error banner ────────────────────────────────────── */
.error-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--danger-text);
    margin-bottom: 16px;
    animation: shake 0.3s ease;
}
.error-banner i { font-size: 15px; flex-shrink: 0; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-4px); }
    40%       { transform: translateX(4px); }
    60%       { transform: translateX(-3px); }
    80%       { transform: translateX(3px); }
}

/* ── Submit button ───────────────────────────────────── */
.btn-primary,
.login-btn {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--brand);
    border: none;
    border-radius: 6px;
    padding: 12px 16px;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: none;
    transition: background 0.15s ease;
}

.btn-primary:hover,
.login-btn:hover:not(:disabled) {
    background: var(--brand-dark);
    box-shadow: none;
    color: var(--text-on-brand);
    border: none;
}

.btn-primary:active { border: none; }

.btn-primary:focus-visible,
.login-btn:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    box-shadow: none;
    border: none;
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spin {
    animation: spin 0.8s linear infinite;
    font-size: 15px;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Links ──────────────────────────────────────────── */
.link-gold,
.link-light2,
.forgot-link {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    transition: color 0.15s ease;
}
.link-gold:hover,
.link-light2:hover,
.forgot-link:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}
.forgot-link { font-size: 12px; }

/* ── Alert ──────────────────────────────────────────── */
.alert-danger {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: 6px;
    color: var(--danger-text);
    font-size: 0.8rem;
    font-weight: 500;
}

/* ── Footer text ────────────────────────────────────── */
.auth-footer-text,
.muted-white {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.login-footer {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: var(--muted-light);
    z-index: 1;
}

/* ── Compat classes ─────────────────────────────────── */
.soft-white { color: var(--ink); font-family: 'Inter', system-ui, sans-serif; }
.small-note { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 0.78rem; font-weight: 500; color: var(--muted); }

.brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
