:root {
    /* ===== PALETA BINGO LYSTO ===== */

    /* Colores principales */
    --auth-brand:      #602e9e; /* Púrpura principal */
    --auth-brand-2:    #2d0e61; /* Púrpura profundo */

    /* Gradientes y acentos */
    --auth-grad-a:     #fcd924; /* Amarillo dorado */
    --auth-grad-b:     #ee4c2c; /* Ámbar */

    --auth-grad-error: #e23f83;

    /* Texto */
    --auth-text:       #2d0e61;
    --auth-muted:      #6f6890;

    /* Formularios */
    --auth-field-line: #d9d0ee;
    --auth-bg:         #ffffff;

    /* Overlay del panel lateral */
    --auth-side-overlay:
        linear-gradient(
            135deg,
            rgba(45,14,97,.85) 0%,
            rgba(103,44,167,.88) 60%,
            rgba(227,147,7,.35) 100%
        );

    /* Superficies */
    --surface-1: rgba(255,255,255,.05);
    --surface-2: rgba(255,255,255,.08);

    /* Bordes */
    --border: rgba(255,255,255,.12);

    /* Sombras */
    --shadow: 0 20px 40px rgba(45,14,97,.25);

    /* Colores de la marca */
    --purple-deep: #2d0e61;
    --purple-mid:  #602e9e;
    --yellow-lemon:#fcd924;
    --cream:       #ece5d8;
    --amber:       #ee4c2c;
}

html[data-theme="dark"] {
    --auth-text:       #ece5d8;
    --auth-muted:      #c7bedf;

    --auth-field-line: rgba(255,255,255,.15);
    --auth-bg:         #12082c;

    --surface-1: rgba(255,255,255,.03);
    --surface-2: rgba(255,255,255,.05);

    --border: rgba(255,255,255,.08);

    --shadow: 0 20px 40px rgba(0,0,0,.45);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    min-height: 100dvh;
    margin: 0;
    padding: 0;
}

body {
    background: var(--auth-bg);
    color: var(--auth-text);
    overflow-x: hidden;
    font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Neutralizar paddings del layout base */
.container { max-width: none !important; padding: 0 !important; }
.py-4 { padding-top: 0 !important; padding-bottom: 0 !important; }

.auth-shell {
    display: flex;
    flex-wrap: wrap;
    min-height: 100dvh;
    width: 100%;
    margin: 0;
    background: var(--auth-bg);
}

/* ── Panel izquierdo (branding) ───────────────────────── */
.auth-side {
    position: relative;
    flex: 1 1 56%;
    max-width: 62%;
    min-height: 100dvh;
    overflow: hidden;

    background:
        var(--auth-side-overlay),
        radial-gradient(
            circle at 20% 20%,
            rgba(255,255,255,.08),
            transparent 40%
        ),
        linear-gradient(
            135deg,
            #2d0e61 0%,
            #4c1f88 45%,
            #602e9e 100%
        );

    background-size: cover;
    background-position: center;
}

.auth-side::after {
    content: "";
    position: absolute;
    inset: 0;

    background:
        radial-gradient(
            circle at 85% 80%,
            rgba(226,213,43,.28),
            transparent 35%
        ),
        radial-gradient(
            circle at 15% 85%,
            rgba(227,147,7,.25),
            transparent 35%
        );

    pointer-events: none;
}

.auth-side-content {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 64px;
    z-index: 2;
    color: #fff;
}

/* Logo dentro del panel izquierdo (solo escritorio) */
.auth-side-logo {
    margin-bottom: 28px;
}
.auth-side-logo img {
    height: 200px;
    object-fit: contain;
}

.auth-side-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .04em;
    backdrop-filter: blur(6px);
    margin-bottom: 26px;
}

.auth-side-content h1 {
    margin: 0;
    font-size: clamp(2.2rem, 2.8vw, 3.4rem);
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}

.auth-side-content .auth-grad-word {
    background: linear-gradient(
        180deg,
        #fff7b0 0%,
        #fcd924 45%,
        #ee4c2c 100%
    );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-side-content p {
    margin: 18px 0 0;
    max-width: 460px;
    font-size: 1.08rem;
    font-weight: 500;
    line-height: 1.6;
    color: rgba(255,255,255,.85);
}

.auth-side-points {
    list-style: none;
    margin: 30px 0 0;
    padding: 0;
    display: grid;
    gap: 14px;
    max-width: 420px;
}

.auth-side-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .98rem;
    font-weight: 500;
    color: rgba(255,255,255,.92);
}

