/*
 * KAIS auth-page styles.
 *
 * Extracted from kais/templates/account/layouts/base.html in the
 * CSP inline-style cleanup so we no longer rely on a nonced inline
 * <style> block. All `.auth-*`, `.email-*`, `.password-*`,
 * `.field-*`, `.warning-callout-*`, `.confirm-phrase-*`,
 * `.auth-account-nav-*`, `.auth-btn-*`, `.auth-glow`,
 * `.auth-divider`, `.auth-card`, `.auth-message*`, and `.sr-only`
 * rules live here.
 */

/* Dark theme form styling */
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="number"],
.auth-card input[type="tel"],
.auth-card select,
.auth-card textarea {
    background-color: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    width: 100%;
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    -webkit-appearance: none;
}
.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
    border-color: rgba(106, 168, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(106, 168, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.07);
    outline: none;
}
.auth-card input:focus-visible,
.auth-card select:focus-visible,
.auth-card textarea:focus-visible {
    border-color: rgba(155, 109, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(155, 109, 255, 0.25);
}
.auth-card input::placeholder {
    color: #4a5568;
}
.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9;
    -webkit-box-shadow: 0 0 0px 1000px #161b26 inset;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
/* Crispy form label styling */
.auth-card label {
    color: #cbd5e1;
    font-size: 0.8125rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}
.auth-card .text-muted,
.auth-card .helptext,
.auth-card .form-text {
    color: #64748b !important;
    font-size: 0.8125rem;
}
.auth-card .asteriskField {
    color: #f87171;
}
/* Crispy error styling */
.auth-card .invalid-feedback,
.auth-card .errorlist {
    color: #fca5a5;
    font-size: 0.8125rem;
}
.auth-card .errorlist {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
}
/* Auth button base */
.auth-btn-primary {
    display: block;
    width: 100%;
    color: #fff;
    font-weight: 600;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #6aa8ff 0%, #9b6dff 100%);
    box-shadow: 0 4px 14px rgba(106, 168, 255, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(106, 168, 255, 0.4);
}
.auth-btn-primary:active {
    transform: translateY(0);
}
.auth-btn-primary:focus-visible {
    outline: 2px solid #9b6dff;
    outline-offset: 2px;
}
.auth-btn-primary:disabled {
    cursor: wait;
    opacity: 0.8;
    transform: none !important;
}
/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}
/* Ambient glow behind card */
.auth-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}
/* Fade-in animation */
@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-card {
    animation: authFadeUp 0.5s ease-out;
}
/* Staggered field entrance */
.auth-card .mb-3 {
    animation: authFadeUp 0.4s ease-out both;
}
.auth-card .mb-3:nth-child(1) { animation-delay: 0.05s; }
.auth-card .mb-3:nth-child(2) { animation-delay: 0.1s; }
.auth-card .mb-3:nth-child(3) { animation-delay: 0.15s; }
/* Message animations */
@keyframes authSlideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes authSlideOut {
    to { opacity: 0; transform: translateX(12px); height: 0; margin: 0; padding: 0; overflow: hidden; }
}
.auth-message {
    animation: authSlideIn 0.3s ease-out;
    position: relative;
}
.auth-message.dismissing {
    animation: authSlideOut 0.3s ease-in forwards;
}
.auth-message-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    transition: opacity 0.2s ease;
}
.auth-message-dismiss:hover {
    opacity: 1 !important;
}
/* Client-side validation states */
.field-error {
    display: none;
    color: #fca5a5;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}
.field-error.active {
    display: block;
    animation: authSlideIn 0.2s ease-out;
}
.field-valid input {
    border-color: rgba(34, 197, 94, 0.4) !important;
}
.field-invalid input {
    border-color: rgba(239, 68, 68, 0.4) !important;
}
/* Password strength meter */
.password-strength-container {
    margin-top: 0.5rem;
}
.password-strength-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}
.password-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
    width: 0;
}
.password-strength-fill[data-strength="1"] { width: 25%; background: #ef4444; }
.password-strength-fill[data-strength="2"] { width: 50%; background: #f97316; }
.password-strength-fill[data-strength="3"] { width: 75%; background: #eab308; }
.password-strength-fill[data-strength="4"] { width: 100%; background: #22c55e; }
.password-strength-label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #94a3b8;
}
/* Password requirements list */
.password-requirements {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.password-requirements li {
    font-size: 0.75rem;
    color: #94a3b8;
    padding: 0.125rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}
.password-requirements li::before {
    content: '\25CB';
    font-size: 0.625rem;
}
.password-requirements li.met {
    color: #4ade80;
}
.password-requirements li.met::before {
    content: '\2713';
}
/* Account settings nav — single glassmorphic dock that holds
   every pill. Hover/active states use the brand gradient so it
   reads as one cohesive control rather than scattered tags. */
.auth-account-nav {
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: center;
}
.auth-account-nav-dock {
    list-style: none;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem;
    margin: 0;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04),
                0 4px 24px -8px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.auth-account-nav-dock > li {
    margin: 0;
    padding: 0;
    display: inline-flex;
}
.auth-account-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease,
                box-shadow 0.2s ease, transform 0.15s ease;
}
.auth-account-nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}
.auth-account-nav-link:focus-visible {
    outline: 2px solid #9b6dff;
    outline-offset: 2px;
}
.auth-account-nav [aria-current="page"] {
    color: #fff;
    background: linear-gradient(135deg, #6aa8ff 0%, #9b6dff 100%);
    box-shadow: 0 4px 14px -4px rgba(106, 168, 255, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.auth-account-nav [aria-current="page"]:hover {
    background: linear-gradient(135deg, #6aa8ff 0%, #9b6dff 100%);
    transform: translateY(-1px);
}
/* Divider rule between regular nav items and the destructive
   Sign-Out action so it reads as a different action class. */
.auth-account-nav-divider {
    position: relative;
    padding-left: 0.5rem;
    margin-left: 0.25rem;
}
.auth-account-nav-divider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}
.auth-account-nav-link--danger {
    color: #f87171;
}
.auth-account-nav-link--danger:hover {
    color: #fecaca;
    background-color: rgba(239, 68, 68, 0.12);
}
.auth-account-nav-link svg {
    opacity: 0.85;
}
@media (max-width: 540px) {
    .auth-account-nav-dock {
        border-radius: 1rem;
    }
    .auth-account-nav-link {
        padding: 0.45rem 0.85rem;
        font-size: 0.78rem;
    }
}
/* Destructive button — solid red, NOT a gradient. Reserved for
   irreversible actions like 2FA deactivation. */
.auth-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 600;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.6);
    cursor: pointer;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    background-color: #ef4444;
    background-image: none;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
    transition: background-color 0.2s ease, transform 0.2s ease,
                box-shadow 0.2s ease, opacity 0.2s ease;
}
.auth-btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}
.auth-btn-danger:active {
    transform: translateY(0);
}
.auth-btn-danger:focus-visible {
    outline: 2px solid #9b6dff;
    outline-offset: 2px;
}
/* Pre-confirmation guarded state — clearly inert. */
.auth-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none;
}
/* When the form submits we reuse the loading-state hook. */
.auth-btn-danger[aria-busy="true"]:disabled {
    cursor: wait;
    opacity: 0.8;
}
/* Translucent / outlined secondary action (Cancel etc.). */
.auth-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #cbd5e1;
    font-weight: 600;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease,
                border-color 0.2s ease, transform 0.2s ease;
}
.auth-btn-secondary:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}
.auth-btn-secondary:focus-visible {
    outline: 2px solid #9b6dff;
    outline-offset: 2px;
}
/* Strong-warning callout used to describe destructive actions.
   Two-column grid (icon + body) with a clear hierarchy: a bold
   white title on top, a dimmed long-form detail below. */
