/**
 * auth.css — sign-in, forgot / reset password, first-login password, 2FA
 * Design "D": gold band with the SpeedBath name, white card overlapping it.
 * Loaded by app/views/layouts/auth.php after app.css (tokens come from there).
 * The auth views keep their markup and forms; their old inline styles are gone.
 */

.auth-body {
    min-height: 100vh;
    background: var(--bg-body);
    color: var(--text-primary);
}

/* ─── Gold band + brand ─── */
.auth-band {
    min-height: 300px;
    padding: 56px 16px 0;
    background: var(--band);
    color: var(--on-band);
    display: flex;
    justify-content: center;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    height: fit-content;
}

.auth-brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #FFFFFF;
    color: var(--band-btn-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    box-shadow: var(--shadow-band-btn);
}

.auth-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-brand-name {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.auth-brand-sub {
    font-size: 15px;
    font-weight: 500;
}

/* ─── Card ─── */
.auth-wrapper {
    position: relative;
    margin-top: -164px;
    padding: 0 16px 48px;
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-raised);
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo .logo-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--gold-tint);
    color: var(--gold-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
}

.auth-logo h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.auth-logo p {
    margin: 6px 0 0;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ─── Form ─── */
.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-form .input-wrapper {
    position: relative;
}

.auth-form .input-wrapper .input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px 12px 44px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 15px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.auth-form .input-wrapper:has(.toggle-password) input {
    padding-right: 52px;
}

.auth-form input:focus {
    outline: none;
    background: var(--bg-surface);
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.auth-form input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 4px;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.toggle-password:hover {
    color: var(--text-primary);
    background: var(--bg-sidebar-hover);
}

.form-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 24px;
    font-size: 14px;
}

.form-options .remember {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-options .remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-options .forgot-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--gold-text);
    font-weight: 600;
    text-decoration: none;
}

.form-options .forgot-link:hover {
    color: var(--gold-text-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* primary action: one big gold pill */
.btn-login,
.btn-submit {
    position: relative;
    width: 100%;
    min-height: 52px;
    padding: 0 24px;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-login:hover,
.btn-submit:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-lg);
}

.btn-login:focus-visible,
.btn-submit:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 3px;
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.btn-login.loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: var(--on-accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a,
.resend-link {
    color: var(--gold-text);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover,
.resend-link:hover {
    color: var(--gold-text-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.resend-link {
    min-height: 32px;
    padding: 0 4px;
    border: 0;
    background: none;
    font-family: var(--font-family);
    font-size: 14px;
    cursor: pointer;
}

.resend-link:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    text-decoration: none;
}

/* ─── Messages ─── */
.success-message,
.notice-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.success-message {
    background: var(--tone-green-bg);
    color: var(--tone-green-fg);
}

.notice-box {
    background: var(--tone-amber-bg);
    color: var(--tone-amber-fg);
}

.success-message svg,
.notice-box svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* no header row here, so on wider screens toasts sit top right; phones keep
   the app's bottom placement, clear of the brand */
@media (min-width: 641px) {
    .auth-body .toast-container {
        top: 16px;
        right: 16px;
        bottom: auto;
    }
}

/* ─── Password strength + rules (reset / first-login) ─── */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--input-bg);
    overflow: hidden;
}

.strength-fill {
    width: 0;
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-base), background-color var(--transition-base);
}

.strength-label {
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.password-rules {
    margin: 16px 0;
    padding: 12px 14px;
    list-style: none;
    border-radius: var(--radius-lg);
    background: var(--bg-panel);
}

.password-rules li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.password-rules li.met {
    color: var(--tone-green-fg);
    font-weight: 600;
}

/* ─── 2FA code boxes ─── */
.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 28px 0;
}

.otp-input {
    width: 52px;
    height: 60px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.otp-input:focus {
    outline: none;
    background: var(--bg-surface);
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

@media (max-width: 480px) {
    .auth-band {
        min-height: 260px;
        padding-top: 40px;
    }

    .auth-wrapper {
        margin-top: -136px;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .otp-inputs {
        gap: 8px;
    }

    .otp-input {
        width: 44px;
        height: 52px;
        font-size: 20px;
    }
}
