:root {
    --bg-1: #0b1020;
    --bg-2: #122138;
    --acc-1: #1e4f96;
    --txt-1: #e7ecf7;
    --txt-2: #a9b3c7;
    --err: #ff6b6b;
    --ok: #00d7c0;
    --card: #0e1630;
    --border: #1b2a4d;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--txt-1);
    background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
    overflow: auto;
    font-size: 17px;
}

/* Layout 70/30 */
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 70% 30%;
}

/* Panel imagen */
.panel-hero {
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: url("../img/login/inicio.png") center/cover no-repeat;
    filter: saturate(1.05) contrast(1.05);
}

.panel-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 16, 32, .35), rgba(11, 16, 32, .55));
}

/* Panel login */
.panel-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* ← centra verticalmente */
    gap: 20px;
    padding: 60px 28px;
    /* un poco más de aire */
    background:
        radial-gradient(800px 400px at 10% 10%, rgba(30, 79, 150, .20), transparent 60%),
        linear-gradient(160deg, rgba(18, 33, 56, .6), rgba(11, 16, 32, .9));
}


/* Logo centrado (más arriba del card) */
.form-logo-center {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 6px;
    /* cerca del borde superior */
    margin-bottom: 18px;
    /* separación con el card */
}

.form-logo {
    width: 240px;
    background: #fff;
    border-radius: 24px;
    padding: 20px 28px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 0 20px rgba(30, 79, 150, .3);
    border: 1px solid rgba(80, 120, 180, .25);
    animation: floatIn .6s ease-out both;
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(.58);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card (más estirado pero dentro del 30%) */
.form-card {
    flex: none;
    width: 92%;
    max-width: 560px;
    min-height: 580px;
    background: linear-gradient(180deg, rgba(14, 22, 48, .88), rgba(14, 22, 48, .8));
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 36px 48px;
    backdrop-filter: blur(8px);
}

/* Mensajes y títulos */
.greeting {
    font-size: 16px;
    color: var(--ok);
    margin-bottom: 8px;
}

.form-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 22px 0;
}

/* Alert */
.alert-error {
    width: 100%;
    background: rgba(255, 107, 107, .1);
    border: 1px solid rgba(255, 107, 107, .4);
    color: #ffc6c6;
    padding: 12px 14px;
    border-radius: 12px;
    margin: 8px 0 16px 0;
}

/* Toggle Cliente/Trabajador */
.role-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}

.role-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-toggle label {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #1f2e53;
    background: #0b142e;
    color: #bcd0ff;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.role-toggle input#tipo-cliente:checked+label,
.role-toggle input#tipo-trabajador:checked+label {
    background: linear-gradient(180deg, #1f3f85, #1a356f);
    color: #fff;
    border-color: #2a4ea0;
    box-shadow: 0 6px 18px rgba(4, 12, 28, .35);
}

/* Estructura para que funcione el “+ label” */
.role-toggle label[for="tipo-trabajador"] {
    order: 2;
}

.role-toggle #tipo-trabajador {
    order: 1;
}

.role-toggle label[for="tipo-cliente"] {
    order: 0;
}

.role-toggle #tipo-cliente {
    order: -1;
}

/* Campos */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field span {
    font-size: 14px;
    color: var(--txt-2);
}

.field input {
    width: 100%;
    font-size: 15px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0b142e;
    color: var(--txt-1);
}

.field input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);
}

/* Contraseña + ojo */
/* Contraseña + ojo (glow en el CONTENEDOR) */
.password-wrap {
    display: flex;
    align-items: center;
    background: #0b142e;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: border-color .2s ease, box-shadow .2s ease;
}

/* Aquí ponemos el glow completo (como en el input de usuario) */
.password-wrap:focus-within {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);

}

/* El input interno ya NO hace glow (lo hace el contenedor) */
.password-wrap input {
    border: none;
    background: transparent;
    padding: 14px 16px;
    flex: 1;
    color: var(--txt-1);
    outline: none;
    font-size: 15px;
    box-shadow: none !important;
    /* <— clave */
}

/* Botón del ojo con divisor sutil para que no “corte” el borde */
.eye-btn {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-left: 1px solid rgba(80, 120, 180, .25);
    transition: background .2s ease;
}

.eye-btn:hover {
    background: rgba(255, 255, 255, .05);
}