.warning-callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.875rem;
    align-items: start;
    margin: 1rem 0 1.5rem;
    padding: 1rem 1.125rem;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-left: 4px solid #ef4444;
    border-radius: 0.75rem;
    background:
        linear-gradient(135deg,
            rgba(127, 29, 29, 0.45) 0%,
            rgba(127, 29, 29, 0.18) 100%);
    color: #fecaca;
    font-size: 0.875rem;
    line-height: 1.5;
    box-shadow: 0 4px 14px -8px rgba(239, 68, 68, 0.4);
}
.warning-callout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    flex-shrink: 0;
}
.warning-callout-body { min-width: 0; }
.warning-callout-title {
    margin: 0 0 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.01em;
    line-height: 1.4;
}
.warning-callout-detail {
    margin: 0;
    color: rgba(254, 202, 202, 0.78);
    font-size: 0.8125rem;
    line-height: 1.55;
}
/* Legacy <strong> support — kept for callouts that haven't been
   refactored to the title/body structure yet. */
.warning-callout strong { color: #fff; }
/* Type-to-confirm phrase widget. Live letter-by-letter feedback
   plus an inline status icon turn the destructive guard from
   a plain text input into something the user can clearly track. */
.confirm-phrase-input-wrap {
    position: relative;
}
.confirm-phrase-input-wrap > input {
    padding-right: 2.5rem !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
        Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.confirm-phrase-status {
    position: absolute;
    top: 50%;
    right: 0.875rem;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #cbd5e1;
    transition: color 0.2s ease, background-color 0.2s ease,
                transform 0.2s ease;
    pointer-events: none;
}
.confirm-phrase-status-check {
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.confirm-phrase-status[data-state="partial"] {
    color: #fbbf24;
}
.confirm-phrase-status[data-state="error"] {
    color: #fca5a5;
    background-color: rgba(239, 68, 68, 0.15);
}
.confirm-phrase-status[data-state="valid"] {
    color: #fff;
    background-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}
.confirm-phrase-status[data-state="valid"] .confirm-phrase-status-check {
    opacity: 1;
    transform: scale(1);
}
.confirm-phrase-letters {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0;
    margin: 0.5rem 0 0;
}
.confirm-phrase-letters > li {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
        Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.18s ease, background-color 0.18s ease,
                border-color 0.18s ease, transform 0.18s ease;
}
.confirm-phrase-letters > li[data-state="matched"] {
    color: #fff;
    background-color: rgba(34, 197, 94, 0.22);
    border-color: rgba(34, 197, 94, 0.5);
    transform: translateY(-1px);
}
.confirm-phrase-letters > li[data-state="wrong"] {
    color: #fecaca;
    background-color: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.45);
}
/* Visually-hidden helper for screen-reader-only status text. */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
/* ---------- Email-management page (account/email.html) ---------- */
.email-page-header {
    text-align: center;
    margin-bottom: 1.75rem;
}
.email-page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}
.email-page-lede {
    margin: 0;
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}
.email-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}
.email-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.4rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-size: 0.6875rem;
    font-weight: 600;
}
.email-list {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.email-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.875rem;
    align-items: center;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.875rem;
    transition: background-color 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease;
}
.email-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.14);
}
.email-row.is-primary {
    background: linear-gradient(135deg,
        rgba(106, 168, 255, 0.07) 0%,
        rgba(155, 109, 255, 0.05) 100%);
    border-color: rgba(106, 168, 255, 0.32);
    box-shadow: 0 4px 16px -8px rgba(106, 168, 255, 0.4);
}
.email-row.is-unverified {
    border-color: rgba(245, 158, 11, 0.28);
}
.email-row-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    flex-shrink: 0;
}
.email-row.is-primary .email-row-marker {
    background: rgba(106, 168, 255, 0.18);
    color: #93c5fd;
}
.email-row .email-row-marker.has-verified-tone,
.email-row:not(.is-primary):not(.is-unverified) .email-row-marker {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}
.email-row.is-unverified .email-row-marker {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}
.email-row-body { min-width: 0; }
.email-row-address {
    color: #f1f5f9;
    font-size: 0.9375rem;
    font-weight: 500;
    word-break: break-all;
    line-height: 1.35;
}
.email-row-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.375rem;
}
.email-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.55rem 0.15rem 0.45rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
}
.email-badge-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background: currentColor;
    box-shadow: 0 0 0 3px currentColor;
    opacity: 0.95;
}
.email-badge--primary {
    color: #93c5fd;
    background: rgba(106, 168, 255, 0.12);
}
.email-badge--verified {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
}
.email-badge--unverified {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.14);
}
.email-row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
}
.email-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease,
                border-color 0.18s ease, transform 0.15s ease;
}
.email-action-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}
.email-action-btn:focus-visible {
    outline: 2px solid #9b6dff;
    outline-offset: 2px;
}
.email-action-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}
.email-action-btn--primary { color: #93c5fd; }
.email-action-btn--primary:hover {
    color: #fff;
    background: rgba(106, 168, 255, 0.18);
    border-color: rgba(106, 168, 255, 0.4);
}
.email-action-btn--verify { color: #fbbf24; }
.email-action-btn--verify:hover {
    color: #fff;
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.45);
}
.email-action-btn--remove { color: #fca5a5; }
.email-action-btn--remove:hover:not([disabled]) {
    color: #fff;
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.45);
}
.email-action-btn svg { flex-shrink: 0; }
@media (max-width: 640px) {
    .email-row {
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
    }
    .email-row-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
    .email-action-btn span {
        display: none;
    }
    .email-action-btn {
        padding: 0.5rem;
    }
}
/* Add-email section */
.email-add-section {
    padding: 1.25rem;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.02);
}
.email-add-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: stretch;
}
.email-add-input-wrap {
    position: relative;
    flex: 1 1 16rem;
    min-width: 0;
}
.email-add-input-icon {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}
.email-add-input-wrap > input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.75rem !important;
    color: #f1f5f9 !important;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, background-color 0.2s ease,
                box-shadow 0.2s ease;
}
.email-add-input-wrap > input[type="email"]:focus {
    border-color: rgba(106, 168, 255, 0.6) !important;
    background-color: rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 0 0 3px rgba(106, 168, 255, 0.15);
    outline: none;
}
.email-add-input-wrap > input[type="email"]:focus + .email-add-input-icon,
.email-add-input-wrap:focus-within .email-add-input-icon {
    color: #93c5fd;
}
.email-add-submit {
    width: auto !important;
    min-width: 9rem;
    flex-shrink: 0;
}
.email-add-hint {
    margin: 0.625rem 0 0;
    color: #64748b;
    font-size: 0.75rem;
}
@media (max-width: 540px) {
    .email-add-submit { width: 100% !important; }
}

