/* Páginas de acceso (inicio de sesión y recuperación) con la identidad Comansys Kaizen. */
.auth-page {
    --a-deep: #040f2b;
    --a-navy: #031b46;
    --a-navy-2: #123464;
    --a-gold: #f5b800;
    --a-coral: #ff7a59;
    --a-ink: #0f172a;
    --a-muted: #5b6678;
    --a-line: #dbe2ec;
    --a-grad: linear-gradient(100deg, #ffd166 0%, #f5b800 45%, #ff7a59 100%);
    margin: 0;
    min-height: 100vh;
    color: var(--a-ink);
    background: #f3f6fb;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
/* Fondo de marca a pantalla completa */
.auth-page {
    position: relative;
    background: radial-gradient(800px 480px at 85% -10%, rgba(56, 189, 248, .2), transparent 60%),
        radial-gradient(700px 480px at -10% 110%, rgba(245, 184, 0, .18), transparent 60%),
        linear-gradient(160deg, #061638 0%, var(--a-deep) 55%, #020817 100%);
    background-attachment: fixed;
}
.auth-backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.auth-backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 10%, transparent 70%);
    mask-image: radial-gradient(ellipse at 50% 45%, #000 10%, transparent 70%);
}
.auth-backdrop span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; }
.auth-backdrop span:nth-child(1) { top: -120px; right: 10%; width: 380px; height: 380px; background: #1d4ed8; }
.auth-backdrop span:nth-child(2) { bottom: -140px; left: 8%; width: 340px; height: 340px; background: var(--a-gold); opacity: .18; }
.auth-center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    min-height: 100vh;
    padding: 2rem 1rem;
}
.auth-card-logo { margin: -0.25rem 0 1.5rem; text-align: center; }
.auth-card-logo img { width: 190px; max-width: 70%; height: auto; }
.auth-card { position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--a-grad); }
.auth-foot { display: inline-flex; align-items: center; gap: .45rem; margin: 0; color: rgba(203, 213, 225, .65); font-size: .82rem; }
.auth-foot svg { color: var(--a-gold); }

/* Tarjeta del formulario */
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: clamp(1.75rem, 4vw, 2.5rem);
    background: #fff;
    border: 1px solid #e4e9f1;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .8rem;
    color: var(--a-navy);
    background: rgba(245, 184, 0, .14);
    border: 1px solid rgba(245, 184, 0, .35);
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.auth-eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--a-grad); border-radius: 50%; }
.auth-title { margin: 1rem 0 .35rem; color: var(--a-navy); font-family: "Sora", "Inter", sans-serif; font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; }
.auth-subtitle { margin: 0 0 1.6rem; color: var(--a-muted); font-size: .95rem; line-height: 1.55; }