.eye-icon {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25));
}

.eye-outline {
    fill: none;
    stroke: #9fb9ff;
    stroke-width: 1.6;
}

.eye-pupil {
    fill: #9fb9ff;
    transition: transform .22s ease, fill .22s ease;
    transform-origin: center;
}

.eye-btn.active .eye-pupil {
    transform: scale(.6) translateY(1px);
    fill: #cfe0ff;
}

/* Excepción: dentro de .password-wrap NO queremos glow del input */
.password-wrap input:focus {
    box-shadow: none !important;
    border-color: transparent !important;
}

/* Botón principal */
.btn-primary {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    border-radius: 14px;
    border: 1px solid #1f3a73;
    background: linear-gradient(180deg, #1f3f85, #1a356f);
    color: white;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(4, 12, 28, .4);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary .btn-glow {
    position: absolute;
    inset: -1px;
    border-radius: 14px;
    pointer-events: none;
    background: radial-gradient(300px 80px at 50% 0%, rgba(207, 227, 255, .25), transparent 70%);
}

/* Links / footer */
.meta-links {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
}

.meta-links .sep {
    opacity: .6;
    margin: 0 8px;
}

.meta-links a {
    color: #b8cbff;
    text-decoration: none;
}

.meta-links a:hover {
    text-decoration: underline;
}

.legal {
    margin-top: 18px;
    font-size: 12px;
    color: var(--txt-2);
    text-align: center;
}

/* ==== Animación del saludo dinámico ==== */
.saludo-animado {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.6px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2), 0 0 20px currentColor;
    animation: brilloSaludo 2.5s ease-in-out infinite alternate;
}

/* Parpadeo suave tipo glow */
@keyframes brilloSaludo {
    0% {
        opacity: 0.8;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }

    100% {
        opacity: 1;
        text-shadow: 0 0 18px currentColor;
        transform: scale(1.03);
    }
}


/* Responsivo */
@media (max-width:1400px) {
    .form-card {
        width: 94%;
        max-width: 540px;
        min-height: 560px;
        padding: 52px 44px;
    }
}

/* ====== Responsive: móvil / tablets ====== */
/* Fondo a pantalla completa + login centrado encima */
@media (max-width: 1260px) {

    /* 1) La grid deja de ser split; el panel de imagen se vuelve fondo fijo */
    .login-shell {
        display: block;
        /* sin columnas */
        min-height: 100vh;
    }

    .panel-hero {
        position: fixed;
        inset: 0;
        /* ocupa toda la pantalla */
        z-index: -1;
        /* queda detrás del login */
    }

    .panel-hero::after {
        /* oscurecemos un poco más para legibilidad del card */
        background:
            linear-gradient(180deg, rgba(11, 16, 32, .35), rgba(11, 16, 32, .55)),
            radial-gradient(70% 60% at 50% 30%, rgba(0, 0, 0, .25), transparent 70%);
    }

    /* 2) El panel del login se centra vertical y horizontalmente */
    .panel-form {
        position: relative;
        z-index: 1;
        min-height: 100vh;
        /* ocupa alto completo para centrar */
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* centrado vertical */
        align-items: center;
        /* centrado horizontal */
        padding: 24px;
        /* margen alrededor */
        background: transparent;
        /* SIN degradado en móvil, ya está el fondo */
        gap: 16px;
    }

    /* 3) Logo: un poco más cerca del card */
    .form-logo-center {
        margin-top: 0;
        margin-bottom: 14px;
    }

    .form-logo {
        width: 220px;
    }

    /* 4) Card: ancho fluido pero con tope; sensación “fija” sin romper */
    .form-card {
        width: min(520px, 92%);
        min-height: 560px;
        padding: 52px 44px;
        background: linear-gradient(180deg, rgba(14, 22, 48, .90), rgba(14, 22, 48, .82));
        box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
        border-radius: 20px;
    }
}

/* Extra compact para móviles muy pequeños */
@media (max-width: 480px) {
    .form-logo {
        width: 200px;
    }

    .form-card {
        width: 94%;
        min-height: 520px;
        padding: 44px 32px;
    }

    .form-title {
        font-size: 26px;
    }

    .field input {
        font-size: 14px;
        padding: 12px 14px;
    }

    .btn-primary {
        padding: 12px 16px;
        font-size: 14px;
    }
}