/* ---------- Connections page (socialaccount/connections.html) ---------- */
.connection-row-logo {
    background: rgba(255, 255, 255, 0.07);
    color: #e2e8f0;
}
.connection-row--google .connection-row-logo {
    background: #fff;
}
.connection-row--github .connection-row-logo {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.connection-meta {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.1rem 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.connection-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.75rem 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 0.875rem;
}
.connection-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: rgba(106, 168, 255, 0.1);
    color: #93c5fd;
    margin-bottom: 0.875rem;
}
.connection-empty-title {
    margin: 0 0 0.25rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 600;
}
.connection-empty-detail {
    margin: 0;
    color: #94a3b8;
    font-size: 0.8125rem;
}
.connection-add-section {
    border-style: solid;
    background: rgba(255, 255, 255, 0.025);
}
.provider-grid {
    list-style: none;
    margin: 0 0 0.875rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.625rem;
}
.provider-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.875rem;
    color: #e2e8f0;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease,
                transform 0.18s ease, box-shadow 0.2s ease;
}
.provider-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.4);
}
.provider-card:focus-visible {
    outline: 2px solid #9b6dff;
    outline-offset: 2px;
}
.provider-card-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.provider-card--google:hover {
    border-color: rgba(66, 133, 244, 0.45);
    box-shadow: 0 4px 16px -6px rgba(66, 133, 244, 0.4);
}
.provider-card--google .provider-card-logo {
    background: #fff;
}
.provider-card--github:hover {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 16px -6px rgba(0, 0, 0, 0.6);
}
.provider-card--github .provider-card-logo {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.provider-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}
.provider-card-name {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}
.provider-card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    transition: gap 0.2s ease, color 0.2s ease;
}
.provider-card:hover .provider-card-action {
    color: #fff;
    gap: 0.5rem;
}

