/* =============================
   LOGIN / REGISTRO - Landify
   Alineado con alta.css design system
   ============================= */

@import url('base.css');

:root {
    /* Specific login variables */
    --login-card-pad-y: clamp(28px, 6vw, 40px);
    --login-card-pad-x: clamp(22px, 5vw, 36px);
    --login-shell-max: 440px;
    --login-auth-btn-height: 44px;
    --login-auth-btn-radius: var(--radius-sm);
}

/* =============================
   BASE STYLES
   ============================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =============================
   LOGIN PAGE LAYOUT
   ============================= */
body.login-page {
    font-family: var(--font);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    --login-pad-y: clamp(20px, 5vw, 40px);
    --login-pad-x: clamp(16px, 5vw, 28px);
    padding: max(var(--login-pad-y), env(safe-area-inset-top, 0px))
        max(var(--login-pad-x), env(safe-area-inset-right, 0px))
        max(var(--login-pad-y), env(safe-area-inset-bottom, 0px))
        max(var(--login-pad-x), env(safe-area-inset-left, 0px));
    position: relative;
    overflow-x: hidden;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(59, 130, 246, 0.14), transparent 55%),
        radial-gradient(ellipse 90% 60% at 100% 40%, rgba(99, 102, 241, 0.08), transparent 50%),
        linear-gradient(180deg, #0c1222 0%, var(--bg) 100%);
}

/* Subtle noise texture overlay */
body.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

body.login-page > * {
    position: relative;
    z-index: 1;
}

.login-brand {
    align-self: flex-start;
    margin-bottom: clamp(16px, 4vw, 28px);
}

.login-brand-inner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.login-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.25), rgba(99, 102, 241, 0.12));
    border: 1px solid var(--login-border);
    font-size: 1.15rem;
    line-height: 1;
}

.login-brand-name {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #63a4ff 0%, #93c5fd 60%, #7dd3fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.4px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.1s ease;
    padding: 4px 8px;
    border-radius: 6px;
    position: relative;
}

.login-brand-name:hover {
    -webkit-text-fill-color: #7db8ff;
    background: none;
}

.login-brand-name svg {
    color: #3b82f6;
}

.login-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

.login-center[hidden] {
    display: none !important;
}

/* Paneles alineados arriba (debajo del header Landify) */
.login-center--top {
    align-items: flex-start;
    padding-top: clamp(20px, 5vh, 60px);
}

.login-shell {
    width: 100%;
    max-width: min(var(--login-shell-max), 100%);
    margin-inline: auto;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--login-card-pad-y) var(--login-card-pad-x);
    box-shadow: var(--shadow-card);
    position: relative;
    animation: fadeIn 0.2s ease-out both;
}

.login-title {
    font-size: clamp(1.35rem, 4vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
    line-height: 1.25;
    color: var(--text);
}

.login-title--center {
    text-align: center;
    margin-bottom: clamp(20px, 4vw, 28px);
}

.login-subtitle {
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 16px;
}

.login-sub {
    color: var(--text-muted);
    font-size: clamp(0.875rem, 2.8vw, 0.9375rem);
    line-height: 1.55;
    margin-bottom: clamp(26px, 5.5vw, 36px);
    max-width: 36em;
}

.login-error {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 20px;
}

.login-success {
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    color: #86efac;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 20px;
}

.login-hint {
    margin-top: 22px;
    font-size: 0.8125rem;
    color: var(--login-muted-dim);
    line-height: 1.5;
}

/* Social: Google (OAuth redirect) + Facebook (caparazón) */
.login-social-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
}

@media (max-width: 360px) {
    .login-social-row {
        grid-template-columns: 1fr;
    }
}

.login-social-cell {
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.login-social-fb,
.login-social-fb-icon,
.login-social-cell + .login-social-cell {
    display: none !important;
}

.google-btn-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: var(--login-auth-btn-height);
    margin: 0;
    padding: 0;
}

.google-btn-wrap > div {
    width: 100%;
    display: flex;
    justify-content: center;
}

.google-btn-wrap iframe {
    display: block;
    margin-inline: auto;
    max-width: 100%;
    border-radius: var(--login-auth-btn-radius) !important;
}

.google-btn-wrap small {
    display: none !important;
}

.login-google-redirect {
    width: 100%;
    min-height: var(--login-auth-btn-height);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 14px;
    margin: 0;
    border-radius: var(--login-auth-btn-radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}

.login-google-redirect:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 1px var(--login-accent-glow);
}

.login-google-redirect:focus-visible {
    outline: 2px solid var(--login-accent);
    outline-offset: 2px;
}

.login-google-redirect-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-google-g {
    display: block;
}

