/* Pantallas de doble factor (A2F): elegir método, código de Google Authenticator y código por email.
   Se activa con la clase auth-a2f en .auth-wrapper (sección auth-class de cada vista).
   Logos más pequeños que en el login, tarjeta más ancha y aire «tecnológico» (usuario, 2026-10-10). */
.auth-a2f .auth-content .app_logo.top-logo { max-width: 170px !important; }
.auth-a2f .dash-footer .app_logo.footer-logo { max-width: 120px !important; }
.auth-a2f .auth-content .cust-margin > .mx-3 { margin-top: 2rem !important; }
/* La columna del layout (col-xl-6) dejaba la tarjeta en ~450 px: en A2F la columna se ensancha hasta 720 px. */
.auth-a2f .auth-content .cust-margin { flex: 0 0 auto; width: min(720px, 100%); max-width: 100%; }

.a2f-card {
    --a2f-accent: #3b82f6;
    --a2f-accent-2: #22d3ee;
    --a2f-bg: #ffffff;
    --a2f-text: #0f172a;
    --a2f-muted: #64748b;
    --a2f-border: rgba(59, 130, 246, .28);
    --a2f-tile: #f8fafc;
    --a2f-tile-hover: #eff6ff;
    width: min(620px, 100%);
    margin: 1.5rem auto 2rem;
    padding: 2rem 2.25rem 1.75rem;
    text-align: left;
    color: var(--a2f-text);
    background: var(--a2f-bg);
    border: 1px solid var(--a2f-border);
    border-radius: 18px;
    position: relative;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .12), 0 0 0 6px rgba(59, 130, 246, .06);
    overflow: hidden;
}
/* Línea de luz arriba y rejilla sutil de fondo */
.a2f-card::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, var(--a2f-accent), var(--a2f-accent-2), var(--a2f-accent));
}
.a2f-card::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .35;
    background-image: linear-gradient(rgba(59, 130, 246, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(59, 130, 246, .06) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse at top right, #000 10%, transparent 70%);
    mask-image: radial-gradient(ellipse at top right, #000 10%, transparent 70%);
}
.a2f-card > * { position: relative; z-index: 1; }

.a2f-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.a2f-badge {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    color: #fff; font-size: 26px;
    background: linear-gradient(135deg, var(--a2f-accent), var(--a2f-accent-2));
    box-shadow: 0 8px 20px rgba(59, 130, 246, .35);
}
.a2f-head h1 { font-size: 1.25rem; font-weight: 700; margin: 0 0 .15rem; letter-spacing: -.01em; }
.a2f-head p { margin: 0; color: var(--a2f-muted); font-size: .9rem; }
.a2f-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--a2f-accent); margin-bottom: .35rem; }

/* Opciones de método: tarjetas grandes con icono, título y explicación */
.a2f-options { display: grid; gap: .75rem; margin-top: .5rem; }
.a2f-option {
    display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 1rem;
    width: 100%; padding: 1rem 1.1rem; text-align: left; cursor: pointer;
    background: var(--a2f-tile); color: var(--a2f-text);
    border: 1px solid rgba(100, 116, 139, .25); border-radius: 14px;
    transition: border-color .2s, box-shadow .2s, transform .2s, background .2s;
}
.a2f-option:hover, .a2f-option:focus-visible {
    outline: none; background: var(--a2f-tile-hover); border-color: var(--a2f-accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .15), 0 10px 24px rgba(15, 23, 42, .08); transform: translateY(-1px);
}
.a2f-option .ico {
    width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 24px;
    color: var(--a2f-accent); background: rgba(59, 130, 246, .12);
}
.a2f-option .ttl { font-weight: 700; font-size: 1rem; }
.a2f-option .sub { font-size: .85rem; color: var(--a2f-muted); margin-top: .1rem; }
.a2f-option .go { font-size: 22px; color: var(--a2f-muted); transition: transform .2s, color .2s; }
.a2f-option:hover .go { transform: translateX(3px); color: var(--a2f-accent); }

