/* =====================================================================
   Raloy · Nuevos Proyectos — Pantallas de acceso (login / registro)
   Estilo: Liquid Glass. Vidrio translúcido real sobre la fotografía de
   marca: desenfoque + saturación en la capa de fondo, refracción en los
   bordes, reflejo especular y luz que sigue al cursor.
   ===================================================================== */

/* =================== TOKENS =================== */
:root {
    /* Marca (tomados del logo/fondo Raloy) */
    --brand:        #f5a524;
    --brand-soft:   #ffc85c;
    --brand-deep:   #c07d15;
    --brand-ink:    #1b1204;

    /* Base */
    --bg-base: #070a10;

    /* Vidrio */
    --glass-tint:        rgba(12, 17, 26, .36);   /* tinte de la lámina principal */
    --glass-tint-strong: rgba(10, 14, 22, .5);
    /* Desenfoque contenido: si el cristal difumina demasiado, la refracción
       del canto deja de leerse porque ya no hay nada nítido que doblar. */
    --glass-blur:        14px;
    --glass-saturate:    1.9;
    --glass-stroke:      rgba(255, 255, 255, .3);
    --glass-stroke-dim:  rgba(255, 255, 255, .18);

    /* Superficies de control (campos, interruptores) */
    --control:        rgba(255, 255, 255, .12);
    --control-hover:  rgba(255, 255, 255, .17);

    /* Texto */
    --text:        #f4f7fb;
    --text-muted:  #c3ccd9;
    --text-faint:  #97a3b4;

    /* Estados */
    --danger:     #ff8a8a;
    --success:    #5fe0a0;
    --warning:    #ffc85c;

    /* Forma y movimiento */
    --radius:     18px;
    --radius-lg:  32px;
    --ease:       cubic-bezier(.4, 0, .2, 1);
    --spring:     cubic-bezier(.34, 1.56, .64, 1);
    --t-fast:     .2s var(--ease);
    --t:          .35s var(--ease);

    /* Reflejo especular: el brillo interior que define el canto del vidrio */
    --specular:
        inset 0 1px 0 rgba(255, 255, 255, .5),
        inset 1px 0 0 rgba(255, 255, 255, .16),
        inset -1px 0 0 rgba(255, 255, 255, .16),
        inset 0 -1px 0 rgba(255, 255, 255, .1);

    --shadow-card: 0 32px 70px -18px rgba(0, 0, 0, .75), 0 10px 26px -12px rgba(0, 0, 0, .6);
    --ring:        0 0 0 3.5px rgba(245, 165, 36, .3);
}

/* =================== BASE =================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    min-height: 100dvh;
    padding: clamp(1rem, 4vh, 3rem) 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--bg-base);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--brand-soft); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand); }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 8px;
}

/* Contenedor de los filtros SVG de refracción */
.glass-filters { position: absolute; width: 0; height: 0; overflow: hidden; }

/* =================== FONDO =================== */
.background-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--bg-base);
}

/* La foto se mantiene reconocible: el vidrio necesita algo que refractar.
   Sólo se atenúa y se desatura lo justo para no competir con el texto. */
.background-layer::before {
    content: '';
    position: absolute;
    inset: -3%;
    background-image: var(--bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(.62) saturate(1.05);
}

/* Viñeta + brillo cálido central */
.bg-image-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(65% 55% at 50% 42%, rgba(245, 165, 36, .16), transparent 72%),
        radial-gradient(115% 100% at 50% 50%, transparent 20%, rgba(3, 5, 9, .82) 100%);
}

/* Motas de luz que atraviesan la escena */
.bg-particles { position: absolute; inset: 0; overflow: hidden; }