/* ---------- MFA index page (mfa/index.html) ---------- */
.mfa-status {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.875rem;
    align-items: center;
    padding: 1rem 1.125rem;
    border-radius: 0.875rem;
    margin: 0 0 1.75rem;
    border: 1px solid transparent;
}
.mfa-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    flex-shrink: 0;
}
.mfa-status-title {
    margin: 0 0 0.125rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
}
.mfa-status-detail {
    margin: 0;
    font-size: 0.8125rem;
}
.mfa-status--enabled {
    background: linear-gradient(135deg,
        rgba(34, 197, 94, 0.12) 0%,
        rgba(34, 197, 94, 0.04) 100%);
    border-color: rgba(34, 197, 94, 0.3);
    color: #bbf7d0;
}
.mfa-status--enabled .mfa-status-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}
.mfa-status--enabled .mfa-status-detail { color: rgba(187, 247, 208, 0.8); }
.mfa-status--disabled {
    background: linear-gradient(135deg,
        rgba(245, 158, 11, 0.12) 0%,
        rgba(245, 158, 11, 0.04) 100%);
    border-color: rgba(245, 158, 11, 0.32);
    color: #fde68a;
}
.mfa-status--disabled .mfa-status-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}
.mfa-status--disabled .mfa-status-detail { color: rgba(253, 230, 138, 0.85); }

