/* Pantallas de acceso: inicio de sesión, verificación en dos pasos, recuperar y confirmar contraseña. */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pro-canvas, linear-gradient(180deg, #f8f9fb 0%, #f2f4f8 100%));
    background-attachment: fixed;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--pro-ink, #111);
    -webkit-font-smoothing: antialiased;
}

.login-container { width: 100%; max-width: 440px; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }

.login-card {
    padding: 36px;
    border: 1px solid var(--pro-line, #e2e8f0);
    border-radius: var(--pro-radius-panel, 20px);
    background: #fff;
    box-shadow: var(--pro-shadow, 0 8px 24px rgb(17 17 17 / .05));
    animation: auth-in var(--pro-base, .28s) var(--pro-ease, ease-out) both;
}
@keyframes auth-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .login-card { animation: none; } }

h1 { margin: 0 0 8px; font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.subtitle { margin: 0 0 28px; color: var(--pro-body, #555); font-size: .9375rem; line-height: 1.5; }
.hint { margin: 0 0 16px; color: var(--pro-body, #555); font-size: .875rem; line-height: 1.5; }

.field { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-size: .875rem; font-weight: 600; }

input[type="email"], input[type="password"], input[type="text"] {
    width: 100%;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid #cdd3da;
    border-radius: 9999px;
    background: #fff;
    font: inherit;
    font-size: 1rem;
    color: var(--pro-ink, #111);
    outline: none;
    transition: border-color var(--pro-fast, .15s) var(--pro-ease, ease), box-shadow var(--pro-fast, .15s) var(--pro-ease, ease);
}
input[type="email"]:focus, input[type="password"]:focus, input[type="text"]:focus { border-color: #111; box-shadow: 0 0 0 3px rgb(17 17 17 / .08); }

.remember { display: flex; align-items: center; min-height: 44px; gap: 10px; margin: 0 0 24px; font-size: .875rem; font-weight: 500; cursor: pointer; }
.remember input { width: 18px; height: 18px; margin: 0; accent-color: #111; }

button {
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 9999px;
    background: #111;
    color: #fff;
    font: inherit;
    font-size: .9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow var(--pro-fast, .15s) var(--pro-ease, ease), background-color var(--pro-fast, .15s) var(--pro-ease, ease);
}
button:hover { background: #242424; box-shadow: 0 6px 16px rgb(17 17 17 / .2); }
button:focus-visible { outline: 2px solid #111; outline-offset: 3px; }

.secondary-button { background: #fff; color: #111; border: 1px solid #cdd3da; }
.secondary-button:hover { background: #f5f6f8; box-shadow: none; }
.danger-button { background: #d94e5d; }
.danger-button:hover { background: #c23f4d; box-shadow: 0 6px 16px rgb(217 78 93 / .25); }

.secondary-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 16px;
    padding: 6px;
    border: 0;
    background: none;
    color: var(--pro-muted, #6b7280);
    font-size: .8125rem;
    font-weight: 500;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.secondary-link:hover { background: none; box-shadow: none; color: #111; }
a { color: inherit; }
.card-link { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 14px; font-size: .875rem; text-align: center; color: var(--pro-muted, #6b7280); }

.error-box, .status-box { margin-bottom: 20px; padding: 12px 16px; border-radius: 14px; font-size: .875rem; line-height: 1.45; }
.error-box { border: 1px solid #e7c7cb; background: #fdecee; color: #b4323f; }
.status-box { border: 1px solid #bfe3cf; background: #eaf7f0; color: #1f7a4d; }

.footer { margin-top: 20px; text-align: center; color: #8d98a6; font-size: .8125rem; }

.code-input { font-size: 1.375rem !important; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }

.qr-box { display: flex; justify-content: center; margin: 8px 0 16px; }
.qr-box svg { width: 196px; height: 196px; }

.manual-key {
    display: block;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px dashed #cdd3da;
    border-radius: 14px;
    background: #f5f6f8;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8125rem;
    word-spacing: 4px;
    text-align: center;
}

.codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 16px;
    padding: 16px;
    border: 1px solid var(--pro-line, #e2e8f0);
    border-radius: 14px;
    background: #f5f6f8;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .875rem;
    list-style: none;
}

.section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--pro-line, #e2e8f0); }
.section h2 { margin: 0 0 8px; font-size: 1rem; font-weight: 600; }
.stack { margin-top: 12px; }

@media (max-width: 360px) {
    .login-container { padding-inline: 12px; }
    .login-card { padding: 24px; }
    .codes { grid-template-columns: minmax(0, 1fr); }
}