/* Código de 6 dígitos */
.a2f-label { display: block; font-size: .8rem; font-weight: 600; color: var(--a2f-muted); margin-bottom: .5rem; letter-spacing: .04em; text-transform: uppercase; }
.a2f-card .a2f-otp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 2.1rem; font-weight: 700; letter-spacing: .85rem; text-align: center; height: 4.1rem;
    padding: 0 0 0 .85rem; /* compensa el letter-spacing del último dígito */
    color: var(--a2f-text); background: var(--a2f-tile); border: 1px solid rgba(100, 116, 139, .3); border-radius: 12px;
    transition: border-color .2s, box-shadow .2s;
}
.a2f-card .a2f-otp:focus { border-color: var(--a2f-accent); box-shadow: 0 0 0 4px rgba(59, 130, 246, .18); background: var(--a2f-bg); }
.a2f-card .a2f-otp::placeholder { color: rgba(100, 116, 139, .45); letter-spacing: .85rem; }

.a2f-card .a2f-btn {
    width: 100%; height: 3.1rem; margin-top: 1rem; font-weight: 700; font-size: 1rem; border: 0; border-radius: 12px; color: #fff;
    background: linear-gradient(135deg, var(--a2f-accent), #2563eb);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .35); transition: transform .15s, box-shadow .15s, filter .15s;
}
.a2f-card .a2f-btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 28px rgba(37, 99, 235, .4); }
.a2f-card .a2f-btn:active { transform: translateY(0); }

.a2f-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed rgba(100, 116, 139, .3); font-size: .85rem; color: var(--a2f-muted); }
.a2f-foot .btn-link { padding: 0; font-weight: 600; text-decoration: none; }
.a2f-foot .btn-link:hover { text-decoration: underline; }
.a2f-card .alert { border-radius: 10px; font-size: .9rem; }

/* Modo oscuro */
html.dark-mode .a2f-card, body.dark .a2f-card, body.dark-mode .a2f-card {
    --a2f-bg: #121826; --a2f-text: #e2e8f0; --a2f-muted: #94a3b8; --a2f-border: rgba(96, 165, 250, .35);
    --a2f-tile: #1a2234; --a2f-tile-hover: #1e2a40; --a2f-accent: #60a5fa;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 0 6px rgba(96, 165, 250, .06);
}
html.dark-mode .a2f-card::after, body.dark .a2f-card::after, body.dark-mode .a2f-card::after { opacity: .5; }
html.dark-mode .a2f-option, body.dark .a2f-option, body.dark-mode .a2f-option { border-color: rgba(148, 163, 184, .2); }
html.dark-mode .a2f-card .a2f-otp, body.dark .a2f-card .a2f-otp, body.dark-mode .a2f-card .a2f-otp { border-color: rgba(148, 163, 184, .25); }

@media (max-width: 575px) {
    .a2f-card { padding: 1.5rem 1.15rem; border-radius: 14px; }
    .a2f-option { grid-template-columns: 42px 1fr auto; gap: .75rem; padding: .85rem .9rem; }
    .a2f-card .a2f-otp { font-size: 1.7rem; letter-spacing: .6rem; padding-left: .6rem; }
}

