/* Nota de Transparencia: Código generado/refactorizado con asistencia de IA Generativa (Claude Code) bajo la Política ODTI012 del CCS. Requiere supervisión y validación humana permanente. */

@font-face {
    font-family: 'Lexend';
    src: url('../fuentes/Lexend-VariableFont_wght.ttf');
    font-display: swap;
}

:root {
    --azul-noche: #0b1e3a;
    --azul-oscuro: #010f53;
    --azul-claro: #00539b;
    --azul-brillo: #1a7fd6;
    --verde: #8dc63f;
    --texto: #1c2434;
    --texto-suave: #667085;
    --borde: #dfe3ea;
    --fondo-input: #f7f9fc;
    --blanco: #fff;
    --error: #d92d20;
    --radio: 14px;
    --fuente: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html,
body {
    height: 100%;
}

body {
    font-family: var(--fuente);
    color: var(--texto);
    background: var(--blanco);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ------------------------ LAYOUT ------------------------ */

.login {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ------------------------ PANEL MARCA ------------------------ */

.marca {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: var(--blanco);
    background: linear-gradient(145deg, var(--azul-noche) 0%, var(--azul-oscuro) 45%, var(--azul-claro) 100%);
    isolation: isolate;
}

/* cuadricula sutil */
.marca::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}

.burbuja {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    animation: flotar 14s ease-in-out infinite alternate;
}

.burbuja--1 {
    width: 380px;
    height: 380px;
    background: var(--azul-brillo);
    top: -120px;
    right: -80px;
}

.burbuja--2 {
    width: 300px;
    height: 300px;
    background: var(--verde);
    bottom: -110px;
    left: -60px;
    opacity: .35;
    animation-delay: -6s;
}

@keyframes flotar {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(40px, 30px) scale(1.12); }
}

.marca__logo {
    height: 46px;
    width: auto;
    align-self: flex-start;
}

.marca__contenido {
    max-width: 480px;
}

.marca__etiqueta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-bottom: 22px;
    font-size: .8rem;
    letter-spacing: .04em;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(6px);
}

.marca__etiqueta span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--verde);
    box-shadow: 0 0 0 4px rgba(141, 198, 63, .25);
}

.marca h2 {
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    font-weight: 600;
    line-height: 1.12;
    margin-bottom: 16px;
}

.marca h2 em {
    font-style: normal;
    color: var(--verde);
}

.marca p {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(255, 255, 255, .78);
}

.marca__lista {
    list-style: none;
    margin-top: 32px;
    display: grid;
    gap: 14px;
}

.marca__lista li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .95rem;
    color: rgba(255, 255, 255, .9);
}

.marca__lista ion-icon {
    flex: none;
    font-size: 1.15rem;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    color: var(--verde);
}

.marca__pie {
    font-size: .8rem;
    color: rgba(255, 255, 255, .55);
}

/* ------------------------ PANEL FORMULARIO ------------------------ */

.acceso {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background:
        radial-gradient(circle at 100% 0%, rgba(0, 83, 155, .07), transparent 40%),
        var(--blanco);
}

.acceso__top {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-fantasma {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font: inherit;
    font-size: .85rem;
    color: var(--texto-suave);
    background: transparent;
    border: 1px solid var(--borde);
    border-radius: 999px;
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
}

.btn-fantasma:hover {
    color: var(--azul-claro);
    border-color: var(--azul-claro);
    background: rgba(0, 83, 155, .05);
}

.btn-fantasma ion-icon {
    font-size: 1.05rem;
}

.tarjeta {
    width: 100%;
    max-width: 400px;
    animation: entrar .6s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes entrar {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

.tarjeta__logo {
    display: none;
    height: 40px;
    margin-bottom: 28px;
}

.tarjeta h1 {
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: -.01em;
    margin-bottom: 6px;
}

.tarjeta__sub {
    color: var(--texto-suave);
    font-size: .95rem;
    font-weight: 300;
    margin-bottom: 32px;
}

.campo {
    margin-bottom: 20px;
}

.campo label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.campo__control {
    position: relative;
    display: flex;
    align-items: center;
}

.campo__icono {
    position: absolute;
    left: 14px;
    font-size: 1.15rem;
    color: #98a2b3;
    pointer-events: none;
    transition: color .2s;
}

.campo input {
    width: 100%;
    height: 50px;
    padding: 0 48px 0 44px;
    font: inherit;
    font-size: .95rem;
    color: var(--texto);
    background: var(--fondo-input);
    border: 1.5px solid var(--borde);
    border-radius: var(--radio);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.campo input::placeholder {
    color: #a6adbb;
    font-weight: 300;
}

.campo input:hover {
    border-color: #c4cbd6;
}

.campo input:focus {
    background: var(--blanco);
    border-color: var(--azul-claro);
    box-shadow: 0 0 0 4px rgba(0, 83, 155, .12);
}

.campo__control:focus-within .campo__icono {
    color: var(--azul-claro);
}

.campo--error input {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(217, 45, 32, .1);
}

#toggle-password {
    position: absolute;
    right: 6px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
    color: #98a2b3;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: color .2s, background .2s;
}

#toggle-password:hover {
    color: var(--azul-claro);
    background: rgba(0, 83, 155, .07);
}

.aviso-mayus {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: .8rem;
    color: #b54708;
}

.aviso-mayus.visible {
    display: flex;
}

.btn-entrar {
    position: relative;
    width: 100%;
    height: 52px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--blanco);
    background: linear-gradient(135deg, var(--azul-claro), var(--azul-oscuro));
    border: 0;
    border-radius: var(--radio);
    cursor: pointer;
    box-shadow: 0 10px 24px -10px rgba(1, 15, 83, .6);
    transition: transform .15s, box-shadow .2s, filter .2s;
}

.btn-entrar:hover {
    filter: brightness(1.08);
    box-shadow: 0 14px 28px -10px rgba(1, 15, 83, .7);
}

.btn-entrar:active {
    transform: translateY(1px);
}

.btn-entrar ion-icon {
    font-size: 1.2rem;
    transition: transform .2s;
}

.btn-entrar:hover ion-icon {
    transform: translateX(3px);
}

.btn-entrar:disabled {
    cursor: progress;
    filter: saturate(.7);
}

.btn-entrar .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: var(--blanco);
    border-radius: 50%;
    animation: girar .7s linear infinite;
}

.btn-entrar.cargando .spinner {
    display: block;
}

.btn-entrar.cargando .btn-entrar__texto,
.btn-entrar.cargando ion-icon {
    display: none;
}

@keyframes girar {
    to { transform: rotate(360deg); }
}

.tarjeta__ayuda {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--borde);
    text-align: center;
    font-size: .88rem;
    color: var(--texto-suave);
}

.tarjeta__ayuda button {
    font: inherit;
    color: var(--azul-claro);
    font-weight: 500;
    background: none;
    border: 0;
    cursor: pointer;
}

.tarjeta__ayuda button:hover {
    text-decoration: underline;
}

.acceso__pie {
    position: absolute;
    bottom: 20px;
    left: 24px;
    right: 24px;
    text-align: center;
    font-size: .75rem;
    color: #98a2b3;
}

.acceso__pie a:hover {
    color: var(--azul-claro);
}

.sacudir {
    animation: sacudir .4s;
}

@keyframes sacudir {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ------------------------ RESPONSIVE ------------------------ */

@media (max-width: 960px) {
    .login {
        grid-template-columns: 1fr;
    }

    .marca {
        display: none;
    }

    .tarjeta__logo {
        display: block;
    }

    .acceso {
        min-height: 100vh;
        padding: 96px 16px 72px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