.mfa-method-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: start;
    padding: 1rem 1.125rem;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    margin: 0;
}
.mfa-method-card:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}
.mfa-method-card.is-active {
    border-color: rgba(34, 197, 94, 0.28);
    background:
        linear-gradient(135deg,
            rgba(34, 197, 94, 0.06) 0%,
            rgba(255, 255, 255, 0.04) 100%);
}
.mfa-method-icon {
    background: rgba(106, 168, 255, 0.12);
    color: #93c5fd;
    width: 2.75rem;
    height: 2.75rem;
}
.mfa-method-card.is-active .mfa-method-icon {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
}
.mfa-method-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}
.mfa-method-title {
    margin: 0;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.005em;
}
.mfa-method-detail {
    margin: 0;
    color: #94a3b8;
    font-size: 0.8125rem;
    line-height: 1.5;
}
.mfa-method-actions {
    align-self: center;
    justify-self: end;
}
.mfa-method-action--cta {
    color: #fff;
    background: linear-gradient(135deg, rgba(106, 168, 255, 0.5) 0%, rgba(155, 109, 255, 0.5) 100%);
    border: 1px solid rgba(155, 109, 255, 0.5);
}
.mfa-method-action--cta:hover {
    background: linear-gradient(135deg, rgba(106, 168, 255, 0.7) 0%, rgba(155, 109, 255, 0.7) 100%);
    border-color: rgba(155, 109, 255, 0.7);
    color: #fff;
}
.mfa-method-action-disabled {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
    padding: 0.4rem 0;
}
.mfa-progress {
    position: relative;
    margin-top: 0.625rem;
    height: 0.375rem;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.mfa-progress-fill {
    display: block;
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    width: 0;
}
.mfa-progress-fill--mid {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}
.mfa-progress-fill--low {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}
@media (max-width: 640px) {
    .mfa-method-card {
        grid-template-columns: auto 1fr;
    }
    .mfa-method-actions {
        grid-column: 1 / -1;
        justify-self: stretch;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
    .mfa-method-actions .email-action-btn span {
        display: inline;
    }
}

/* ---------- Sessions page (usersessions/usersession_list.html) ---------- */
.session-row {
    align-items: start;
    grid-template-columns: auto 1fr;
    padding: 1rem 1.125rem;
}
.session-row.is-current {
    border-color: rgba(34, 197, 94, 0.32);
    background: linear-gradient(135deg,
        rgba(34, 197, 94, 0.07) 0%,
        rgba(255, 255, 255, 0.04) 100%);
}
.session-row-logo {
    width: 2.75rem;
    height: 2.75rem;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}
.session-row.is-current .session-row-logo {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}
.session-row--chrome  .session-row-logo:not(.is-current *) { color: #93c5fd; }
.session-row--firefox .session-row-logo:not(.is-current *) { color: #fb923c; }
.session-row--safari  .session-row-logo:not(.is-current *) { color: #93c5fd; }
.session-row--edge    .session-row-logo:not(.is-current *) { color: #67e8f9; }
.session-row--opera   .session-row-logo:not(.is-current *) { color: #f87171; }
.session-row-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.session-row-title {
    margin: 0;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.005em;
}
.session-row-os {
    color: #94a3b8;
    font-weight: 400;
}
.session-row-meta {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.5rem 1rem;
}
.session-meta-item {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.session-meta-item dt {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    margin: 0;
}
.session-meta-item dd {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.8125rem;
}
.session-meta-ip {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.375rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
        Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.75rem;
    color: #cbd5e1;
}
.sessions-revoke-section {
    margin-top: 1.5rem;
    padding: 1.125rem 1.25rem;
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.06) 0%,
        rgba(239, 68, 68, 0.02) 100%);
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-radius: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}
.sessions-revoke-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    flex: 1 1 18rem;
    min-width: 0;
}
.sessions-revoke-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    flex-shrink: 0;
}
.sessions-revoke-title {
    margin: 0 0 0.25rem;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
}
.sessions-revoke-detail {
    margin: 0;
    color: rgba(254, 202, 202, 0.78);
    font-size: 0.8125rem;
    line-height: 1.5;
}
.sessions-revoke-form {
    margin: 0;
}
.sessions-revoke-btn {
    white-space: nowrap;
}
.sessions-only-current {
    margin: 1.5rem 0 0;
    text-align: center;
    color: #64748b;
    font-size: 0.8125rem;
}
@media (max-width: 540px) {
    .sessions-revoke-section {
        flex-direction: column;
        align-items: stretch;
    }
    .sessions-revoke-btn {
        width: 100%;
    }
}

/* ---------- Reauthenticate page (account/base_reauthenticate.html) ---------- */
.reauth-page {
    text-align: center;
}
.reauth-shield {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(106, 168, 255, 0.18) 0%, rgba(155, 109, 255, 0.18) 100%);
    color: #93c5fd;
    border: 1px solid rgba(106, 168, 255, 0.3);
    box-shadow: 0 0 0 6px rgba(106, 168, 255, 0.06),
                0 8px 24px -8px rgba(106, 168, 255, 0.4);
    position: relative;
}
.reauth-shield::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid rgba(155, 109, 255, 0.2);
    animation: reauthShieldPulse 2.4s ease-in-out infinite;
}
@keyframes reauthShieldPulse {
    0%   { transform: scale(1);    opacity: 0.6; }
    50%  { transform: scale(1.08); opacity: 0;   }
    100% { transform: scale(1);    opacity: 0;   }
}
.reauth-title {
    margin: 0 0 0.625rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.reauth-identity {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.4rem 0.75rem 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    font-size: 0.8125rem;
    color: #cbd5e1;
}
.reauth-identity::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}
.reauth-identity-label {
    color: #94a3b8;
    margin-right: 0.125rem;
}
.reauth-identity-email {
    color: #fff;
    font-weight: 500;
    word-break: break-all;
}
.reauth-lede {
    margin: 0 auto 1.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.55;
    max-width: 22rem;
}
.reauth-form-wrap {
    text-align: left;
}
.reauth-form > * + * {
    margin-top: 1rem;
}
.reauth-submit {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.5rem;
}
.reauth-alt-divider {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 1.75rem 0 1rem;
    color: #64748b;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.reauth-alt-divider::before,
.reauth-alt-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}
.reauth-alt-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}
.reauth-alt-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease,
                transform 0.15s ease;
}
.reauth-alt-card:hover {
    background: rgba(106, 168, 255, 0.08);
    border-color: rgba(106, 168, 255, 0.32);
    color: #fff;
    transform: translateY(-1px);
}
.reauth-alt-card:focus-visible {
    outline: 2px solid #9b6dff;
    outline-offset: 2px;
}
.reauth-alt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(106, 168, 255, 0.14);
    color: #93c5fd;
    flex-shrink: 0;
}
.reauth-alt-body {
    flex: 1;
    min-width: 0;
}
.reauth-alt-arrow {
    color: #64748b;
    flex-shrink: 0;
    transition: transform 0.18s ease, color 0.18s ease;
}
.reauth-alt-card:hover .reauth-alt-arrow {
    color: #fff;
    transform: translateX(2px);
}