.particle {
    position: absolute;
    bottom: -40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 214, 140, .75) 0%, rgba(245, 165, 36, 0) 70%);
    opacity: 0;
    animation: rise linear infinite;
    will-change: transform, opacity;
}
.particle:nth-child(1) { width: 5px;  height: 5px;  left: 8%;  animation-duration: 26s; animation-delay: -2s;  }
.particle:nth-child(2) { width: 3px;  height: 3px;  left: 19%; animation-duration: 34s; animation-delay: -14s; }
.particle:nth-child(3) { width: 6px;  height: 6px;  left: 31%; animation-duration: 30s; animation-delay: -8s;  }
.particle:nth-child(4) { width: 4px;  height: 4px;  left: 43%; animation-duration: 38s; animation-delay: -21s; }
.particle:nth-child(5) { width: 3px;  height: 3px;  left: 56%; animation-duration: 28s; animation-delay: -5s;  }
.particle:nth-child(6) { width: 7px;  height: 7px;  left: 67%; animation-duration: 42s; animation-delay: -30s; }
.particle:nth-child(7) { width: 4px;  height: 4px;  left: 78%; animation-duration: 32s; animation-delay: -11s; }
.particle:nth-child(8) { width: 5px;  height: 5px;  left: 91%; animation-duration: 36s; animation-delay: -24s; }

@keyframes rise {
    0%   { transform: translateY(0)       scale(.6); opacity: 0; }
    12%  { opacity: .9; }
    85%  { opacity: .5; }
    100% { transform: translateY(-105dvh) scale(1);  opacity: 0; }
}

/* Halos de color que dan qué refractar al vidrio */
.floating-elements { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .65;
    animation: drift 34s ease-in-out infinite;
    will-change: transform;
}
.shape-1 { width: 460px; height: 460px; top: -14%;   left: -12%;  background: rgba(245, 165, 36, .3); }
.shape-2 { width: 380px; height: 380px; bottom: -16%; right: -10%; background: rgba(255, 200, 92, .22); animation-delay: -9s;  animation-direction: reverse; }
.shape-3 { width: 320px; height: 320px; top: 52%;    left: 6%;    background: rgba(70, 130, 220, .2);  animation-delay: -17s; }
.shape-4 { width: 280px; height: 280px; top: 4%;     right: 10%;  background: rgba(245, 120, 36, .18); animation-delay: -25s; animation-direction: reverse; }

@keyframes drift {
    0%, 100% { transform: translate3d(0, 0, 0)        scale(1); }
    50%      { transform: translate3d(26px, -34px, 0) scale(1.14); }
}

/* =====================================================================
   LÁMINA DE VIDRIO
   Cuatro capas apiladas: refracción del canto, desenfoque + tinte,
   reflejo especular del borde y luz especular móvil.
   ===================================================================== */
/* Sin animación ni transform aquí a propósito: un ancestro transformado (o con
   opacity < 1) convierte el backdrop de sus descendientes en el propio ancestro
   y anula el desenfoque del vidrio. La entrada se anima capa por capa. */
.login-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    z-index: 10;
}

/* Lámina principal: desenfoque + saturación del fondo, tinte y canto biselado.
   El bisel (box-shadow interior) es lo que da grosor al vidrio: luz arriba,
   sombra abajo, como el borde de una lente. */
.glass-background {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, rgba(255, 255, 255, .1) 0%, var(--glass-tint) 45%, var(--glass-tint-strong) 100%);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    /* Canto grueso: luz concentrada en el filo superior, sombra en el inferior
       y un halo interior que separa el cristal del contenido. */
    box-shadow:
        var(--shadow-card),
        var(--specular),
        inset 0 20px 30px -22px rgba(255, 255, 255, .8),
        inset 0 -22px 36px -24px rgba(0, 0, 0, .85),
        inset 14px 0 30px -26px rgba(255, 255, 255, .45),
        inset -14px 0 30px -26px rgba(255, 255, 255, .45);
    animation: glass-in .8s var(--spring) both;
}

/* Refracción del canto. Va en su propia regla porque un navegador que no
   entienda url() en backdrop-filter invalidaría la declaración entera y se
   quedaría sin cristal. */