.login-google-redirect-label {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.login-social-fb {
    width: 100%;
    min-height: var(--login-auth-btn-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: var(--login-auth-btn-radius);
    border: none;
    background: #1877f2;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: not-allowed;
    opacity: 0.75;
}

.login-social-fb-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: clamp(12px, 3.5vw, 18px);
    margin: clamp(20px, 4vw, 26px) 0 clamp(16px, 3.5vw, 22px);
    color: var(--text-hint);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.login-divider--email {
    margin-top: clamp(16px, 3.5vw, 22px);
}

.login-divider span {
    flex-shrink: 0;
    opacity: 0.9;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.login-email-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.registro-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: -6px 0 18px;
}

.registro-divider::before,
.registro-divider::after {
    content: '';
    flex: 1;
    max-width: 132px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.28), transparent);
}

.registro-divider-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    color: #93c5fd;
    background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.22);
    box-shadow: 0 0 26px rgba(37, 99, 235, 0.14);
}

.registro-divider-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

#registro-form {
    margin-top: 0;
}

.login-field {
    margin-bottom: 16px;
}

.login-field small {
    display: none !important;
}

.login-field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.login-input--has-toggle {
    padding-right: 48px;
}

.login-input::placeholder {
    color: var(--text-hint);
}

.login-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.login-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.login-password-toggle:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.login-password-toggle:focus-visible {
    outline: 2px solid var(--login-accent);
    outline-offset: 2px;
}

.login-password-toggle-icon {
    width: 22px;
    height: 22px;
}

.login-forgot-row {
    margin-bottom: 20px;
}

.login-text-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.08s ease;
}

.login-text-link:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.login-text-link--placeholder {
    cursor: default;
    opacity: 0.75;
}

.login-submit-btn {
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-inverse);
    cursor: pointer;
    background: var(--accent-gradient);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.25);
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
}

.login-submit-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.35);
}

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

.login-submit-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-card-footer {
    margin-top: clamp(24px, 4vw, 32px);
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.login-footer-placeholder {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
    opacity: 0.7;
    cursor: default;
}

.login-footer-placeholder--accent {
    font-weight: 600;
    margin-left: 4px;
}

.login-footer-line {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-hello-btn {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: var(--login-auth-btn-height);
    padding: 0 22px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition-fast);
}

.login-hello-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.login-hello-btn:active {
    transform: scale(0.99);
}

.login-hello-btn::before {
    content: '';
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z'/%3E%3C/svg%3E");
}

.webauthn-offer {
    margin-top: clamp(24px, 4.5vw, 32px);
    padding: clamp(20px, 3.5vw, 24px) 0 0;
    border-top: 1px solid var(--login-border);
}

.webauthn-offer-text {
    font-size: 0.9rem;
    color: var(--login-muted);
    margin-bottom: 18px;
    line-height: 1.5;
}

.webauthn-offer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

@media (max-width: 380px) {
    .webauthn-offer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .webauthn-offer-actions .login-choice-btn {
        text-align: center;
    }

    .webauthn-offer-actions .login-link-btn {
        width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 10px 16px;
    }
}

.login-help {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--login-border);
    font-size: 0.8125rem;
    color: var(--login-muted);
    line-height: 1.55;
}

.login-help summary {
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
    padding-block: 2px;
    user-select: none;
    transition: color 0.08s ease;
}

.login-help summary::-webkit-details-marker {
    display: none;
}

.login-help summary::after {
    content: '';
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-left: auto;
    margin-top: 0.35em;
    opacity: 0.6;
    transition: transform 0.1s ease;
}

.login-help[open] summary {
    color: var(--text);
    margin-bottom: 10px;
}

.login-help[open] summary::after {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.login-help summary:hover {
    color: var(--login-text);
}

.login-help summary:focus-visible {
    outline: 2px solid var(--login-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

.login-help p {
    margin: 0 0 10px;
}

.login-help p:last-child {
    margin-bottom: 0;
}

.login-help strong {
    color: var(--text);
    font-weight: 600;
}

.login-help code {
    font-size: 0.78em;
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--login-border);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.login-onboarding-title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
    line-height: 1.3;
    color: var(--text);
}

.login-onboarding-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: clamp(28px, 5vw, 36px);
    line-height: 1.55;
}

.login-choice-grid {
    display: grid;
    gap: 16px;
}

.login-choice-btn {
    display: block;
    width: 100%;
    padding: 20px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition-fast);
}

.login-choice-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.login-choice-btn:active:not(:disabled) {
    transform: scale(0.995);
}

.login-choice-btn strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.login-choice-btn span {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
}

.login-choice-btn.is-muted {
    opacity: 0.55;
    cursor: not-allowed;
}

.login-choice-btn.is-muted:hover,
.login-choice-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
    box-shadow: none;
}

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