/* ---------- TOTP activate page (mfa/totp/activate_form.html) ---------- */
.totp-activate-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
}
.totp-step {
    padding: 1.125rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(255, 255, 255, 0.04);
}
.totp-step-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
}
.totp-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #6aa8ff 0%, #9b6dff 100%);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    box-shadow: 0 4px 12px -4px rgba(106, 168, 255, 0.4);
    flex-shrink: 0;
}
.totp-step-title {
    margin: 0;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.005em;
}
.totp-scan-body {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    align-items: start;
}
.totp-qr-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.75rem;
    border-radius: 0.875rem;
    box-shadow: 0 8px 32px -12px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.totp-qr-image {
    display: block;
    width: 180px;
    height: 180px;
    border-radius: 0.5rem;
}
.totp-scan-text {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    min-width: 0;
}
.totp-manual {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.025);
}
.totp-manual-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    color: #cbd5e1;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.totp-manual-summary::-webkit-details-marker { display: none; }
.totp-manual-summary svg {
    transition: transform 0.18s ease;
    color: #94a3b8;
}
.totp-manual[open] .totp-manual-summary svg {
    transform: rotate(90deg);
    color: #93c5fd;
}
.totp-manual-summary:hover {
    color: #fff;
}
.totp-manual-body {
    padding: 0 0.75rem 0.875rem;
}
.totp-secret-wrap {
    position: relative;
}
.totp-secret-wrap > input {
    padding-right: 4.5rem !important;
}
.totp-secret-copy {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.55rem;
    background: rgba(106, 168, 255, 0.14);
    border: 1px solid rgba(106, 168, 255, 0.32);
    border-radius: 0.4rem;
    color: #93c5fd;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease,
                color 0.18s ease;
}
.totp-secret-copy:hover {
    background: rgba(106, 168, 255, 0.25);
    color: #fff;
    border-color: rgba(106, 168, 255, 0.55);
}
.totp-secret-copy:focus-visible {
    outline: 2px solid #9b6dff;
    outline-offset: 2px;
}
.totp-secret-copy--copied {
    background: rgba(34, 197, 94, 0.22) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
    color: #fff !important;
}
.totp-app-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.totp-app-list-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-right: 0.25rem;
}
.totp-app-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    font-size: 0.6875rem;
    color: #cbd5e1;
}
.totp-code-row {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.totp-code-field {
    position: relative;
}
.totp-code-input {
    display: block;
    width: 100%;
    max-width: 14rem;
    margin: 0 auto;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
        Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-align: center;
    transition: border-color 0.2s ease, background-color 0.2s ease,
                box-shadow 0.2s ease;
}
.totp-code-input::placeholder {
    color: rgba(255, 255, 255, 0.18);
    letter-spacing: 0.4em;
}
.totp-code-input:focus {
    outline: none;
    border-color: rgba(106, 168, 255, 0.55);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(106, 168, 255, 0.12);
}
.totp-code-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
}
.totp-code-hint-dot {
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 9999px;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
    animation: totpHintPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes totpHintPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}