@supports (backdrop-filter: url(#lens-card)) or (-webkit-backdrop-filter: url(#lens-card)) {
    .glass-background {
        backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) url(#lens-card);
        -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) url(#lens-card);
    }
}

/* Anillo interior: concentra la luz en el canto y la difumina hacia dentro.
   Es la lectura de “vidrio grueso” frente al plano translúcido de siempre. */
.glass-background::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(255, 255, 255, .3), transparent 55%),
        radial-gradient(100% 70% at 50% 110%, rgba(255, 255, 255, .1), transparent 60%);
    -webkit-mask: radial-gradient(115% 115% at 50% 50%, transparent 55%, #000 88%);
            mask: radial-gradient(115% 115% at 50% 50%, transparent 55%, #000 88%);
}

/* Filo especular de 1px: brillante en el arco superior, tenue en los costados */
.glass-background::after {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(160deg,
        rgba(255, 255, 255, .8) 0%,
        rgba(255, 255, 255, .16) 26%,
        rgba(255, 255, 255, .05) 55%,
        rgba(255, 255, 255, .34) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
}

/* Luz especular que sigue al puntero sobre la lámina */
.login-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: var(--radius-lg);
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%),
                rgba(255, 255, 255, .18), transparent 70%);
    transition: opacity var(--t);
}
.login-container:hover::before { opacity: 1; }

/* Destello superior fijo: el “reflejo del cielo” en el canto de la lente */
.neomorphic-border {
    position: absolute;
    top: 0; left: 8%;
    width: 84%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
    z-index: 4;
    pointer-events: none;
}

.container-content {
    position: relative;
    z-index: 2;
    padding: 2.75rem 2.25rem 2.25rem;
    animation: content-in .5s .18s var(--ease) both;
}

/* La lámina entra con cuerpo; el contenido sólo se funde, para no transformar
   a los campos (que llevan su propio backdrop-filter). */
@keyframes glass-in {
    from { opacity: 0; transform: translateY(28px) scale(.93); }
    to   { opacity: 1; transform: none; }
}
@keyframes content-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* =================== ENCABEZADO =================== */
.logo-section {
    text-align: center;
    margin-bottom: 1.9rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    margin-bottom: .55rem;
}

/* Pastilla de vidrio ámbar */
.logo-icon {
    flex: none;
    width: 48px; height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(150deg, rgba(255, 200, 92, .38), rgba(245, 165, 36, .12));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .55),
        inset 0 -1px 0 rgba(255, 255, 255, .12),
        0 8px 20px -6px rgba(245, 165, 36, .45);
}
.logo-icon i {
    font-size: 21px;
    color: #ffd58a;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .4));
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    text-align: left;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}
.logo-text small {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--brand-soft);
    margin-top: 2px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
}

.logo-subtitle {
    font-size: .875rem;
    color: var(--text-muted);
    text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}

.form-title {
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
    text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}

/* =================== CAMPOS =================== */
.form-container { position: relative; }

.field { position: relative; margin-bottom: 1.3rem; }

/* Etiqueta sobre el campo: con vidrio translúcido, una etiqueta encajada
   en el borde exigiría un fondo opaco que rompería la transparencia. */
.field > label,
.floating-label,
.form-label {
    display: block;
    margin: 0 0 .45rem 4px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--text-muted);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
    transition: color var(--t-fast);
}

.field-control { position: relative; display: flex; }

.field-icon,
.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 18px;
    display: grid;
    place-items: center;
    font-size: 15px;
    color: var(--text-faint);
    transition: color var(--t-fast);
    pointer-events: none;
}