.auth-side-points li i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22);
    font-size: .95rem;
}

/* ── Panel derecho (formulario) ───────────────────────── */
.auth-main {
    flex: 1 1 38%;
    max-width: 38%;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: var(--auth-bg);
}

.auth-form {
    width: 100%;
    max-width: 380px;
}

/* Logo dentro del formulario (solo móvil) */
.auth-logo {
    text-align: center;
    margin-bottom: 18px;
    display: none; /* oculto en escritorio, el logo se ve en el panel izquierdo */
}

.auth-logo img {
    height: 200px;
    object-fit: contain;
}

.auth-form h3 {
    color: var(--auth-text);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 6px;
    text-align: center;
}

.auth-form .auth-hint {
    color: var(--auth-muted);
    text-align: center;
    font-size: .92rem;
    margin: 0 0 20px;
}

/* Inputs estilo material */
.group.material-input {
    position: relative;
    margin-bottom: 25px;
    padding-left: 55px;
}

.group.material-input .mi-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;

    background: linear-gradient(
        135deg,
        #2d0e61,
        #602e9e
    );

    border: 1px solid rgba(226,213,43,.4);

    border-radius: 12px;

    box-shadow:
        0 4px 12px rgba(45,14,97,.35),
        0 0 8px rgba(226,213,43,.2);
}

.group.material-input input {
    font-size: .8rem;
    padding: 10px 10px 10px 10px;
    display: block;
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--auth-field-line);
    background: transparent;
    color: var(--auth-text);
}

.group.material-input input:focus { outline: none; }

.group.material-input label {
    color: var(--auth-muted);
    font-size: .8rem;
    font-weight: normal;
    position: absolute;
    pointer-events: none;
    left: 28px;
    top: 10px;
    padding-left: 30px;
    text-transform: uppercase;
    transition: .2s ease all;
}

.group.material-input input:focus ~ label,
.group.material-input input:valid ~ label,
.group.material-input input.has-value ~ label {
    top: -16px;
    left: 28px;
    font-size: .75rem;
    color: var(--auth-brand);
    font-weight: 600;
}

.group.material-input .bar {
    position: relative;
    display: block;
    width: 100%;
}

.group.material-input .bar:before,
.group.material-input .bar:after {
    content: "";
    height: 2px;
    width: 0;
    bottom: 0;
    position: absolute;
    background: linear-gradient(90deg, var(--auth-grad-a), var(--auth-grad-b));
    transition: .2s ease all;
}

.group.material-input .bar:before { left: 50%; }
.group.material-input .bar:after { right: 50%; }

.group.material-input input:focus ~ .bar:before,
.group.material-input input:focus ~ .bar:after { width: 50%; }

.group.material-input.is-invalid input { border-bottom-color: var(--auth-grad-a); }

.group.material-input select,
.group.material-input select.form-control {
    font-size: .8rem;
    padding: 10px 10px 10px 10px;
    display: block;
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--auth-field-line);
    background-color: transparent !important;
    background-image: none !important;        
    background-repeat: no-repeat !important;
    background-position: unset !important;
    background-size: unset !important;
    color: var(--auth-text);
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    cursor: pointer;
}

.group.material-input select:focus { outline: none; }
.group.material-input select::-ms-expand { display: none !important; }