.totp-code-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.875rem;
    border-radius: 0.625rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fecaca;
    font-size: 0.8125rem;
}
.totp-action-row {
    margin-top: 0.5rem;
}
.totp-activate-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: box-shadow 0.3s ease, transform 0.18s ease;
}
.totp-activate-btn--ready {
    box-shadow: 0 0 0 6px rgba(106, 168, 255, 0.18),
                0 8px 28px -8px rgba(106, 168, 255, 0.6);
}
@media (max-width: 640px) {
    .totp-scan-body {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .totp-qr-image {
        width: 160px;
        height: 160px;
    }
    .totp-code-input {
        font-size: 1.35rem;
        letter-spacing: 0.32em;
    }
}

/* Ready-state pulse on the destructive button — fires the
   moment the confirmation phrase becomes valid. */
@keyframes authBtnDangerReady {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55),
                        0 4px 14px rgba(239, 68, 68, 0.35); }
    70%  { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0),
                        0 6px 20px rgba(239, 68, 68, 0.45); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0),
                        0 4px 14px rgba(239, 68, 68, 0.35); }
}
.auth-btn-danger--ready {
    animation: authBtnDangerReady 1.4s ease-out 1;
}
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.action-row > .auth-btn-primary,
.action-row > .auth-btn-danger,
.action-row > .auth-btn-secondary {
    display: inline-flex;
    width: auto;
    min-width: 9rem;
}
.help-text {
    color: #94a3b8;
    font-size: 0.8125rem;
    margin: 0.375rem 0 0;
}
/* Mobile touch targets */
@media (max-width: 640px) {
    .auth-card input[type="text"],
    .auth-card input[type="email"],
    .auth-card input[type="password"],
    .auth-card input[type="number"],
    .auth-card input[type="tel"],
    .auth-card select,
    .auth-card textarea {
        font-size: 1rem;
        padding: 0.875rem 1rem;
        min-height: 48px;
    }
    .auth-btn-primary,
    .auth-btn-danger,
    .auth-btn-secondary {
        min-height: 48px;
        font-size: 1rem;
    }
    .action-row {
        justify-content: stretch;
    }
    .action-row > * {
        flex: 1 1 100%;
    }
}