/* Cada campo es su propia lámina de vidrio */
.field-input,
.enhanced-input,
.form-control {
    width: 100%;
    padding: 15px 16px 15px 50px;
    font: inherit;
    font-size: .95rem;
    color: var(--text);
    background: var(--control);
    /* Desenfoque alto en los campos: convierte lo que pasa por detrás en un
       lavado uniforme para que el texto escrito siempre se lea. */
    backdrop-filter: blur(22px) saturate(1.5);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    border: 1px solid var(--glass-stroke-dim);
    border-radius: var(--radius);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 10px rgba(0, 0, 0, .18);
    transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.field-input::placeholder,
.form-control::placeholder { color: var(--text-faint); }

.field-input:hover,
.form-control:hover {
    background: var(--control-hover);
    border-color: var(--glass-stroke);
}

.field-input:focus,
.form-control:focus {
    background: var(--control-hover);
    border-color: rgba(245, 165, 36, .75);
    box-shadow: var(--ring), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.field-control:focus-within .field-icon,
.field-control:focus-within .input-icon { color: var(--brand-soft); }
.field:focus-within > label { color: var(--brand-soft); }

/* Autocompletado de Chrome: conserva el aspecto de vidrio */
.field-input:-webkit-autofill,
.form-control:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px rgba(30, 38, 52, .92) inset;
    caret-color: var(--text);
}

.field-control:has(.password-toggle) .field-input,
.field-control:has(.password-toggle) .form-control { padding-right: 50px; }

.password-toggle {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 36px; height: 36px;
    display: grid;
    place-items: center;
    color: var(--text-faint);
    background: none;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: color var(--t-fast), background var(--t-fast);
}
.password-toggle:hover { color: var(--brand-soft); background: rgba(255, 255, 255, .12); }

/* Validación */
.field.is-invalid .field-input,
.field.is-invalid .form-control { border-color: rgba(255, 138, 138, .8); }
.field.is-invalid > label { color: var(--danger); }
.field.is-valid .field-input,
.field.is-valid .form-control { border-color: rgba(95, 224, 160, .6); }

.field-help,
.invalid-feedback {
    display: block;
    margin: .45rem 2px 0;
    font-size: .78rem;
    line-height: 1.4;
    color: var(--danger);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}
.field-hint { color: var(--text-faint); }

.caps-warning {
    display: none;
    align-items: center;
    gap: .4rem;
    margin: .45rem 2px 0;
    font-size: .78rem;
    color: var(--warning);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}
.caps-warning.visible { display: flex; }

/* Medidor de contraseña */
.pw-meter { margin-top: .6rem; }
.pw-meter-track {
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .12);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
    overflow: hidden;
}
.pw-meter-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: var(--danger);
    box-shadow: 0 0 12px currentColor;
    transition: width var(--t), background var(--t);
}
.pw-meter-label {
    display: block;
    margin-top: .4rem;
    font-size: .74rem;
    color: var(--text-faint);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}
.pw-meter[data-level="1"] .pw-meter-fill { width: 25%;  background: #ff8a8a; }
.pw-meter[data-level="2"] .pw-meter-fill { width: 50%;  background: #ffab5e; }
.pw-meter[data-level="3"] .pw-meter-fill { width: 75%;  background: var(--brand-soft); }
.pw-meter[data-level="4"] .pw-meter-fill { width: 100%; background: var(--success); }

/* =================== FILA DE OPCIONES =================== */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.5rem;
    font-size: .85rem;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}
.checkbox input {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 20px; height: 20px;
    margin: 0;
    background: var(--control);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-stroke);
    border-radius: 7px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.checkbox input:checked {
    background: linear-gradient(150deg, var(--brand-soft), var(--brand));
    border-color: rgba(255, 255, 255, .35);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231b1204' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E"),
        linear-gradient(150deg, var(--brand-soft), var(--brand));
    background-size: 15px, auto;
    background-repeat: no-repeat;
    background-position: center;
}
.checkbox:hover input { border-color: rgba(255, 255, 255, .4); }

/* =================== BOTONES =================== */
.btn {
    position: relative;
    width: 100%;
    padding: 16px 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--brand-ink);
    background: linear-gradient(150deg, rgba(255, 214, 140, .95) 0%, rgba(245, 165, 36, .92) 100%);
    backdrop-filter: blur(14px) saturate(1.6);
    -webkit-backdrop-filter: blur(14px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .7),
        inset 0 -2px 6px rgba(180, 100, 10, .35),
        0 12px 28px -10px rgba(245, 165, 36, .7);
    transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
}

/* Reflejo especular sobre la mitad superior del botón */
.btn::before {
    content: '';
    position: absolute;
    inset: 1px 1px 45% 1px;
    border-radius: 999px 999px 60% 60% / 999px 999px 100% 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .8),
        inset 0 -2px 6px rgba(180, 100, 10, .35),
        0 18px 34px -12px rgba(245, 165, 36, .8);
}
.btn:active { transform: translateY(0) scale(.99); }
.btn:disabled { opacity: .7; cursor: not-allowed; transform: none; filter: none; }