.login-footer-actions {
    margin-top: clamp(28px, 5vw, 36px);
    padding-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

@media (min-width: 520px) {
    .login-footer-actions {
        justify-content: flex-end;
    }
}

.login-link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    text-underline-offset: 3px;
    padding: 4px 2px;
    border-radius: 4px;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.login-link-btn:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

@media (min-width: 1024px) {
    :root {
        --login-card-pad-y: 22px;
        --login-card-pad-x: 28px;
        --login-shell-max: 500px;
        --login-auth-btn-height: 42px;
    }

    body.login-page {
        --login-pad-y: 16px;
        --login-pad-x: 24px;
    }

    .login-brand {
        margin-bottom: 12px;
    }

    .login-brand-name {
        padding: 2px 6px;
        font-size: 20px;
    }

    .login-card {
        border-radius: 20px;
    }

    .login-title {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }

    .login-title--center {
        margin-bottom: 14px;
    }

    .login-subtitle {
        font-size: 0.84rem;
        margin-bottom: 12px;
    }

    .login-error,
    .login-success {
        padding: 10px 14px;
        margin-bottom: 14px;
    }

    .login-social-row {
        gap: 10px;
    }

    .google-btn-wrap small {
        margin-top: 4px !important;
        font-size: 0.72rem !important;
    }

    .login-divider {
        margin: 14px 0 12px;
        font-size: 0.78rem;
    }

    .login-divider--email {
        margin-top: 12px;
    }

    .login-field {
        margin-bottom: 12px;
    }

    .login-field-label {
        margin-bottom: 5px;
        font-size: 0.76rem;
    }

    .login-input {
        min-height: 42px;
        padding: 9px 13px;
    }

    #login-email-hint,
    #login-password-hint {
        margin-top: 3px !important;
        font-size: 0.74rem !important;
        line-height: 1.35;
    }

    .login-forgot-row {
        margin-bottom: 14px;
    }

    .login-submit-btn {
        min-height: 44px;
    }

    .login-card-footer {
        margin-top: 16px;
        gap: 8px;
    }

    .login-footer-line,
    .login-footer-placeholder,
    .login-text-link {
        font-size: 0.82rem;
    }
}

@media (min-width: 1024px) and (max-height: 860px) {
    body.login-page {
        --login-pad-y: 12px;
    }

    .login-brand {
        margin-bottom: 8px;
    }

    .login-card {
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .login-title--center {
        margin-bottom: 12px;
    }

    .login-subtitle {
        margin-bottom: 10px;
    }

    .login-divider {
        margin: 12px 0 10px;
    }

    .login-field {
        margin-bottom: 10px;
    }

    .login-card-footer {
        margin-top: 12px;
    }
}

/* =============================
   WEBAUTHN MODAL
   ============================= */
.webauthn-modal-overlay[hidden] {
    display: none !important;
}

.webauthn-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    padding: var(--login-pad-x);
    opacity: 0;
    transition: opacity 0.12s ease;
    pointer-events: auto;
    transform: translateZ(0);
}

.webauthn-modal-overlay:not([hidden]) {
    opacity: 1;
}

.webauthn-modal {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--login-card-pad-y) var(--login-card-pad-x);
    box-shadow: var(--shadow-card);
    max-width: min(var(--login-shell-max), 100%);
    width: 100%;
    margin: auto;
    transform: scale(0.96);
    transition: transform 0.12s ease;
    position: relative;
    z-index: 10000;
}

.webauthn-modal-overlay:not([hidden]) .webauthn-modal {
    transform: scale(1);
}

.webauthn-modal-title {
    font-size: clamp(1.15rem, 3.5vw, 1.35rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
    line-height: 1.3;
    color: var(--text);
    text-align: center;
}

.webauthn-modal-text {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 28px;
    text-align: center;
}

.webauthn-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.webauthn-modal-btn {
    width: 100%;
    min-height: var(--login-auth-btn-height);
    padding: 0 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity var(--transition), border-color var(--transition), transform var(--transition-fast);
}

.webauthn-modal-btn--primary {
    border: none;
    background: var(--accent-gradient);
    color: var(--text-inverse);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.25);
}

.webauthn-modal-btn--primary:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.35);
}

.webauthn-modal-btn--primary:active {
    transform: translateY(0);
}

.webauthn-modal-btn--secondary {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.webauthn-modal-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.4);
}

@media (min-width: 480px) {
    .webauthn-modal-actions {
        flex-direction: row;
        justify-content: center;
    }

    .webauthn-modal-btn {
        width: auto;
        min-width: 140px;
    }

    .webauthn-modal-btn--primary {
        order: 2;
    }

    .webauthn-modal-btn--secondary {
        order: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .login-hello-btn:active,
    .login-choice-btn:active:not(:disabled) {
        transform: none;
    }
}

/* =============================
   LIGHT THEME OVERRIDES
   ============================= */
html[data-theme="light"] body.login-page {
    background: #f8fafc;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(59, 130, 246, 0.08), transparent 55%),
        radial-gradient(ellipse 90% 60% at 100% 40%, rgba(99, 102, 241, 0.04), transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #1a1a1a;
}
html[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .login-title {
    color: #1a1a1a;
}
html[data-theme="light"] .login-subtitle {
    color: #4b5563;
}
html[data-theme="light"] .login-input {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}
html[data-theme="light"] .login-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
html[data-theme="light"] .login-divider::before {
    background: rgba(0, 0, 0, 0.1);
}
html[data-theme="light"] .login-divider span {
    background: #ffffff;
    color: #6b7280;
}