/* ---------------------------------------------------------------------- */
/* Inline-style replacements (CSP cleanup)                                */
/*                                                                         */
/* The classes below replace `style="..."` attributes that previously     */
/* lived inline in `kais/templates/account/*.html`. Each rule is named   */
/* after the element it targets so visual parity is obvious.              */
/* ---------------------------------------------------------------------- */

/* layouts/base.html — <body> radial-gradient background. */
.auth-body {
    background: radial-gradient(ellipse at top, #151d2e 0%, #0a0e17 60%);
}

/* layouts/base.html — left ambient glow blob. */
.auth-glow--blue {
    width: 600px;
    height: 600px;
    top: -200px;
    left: -100px;
    background: #6aa8ff;
}

/* layouts/base.html — right ambient glow blob. */
.auth-glow--purple {
    width: 500px;
    height: 500px;
    bottom: -150px;
    right: -100px;
    background: #9b6dff;
}

/* layouts/base.html — frosted-glass auth-card backdrop blur. */
.auth-card--blur {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* layouts/base.html — gradient-haloed logo blur layer. */
.auth-logo-halo {
    background: linear-gradient(135deg, #6aa8ff 0%, #9b6dff 100%);
}

/* layouts/base.html — message banner SVG icon (preserve spacing). */
.auth-message-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

/* layouts/base.html — message body span (occupy remaining row). */
.auth-message-body {
    flex: 1 1 0%;
}

/* layouts/base.html — dismiss button initial dimmed state.
   The `.auth-message-dismiss:hover` rule defined earlier promotes
   opacity to 1; this block only sets the resting visual + hit area. */
.auth-message-dismiss {
    flex-shrink: 0;
    opacity: 0.6;
    padding: 2px;
}

/* confirm_email_verification_code.html — small inline "Send New Code"
   variant of the primary auth button shown inside the resend notice. */
.auth-btn-primary--inline {
    display: inline-block;
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* snippets/already_logged_in.html — informational note paragraph. */
.auth-already-logged-in-text {
    color: #a5b4fc;
    margin: 0;
}

/* email_change.html — the "pending email" form is a control-only form
   used to drive the verify/cancel buttons via `form="pending-email"`.
   Use a class instead of inline `display:none` so CSP `style-src-attr`
   stays clean. (HTML5 `hidden` attribute hides forms but doesn't
   participate in CSS-only override scenarios; class is more flexible.) */
.email-pending-form {
    display: none;
}

/* go_live_notification_success.html — accent thanks heading. The
   surrounding template extends base_countdown.html (no auth.css), so
   the page also pulls auth.css explicitly. */
.go-live-thanks-title {
    color: #00b4d8;
}

/* ---------------------------------------------------------------------- */
/* OTP boxes — confirm_email_verification_code.html                       */
/* (Moved out of the page-level <style nonce> block.)                     */
/* ---------------------------------------------------------------------- */
.otp-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}
.otp-group {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.otp-box {
    width: 40px;
    height: 52px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    color: #f1f5f9;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    outline: none;
    caret-color: #818cf8;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.otp-box:focus {
    border-color: rgba(129,120,247,0.7);
    box-shadow: 0 0 0 3px rgba(129,120,247,0.2);
    background: rgba(255,255,255,0.08);
}
.otp-box.filled {
    border-color: rgba(129,120,247,0.5);
    background: rgba(255,255,255,0.07);
}
.otp-box.error {
    border-color: rgba(245,158,11,0.6);
    box-shadow: 0 0 0 2px rgba(245,158,11,0.15);
}
.otp-box::selection {
    background: rgba(129,120,247,0.3);
}
@media (max-width: 399px) {
    .otp-container {
        gap: 10px;
    }
}
@media (min-width: 400px) {
    .otp-box {
        width: 44px;
        height: 56px;
        font-size: 22px;
    }
    .otp-group {
        gap: 10px;
    }
}
@media (min-width: 480px) {
    .otp-box {
        width: 48px;
        height: 60px;
        font-size: 24px;
    }
}