.field + .btn, .p-2 + .btn { margin-top: .4rem; }

.btn i { font-size: .9em; transition: transform var(--t-fast); }
.btn:hover:not(:disabled) i.fa-arrow-right { transform: translateX(3px); }

.btn-dark, .btn-block, .w-100 { width: 100%; }

.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn-label,
.btn.is-loading i { visibility: hidden; }
.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 19px; height: 19px;
    border: 2px solid rgba(27, 18, 4, .3);
    border-top-color: var(--brand-ink);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =================== PIE =================== */
.form-footer {
    margin-top: 1.6rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
    text-align: center;
    font-size: .875rem;
    color: var(--text-muted);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}
.form-footer a { font-weight: 600; }
.register { text-align: center; font-size: .875rem; color: var(--text-muted); }

/* =================== ALERTAS =================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: 13px 16px;
    margin-bottom: 1.4rem;
    font-size: .875rem;
    line-height: 1.45;
    border: 1px solid transparent;
    border-radius: var(--radius);
    backdrop-filter: blur(10px) saturate(1.4);
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
    animation: alert-in .35s var(--ease) both;
}
.alert i { margin-top: .15rem; flex: none; }
.alert-danger {
    color: #ffdede;
    background: rgba(255, 90, 90, .2);
    border-color: rgba(255, 138, 138, .38);
}
.alert-danger i { color: var(--danger); }

@keyframes alert-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}

/* =================== AJUSTES =================== */
.settings-icon {
    position: fixed;
    top: 22px; right: 22px;
    z-index: 1000;
    width: 46px; height: 46px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .85);
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(18px) saturate(1.7);
    -webkit-backdrop-filter: blur(18px) saturate(1.7);
    border: 1px solid var(--glass-stroke-dim);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--specular), 0 8px 22px -8px rgba(0, 0, 0, .6);
    transition: transform var(--t), color var(--t-fast), background var(--t-fast);
}
.settings-icon i { font-size: 17px; }
.settings-icon:hover {
    color: var(--brand-soft);
    background: rgba(255, 255, 255, .16);
    transform: rotate(60deg);
}

.settings-panel {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 1001;
    width: min(320px, 88vw);
    padding: 1.75rem;
    background: linear-gradient(160deg, rgba(255, 255, 255, .1), var(--glass-tint-strong));
    backdrop-filter: blur(36px) saturate(1.8);
    -webkit-backdrop-filter: blur(36px) saturate(1.8);
    border-left: 1px solid var(--glass-stroke-dim);
    box-shadow: -24px 0 60px rgba(0, 0, 0, .55), inset 1px 0 0 rgba(255, 255, 255, .28);
    animation: panel-in .35s var(--ease) both;
}
@keyframes panel-in {
    from { transform: translateX(100%); }
    to   { transform: none; }
}

.settings-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 0;
    font-size: .875rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}

.toggle-switch {
    position: relative;
    flex: none;
    width: 46px; height: 27px;
    padding: 0;
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-stroke-dim);
    border-radius: 99px;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3);
    transition: background var(--t-fast), border-color var(--t-fast);
}
.toggle-slider {
    position: absolute;
    top: 2px; left: 2px;
    width: 21px; height: 21px;
    background: linear-gradient(160deg, #fff, #dfe5ec);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
    transition: transform var(--t) var(--spring);
}
.toggle-switch[aria-checked="true"] {
    background: linear-gradient(150deg, var(--brand-soft), var(--brand));
    border-color: rgba(255, 255, 255, .35);
}
.toggle-switch[aria-checked="true"] .toggle-slider { transform: translateX(19px); }

.close-settings {
    width: 100%;
    margin-top: 1.75rem;
    padding: 12px;
    font: inherit;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-stroke-dim);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
    transition: background var(--t-fast);
}
.close-settings:hover { background: rgba(255, 255, 255, .18); }