.auth-card .form-label { margin-bottom: .4rem; color: #1e293b; font-size: .86rem; font-weight: 600; }
.auth-card .form-control {
    min-height: 50px;
    padding: .7rem .95rem;
    color: var(--a-ink);
    background: #f8fafc;
    border: 1.5px solid var(--a-line);
    border-radius: 14px;
    font-size: .97rem;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.auth-card .form-control:hover { border-color: #b8c5d6; }
.auth-card .form-control:focus { background: #fff; border-color: var(--a-gold); box-shadow: 0 0 0 4px rgba(245, 184, 0, .2); }
.auth-card .input-group > .form-control { border-right: 0; border-radius: 14px 0 0 14px !important; }
.auth-card .input-group [data-password-toggle] {
    min-width: 52px;
    color: var(--a-navy-2);
    background: #f8fafc;
    border: 1.5px solid var(--a-line);
    border-left: 0;
    border-radius: 0 14px 14px 0 !important;
}
.auth-card .input-group [data-password-toggle]:hover { color: var(--a-navy); background: #eef2f8; }
.auth-card .input-group:focus-within > .form-control,
.auth-card .input-group:focus-within [data-password-toggle] { border-color: var(--a-gold); }
.auth-card .input-group:focus-within { border-radius: 14px; box-shadow: 0 0 0 4px rgba(245, 184, 0, .2); }
.auth-card .input-group:focus-within > .form-control { box-shadow: none; }

.auth-card .btn-primary,
.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 52px;
    color: var(--a-deep) !important;
    background: var(--a-grad) !important;
    border: 0 !important;
    border-radius: 14px !important;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 12px 26px rgba(255, 122, 89, .3);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(255, 122, 89, .38); }
.auth-card .btn-primary:disabled { filter: grayscale(.3); opacity: .7; transform: none; }
.auth-link { color: var(--a-navy-2); font-size: .9rem; font-weight: 600; text-decoration: none; }
.auth-link:hover { color: var(--a-navy); text-decoration: underline; }
.auth-card .alert { border: 0; border-radius: 14px; font-size: .9rem; }
.auth-back { color: var(--a-muted); font-size: .88rem; font-weight: 600; text-decoration: none; }
.auth-back:hover { color: var(--a-navy); }

@media (prefers-reduced-motion: reduce) { .auth-page * { transition: none !important; } }

/* Verificación en dos pasos */
.tf-steps { display: grid; gap: 1rem; margin: 0 0 1.5rem; padding: 0; list-style: none; counter-reset: tf; }
.tf-steps li { position: relative; display: flex; flex-direction: column; gap: .3rem; padding-left: 2.6rem; color: var(--a-muted); font-size: .9rem; counter-increment: tf; }
.tf-steps li::before {
    content: counter(tf);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--a-deep);
    background: var(--a-grad);
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 800;
}
.tf-steps strong { color: var(--a-navy); font-size: .95rem; }
.tf-stores { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }
.tf-stores a { padding: .35rem .75rem; color: var(--a-navy); background: #f1f5f9; border: 1px solid var(--a-line); border-radius: 999px; font-size: .8rem; font-weight: 600; text-decoration: none; }
.tf-stores a:hover { border-color: var(--a-gold); }
.tf-qr { width: 196px; margin: .6rem 0 .2rem; padding: 10px; background: #fff; border: 1px solid var(--a-line); border-radius: 16px; }
.tf-qr svg { display: block; width: 100%; height: auto; }
.tf-manual { color: var(--a-muted); font-size: .86rem; }
.tf-manual summary { color: var(--a-navy-2); font-weight: 600; cursor: pointer; }
.tf-manual p { margin: .5rem 0; }
.tf-key { display: block; padding: .6rem .8rem; color: var(--a-navy); background: #f8fafc; border: 1px dashed var(--a-line); border-radius: 10px; font-size: .95rem; letter-spacing: .06em; word-break: break-all; }
.auth-card .tf-code { font-size: 1.4rem !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.tf-codes { padding: 1rem 1.1rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: 14px; }
.tf-codes strong { color: var(--a-navy); }
.tf-codes p { margin: .3rem 0 .7rem; color: #713f12; font-size: .86rem; }
.tf-codes ul { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .75rem; margin: 0 0 .9rem; padding: 0; list-style: none; }
.tf-codes code { color: var(--a-navy); font-size: .92rem; font-weight: 700; }
@media print {
    .auth-backdrop, .auth-foot, .tf-manual, form, .btn { display: none !important; }
    .auth-page { background: #fff !important; }
    .auth-card { box-shadow: none !important; border: 0 !important; }
}
.tf-apps { display: grid; gap: .45rem; margin-top: .25rem; }
.tf-app { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: .5rem .7rem; color: var(--a-ink); background: #f8fafc; border: 1px solid var(--a-line); border-radius: 12px; font-size: .86rem; }
.tf-app a { padding: .2rem .6rem; color: var(--a-navy); background: #fff; border: 1px solid var(--a-line); border-radius: 999px; font-size: .78rem; font-weight: 600; text-decoration: none; }
.tf-app a:hover { border-color: var(--a-gold); }
.tf-note { margin-top: .2rem; font-size: .82rem; }
.tf-option { display: flex; gap: .7rem; margin-top: .6rem; padding: .75rem; background: #fff; border: 1px solid var(--a-line); border-radius: 14px; font-size: .86rem; }
.tf-option b { color: var(--a-navy); }
.tf-option-tag { display: grid; flex: 0 0 auto; place-items: center; width: 24px; height: 24px; color: #fff; background: var(--a-navy-2); border-radius: 8px; font-size: .75rem; font-weight: 800; }
.tf-option .tf-qr { width: 210px; max-width: 100%; }
.tf-open { border-radius: 10px !important; }
.tf-manual-fields { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .75rem; margin: .6rem 0; }
.tf-manual-fields dt { color: var(--a-muted); font-weight: 600; font-size: .8rem; }
.tf-manual-fields dd { margin: 0; color: var(--a-ink); font-size: .84rem; overflow-wrap: anywhere; }
.tf-manual-fields .tf-key { padding: .35rem .55rem; font-size: .88rem; }
@media (max-width: 575.98px) {
    .tf-option { flex-direction: column; gap: .5rem; }
    .tf-manual-fields { grid-template-columns: 1fr; gap: .15rem; }
    .tf-manual-fields dd { margin-bottom: .5rem; }
}
/* Opciones B y C plegadas */
.tf-fold { display: block; padding: 0; }
.tf-fold > summary { display: flex; align-items: center; gap: .7rem; padding: .7rem .75rem; cursor: pointer; list-style: none; }
.tf-fold > summary::-webkit-details-marker { display: none; }
.tf-fold > summary::after { content: "+"; margin-left: auto; color: var(--a-navy-2); font-weight: 800; }
.tf-fold[open] > summary::after { content: "−"; }
.tf-fold[open] > summary { border-bottom: 1px solid var(--a-line); }
.tf-fold-body { padding: .75rem; }
@media (max-width: 575.98px) { .tf-fold { flex-direction: initial; } }