html[data-theme="light"] .group.material-input select,
html[data-theme="light"] .group.material-input select.form-control,
html[data-theme="dark"]  .group.material-input select,
html[data-theme="dark"]  .group.material-input select.form-control {
    background-image: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.group.material-input select:focus { outline: none; }
.group.material-input select::-ms-expand { display: none; }
.group.material-input.is-invalid select { border-bottom-color: var(--auth-grad-a); }

/* Flechita única del select */
.group.material-input.is-select::after {
    content: "\f078"; /* fa-chevron-down */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 4px;
    top: 12px;
    font-size: .8rem;
    color: var(--auth-muted);
    pointer-events: none;
}

/* El select siempre tiene valor -> label siempre arriba */
.group.material-input.is-select label {
    top: -16px;
    left: 28px;
    font-size: .78rem;
    color: var(--auth-brand);
    font-weight: 600;
}

/* Opciones legibles en tema oscuro */
.group.material-input select option {
    color: #2c304d;
    background: #fff;
}

.auth-field-error {
    color: var(--auth-grad-error);
    font-size: .8rem;
    margin-top: 6px;
}

.auth-field-help {
    color: var(--auth-muted);
    font-size: .8rem;
    margin-top: 6px;
}

/* Botón principal degradado */
.btn-gradient {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 13px 20px;
    font-weight: 700;
    color: #fff !important;
    background: linear-gradient(to right, var(--auth-grad-a) 0%, var(--auth-grad-b) 100%);
    background-size: 200% auto;
    transition: .4s, transform .15s ease;
    box-shadow: 0 12px 26px rgba(226,63,131,.28);
}

.btn-gradient:hover { background-position: right center; color: #fff; }
.btn-gradient:active { transform: translateY(1px) scale(.99); }
.btn-gradient:disabled { opacity: .55; }

.btn-outline-auth {
    width: 100%;
    border: 1px solid var(--auth-field-line);
    border-radius: 10px;
    padding: 11px 18px;
    font-weight: 600;
    color: var(--auth-muted) !important;
    background: transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color .2s ease, color .2s ease;
}

.btn-outline-auth:hover { border-color: var(--auth-brand); color: var(--auth-brand) !important; }

.auth-links-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85rem;
    margin-top: 14px;
}

.auth-links-center {
    justify-content: center;
}

.auth-link {
    color: var(--auth-brand);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover { color: var(--auth-grad-a); }

.auth-sep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--auth-muted);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.auth-sep::before,
.auth-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-field-line);
}

.btn-google {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: #3c4043 !important;
    border: 1px solid #dadce0;
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 600;
    text-decoration: none;
    transition: box-shadow .2s ease, transform .15s ease, background .2s ease;
}

.btn-google:hover { box-shadow: 0 6px 18px rgba(60,64,67,.18); background: #f8fafc; }
.btn-google:active { transform: translateY(1px); }

.auth-register {
    text-align: center;
    margin-top: 18px;
    color: var(--auth-muted);
    font-size: .92rem;
}

.auth-register.small {
    font-size: .75rem;
}

/* Alertas */
.auth-alert {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: .9rem;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid transparent;
}
.auth-alert ul { margin: 6px 0 0; padding-left: 18px; }
.auth-alert-success { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); color: #15803d; }
.auth-alert-danger  { background: rgba(226,63,131,.12); border-color: rgba(226,63,131,.35); color: #be123c; }
.auth-alert-info    { background: rgba(93,83,134,.12); border-color: rgba(93,83,134,.35); color: #5d5386; }
.auth-alert-warning { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); color: #b45309; }
html[data-theme="dark"] .auth-alert-success { color: #4ade80; }
html[data-theme="dark"] .auth-alert-danger  { color: #fb7185; }
html[data-theme="dark"] .auth-alert-info    { color: #c4b5fd; }
html[data-theme="dark"] .auth-alert-warning { color: #fbbf24; }

/* Aviso de bienvenida paso 2 (independiente de auth-alert) */
.auth-welcome {
    display: block;
    width: 100%;
    background: rgba(93,83,134,.10);
    border: 1px solid rgba(93,83,134,.30);
    color: var(--auth-text);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: .9rem;
    line-height: 1.45;
    margin: 0 0 28px;
}
.auth-welcome i { color: var(--auth-brand); margin-right: 8px; }
.auth-welcome strong { color: var(--auth-brand); font-weight: 700; }
html[data-theme="dark"] .auth-welcome {
    background: rgba(196,181,253,.12);
    border-color: rgba(196,181,253,.3);
    color: var(--auth-text);
}
.auth-welcome + form .group.material-input:first-of-type { margin-top: 4px; }

/* Indicador de pasos */
.auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-step-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    background: rgba(93,83,134,.12);
    color: var(--auth-muted);
    border: 1px solid var(--auth-field-line);
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.auth-step-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--auth-muted);
    letter-spacing: .02em;
    transition: color .2s ease;
}

.auth-step.active .auth-step-dot {
    background: linear-gradient(135deg, var(--auth-grad-a), var(--auth-grad-b));
    color: #fff;
    border-color: transparent;
}

.auth-step.active .auth-step-label { color: var(--auth-text); }

.auth-step-line {
    width: 36px;
    height: 2px;
    background: var(--auth-field-line);
}

@media (max-width: 360px) {
    .auth-step-label { display: none; }
}

.theme-fab {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    z-index: 9999;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-1);
    border: 0px solid var(--border);
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(6px);
}
.theme-fab:hover { background: var(--surface-2); }
.theme-fab { outline: none; box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.18); }
html[data-theme="light"] .theme-fab { border-color: rgba(0, 0, 0, 0.15); color: #f59e0b; }

/* Teclado PIN */
.pin-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: rgba(93,83,134,.16);
    border: 2px solid rgba(93,83,134,.4);
    transition: transform .15s ease, background .15s ease;
}

.pin-dot.filled {
    background: linear-gradient(135deg, var(--auth-grad-a), var(--auth-grad-b));
    border-color: transparent;
    transform: scale(1.15);
}

.pin-dot.error {
    background: var(--auth-grad-a);
    border-color: var(--auth-grad-a);
    animation: pinShake .4s ease;
}

@keyframes pinShake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.pin-keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 300px;
    margin: 0 auto;
}

.pin-key {
    aspect-ratio: 1 / 1;
    max-height: 82px;
    border-radius: 18px;
    background: rgba(93,83,134,.06);
    border: 1px solid var(--auth-field-line);
    color: var(--auth-text);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s ease, transform .1s ease, border-color .15s ease;
}

.pin-key:hover { border-color: var(--auth-brand); }
.pin-key:active { transform: scale(.94); background: rgba(226,63,131,.14); }
.pin-key-back, .pin-key-clear { color: var(--auth-muted); }
.pin-key-huella { color: var(--auth-brand); }

.quick-user {
    text-align: center;
    margin-bottom: 18px;
}

.quick-user #lrAvatar {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(135deg, var(--auth-brand), var(--auth-grad-a));
}

.quick-user #lrNombre {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--auth-text);
    margin: 0;
}