/* =================== DECORATIVOS =================== */
.decorative-dots {
    position: absolute;
    bottom: 16px; right: 22px;
    display: flex;
    gap: 6px;
    z-index: 3;
}
.dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255, 214, 140, .6);
    box-shadow: 0 0 8px rgba(245, 165, 36, .5);
    animation: blink 2.4s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: .35s; }
.dot:nth-child(3) { animation-delay: .7s; }
@keyframes blink {
    0%, 100% { opacity: .25; }
    50%      { opacity: 1; }
}

/* =================== UTILIDADES HEREDADAS =================== */
.text-center { text-align: center; }
.text-white  { color: var(--text) !important; }
.text-info   { color: var(--brand-soft) !important; font-weight: 600; }
.text-info:hover { color: var(--brand) !important; }
.d-block { display: block; }
.mb-4 { margin-bottom: 1.5rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.p-2  { position: relative; margin-bottom: 1.3rem; }

h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* =================== VIDRIO OSCURO =================== */
/* Sube el tinte y baja la transparencia: mismo material, más denso. */
.dark-mode {
    --glass-tint:        rgba(6, 10, 16, .58);
    --glass-tint-strong: rgba(4, 7, 12, .72);
    --glass-blur:        40px;
    --control:           rgba(255, 255, 255, .06);
    --control-hover:     rgba(255, 255, 255, .1);
    --text-muted:        #aeb9c7;
}
.dark-mode .background-layer::before { filter: brightness(.34) saturate(.85); }
.dark-mode .floating-shape { opacity: .4; }

/* =================== MOVIMIENTO REDUCIDO =================== */
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
}
.reduced-motion .bg-particles,
.reduced-motion .floating-elements { display: none; }
.reduced-motion .login-container::before { display: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .bg-particles, .floating-elements, .login-container::before { display: none; }
}

/* =================== RESPONSIVE =================== */
@media (max-width: 560px) {
    /* espacio arriba para que el engranaje no se monte sobre la tarjeta */
    body { padding: 4.25rem .85rem 1.25rem; align-items: flex-start; }
    .login-container { max-width: 100%; }
    .container-content { padding: 2.25rem 1.4rem 1.75rem; }
    .logo-text { font-size: 1.15rem; }
    .settings-icon { top: 14px; right: 14px; width: 42px; height: 42px; }
    .floating-shape { filter: blur(60px); opacity: .5; }
    .decorative-dots { display: none; }
    :root { --glass-blur: 26px; --radius-lg: 28px; }
}

@media (max-width: 380px) {
    .container-content { padding: 1.9rem 1.1rem 1.5rem; }
    .field-input, .form-control { padding: 14px 14px 14px 46px; font-size: .9rem; }
    .field-icon, .input-icon { left: 16px; }
    .form-options { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

@media (max-height: 720px) {
    body { align-items: flex-start; }
}

/* =================== SIN SOPORTE DE VIDRIO =================== */
/* Navegadores sin backdrop-filter: se sustituye por una lámina opaca. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass-background { background: rgba(18, 24, 34, .95); }
    .settings-panel   { background: rgba(18, 24, 34, .97); }
    .field-input, .form-control { background: rgba(255, 255, 255, .12); }
    .background-layer::before { filter: brightness(.4) saturate(.9) blur(4px); }
}

/* =================== ALTO CONTRASTE =================== */
@media (prefers-contrast: more) {
    :root {
        --glass-tint: rgba(8, 12, 19, .72);
        --glass-tint-strong: rgba(6, 9, 15, .82);
        --control: rgba(255, 255, 255, .16);
        --glass-stroke-dim: rgba(255, 255, 255, .3);
        --text-muted: #dde3ea;
        --text-faint: #bcc5d1;
    }
    .field-input, .form-control { border-width: 2px; }
}

/* =================== IMPRESIÓN =================== */
@media print {
    .background-layer,
    .bg-particles,
    .floating-elements,
    .settings-icon,
    .decorative-dots { display: none !important; }
    body { background: #fff; color: #000; }
    .glass-background { background: #fff; border: 1px solid #ccc; backdrop-filter: none; box-shadow: none; }
    .logo-text, .logo-subtitle, .form-footer { color: #000; text-shadow: none; }
}