/* ── Login (2026-10-10): misma tarjeta que la A2F, con campos de texto, ver/ocultar contraseña e interruptor «Recuérdame». ── */
.a2f-login { width: min(560px, 100%); }
.a2f-form { display: grid; gap: 1.05rem; margin-top: .25rem; }
.a2f-field { display: grid; gap: .45rem; }
.a2f-field .a2f-label { margin-bottom: 0; }
.a2f-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.a2f-link { font-size: .82rem; font-weight: 600; color: var(--a2f-accent); text-decoration: none; }
.a2f-link:hover { text-decoration: underline; color: var(--a2f-accent); }
.a2f-input-wrap { position: relative; display: flex; align-items: center; }
.a2f-input-ico { position: absolute; left: .95rem; font-size: 1.15rem; color: var(--a2f-muted); pointer-events: none; }
.a2f-card .a2f-input {
    width: 100%; height: 3.2rem; padding: 0 3rem 0 2.85rem; font-size: 1rem; color: var(--a2f-text);
    background: var(--a2f-tile); border: 1px solid rgba(100, 116, 139, .3); border-radius: 12px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.a2f-card .a2f-input::placeholder { color: rgba(100, 116, 139, .55); }
.a2f-card .a2f-input:focus { border-color: var(--a2f-accent); box-shadow: 0 0 0 4px rgba(59, 130, 246, .18); background: var(--a2f-bg); outline: none; }
.a2f-card .a2f-input.is-invalid { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); background-image: none; }
.a2f-input-wrap:focus-within .a2f-input-ico { color: var(--a2f-accent); }
.a2f-eye {
    position: absolute; right: .5rem; width: 2.3rem; height: 2.3rem; display: grid; place-items: center;
    border: 0; border-radius: 9px; background: transparent; color: var(--a2f-muted); font-size: 1.15rem; cursor: pointer;
    transition: background .15s, color .15s;
}
.a2f-eye:hover, .a2f-eye:focus-visible { background: rgba(59, 130, 246, .12); color: var(--a2f-accent); outline: none; }
/* Interruptor «Recuérdame» */
.a2f-switch { display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; user-select: none; font-size: .9rem; color: var(--a2f-text); margin: 0; }
.a2f-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.a2f-switch-track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: rgba(100, 116, 139, .35); transition: background .2s; flex: 0 0 auto; }
.a2f-switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .2s; }
.a2f-switch input:checked + .a2f-switch-track { background: linear-gradient(135deg, var(--a2f-accent), #2563eb); }
.a2f-switch input:checked + .a2f-switch-track::after { transform: translateX(18px); }
.a2f-switch input:focus-visible + .a2f-switch-track { box-shadow: 0 0 0 4px rgba(59, 130, 246, .25); }
.a2f-login .a2f-btn { margin-top: .25rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.a2f-login .a2f-btn i { font-size: 1.2rem; }
.a2f-login .a2f-foot { justify-content: center; text-align: center; }
html.dark-mode .a2f-card .a2f-input, body.dark .a2f-card .a2f-input, body.dark-mode .a2f-card .a2f-input { border-color: rgba(148, 163, 184, .25); }
html.dark-mode .a2f-switch-track, body.dark .a2f-switch-track, body.dark-mode .a2f-switch-track { background: rgba(148, 163, 184, .3); }

/* ── Login: fondo de color entero, logo BLANCO arriba y pie con el logo encima del texto en blanco (usuario, 2026-10-10) ── */
/* La franja de color del tema (.bg-auth-side) solo cubría el 60 % de arriba; en el login cubre toda la pantalla,
   así el logo blanco y el pie en blanco siempre caen sobre color, caiga donde caiga la tarjeta. */
.auth-login .bg-auth-side { bottom: 0 !important; display: block !important; }
/* Logo blanco sin halo siempre, también en modo claro. Vale para TODAS las pantallas auth-a2f (login y
   doble factor): el logo cae sobre la franja azul del tema, y el azul sobre azul no se veía en claro
   en la verificación en dos pasos (usuario, 2026-10-20). */
.auth-a2f .auth-content .top-logo.logo-for-light { display: none !important; }
.auth-a2f .auth-content .top-logo.logo-for-dark { display: inline-block !important; }
.auth-login .auth-content .top-logo.logo-for-dark { max-width: 200px !important; }
/* Pie: logo encima, texto debajo, todo centrado y en blanco */
/* El tema pone el pie 70 px más abajo (top:70px) con márgenes grandes: en el login va JUSTO debajo de la tarjeta, centrado. */
.auth-login .a2f-login { margin-bottom: .75rem; }
.auth-login .dash-footer { position: static !important; top: 0 !important; margin: 0 auto !important; padding: 0 0 1.5rem !important; width: 100% !important; text-align: center; }
.auth-login .dash-footer .footer-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; text-align: center; }
.auth-login .dash-footer .footer-wrapper .ms-auto { margin-left: 0 !important; margin-right: 0 !important; }
.auth-login .dash-footer .footer-wrapper > div { font-size: .9rem; }
.auth-login .dash-footer, .auth-login .dash-footer .text-muted, .auth-login .dash-footer a { color: #fff !important; }
.auth-login .dash-footer a { font-weight: 700; text-decoration: none; }
.auth-login .dash-footer a:hover { text-decoration: underline; }