/* OTP inputs */
.otp-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 8px 0 4px;
}
.otp-input {
    width: 48px;
    height: 58px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    border: none;
    border-bottom: 2px solid var(--auth-field-line);
    background: rgba(93,83,134,.05);
    color: var(--auth-text);
    transition: border-color .2s ease, background .2s ease;
}
.otp-input:focus {
    outline: none;
    border-bottom-color: var(--auth-grad-a);
    background: rgba(226,63,131,.08);
}
.otp-input.filled { border-bottom-color: var(--auth-brand); }
.otp-input.is-invalid { border-bottom-color: var(--auth-grad-a); }

.timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,158,11,.15);
    border: 1px solid rgba(245,158,11,.3);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: .82rem;
    color: #b45309;
    font-weight: 600;
}
.timer-badge.expired {
    background: rgba(226,63,131,.15);
    border-color: rgba(226,63,131,.3);
    color: #be123c;
}

/* Info cuenta Google */
.auth-google-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(93,83,134,.1);
    border: 1px solid var(--auth-field-line);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: .88rem;
    color: var(--auth-text);
    margin-bottom: 22px;
}
.auth-google-info i { color: var(--auth-brand); }

/* ── Responsive: en móvil sólo el formulario ─────────── */
@media (max-width: 991.98px) {
    .auth-side { display: none; }
    .auth-main {
        flex: 1 1 100%;
        max-width: 100%;
    }
    /* En móvil SÍ se muestra el logo dentro del formulario */
    .auth-logo { display: block; }
}

@media (min-width: 992px) {
    .group.material-input.is-date label {
        top: -16px;
        left: 28px;
        font-size: .78rem;
        color: var(--auth-brand);
        font-weight: 600;
    }
}

@media (max-width: 575.98px) {
    .auth-main { padding: 26px 20px; }
    .auth-form { max-width: 420px; }
    .auth-logo img { height: 150px; }
    .otp-input { width: 42px; height: 52px; font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 480px) {
    .lys-sup-fab { bottom: 16px !important; right: 16px !important; width: 48px; height: 48px; }
}
