/* =========================================================
   COLORES Y CONFIGURACIÓN GENERAL
   ========================================================= */

:root {
    --verde: #439f47;
    --verde-oscuro: #2e7d32;
    --verde-hover: #246629;
    --verde-claro: #edf7ee;

    --fondo: #f5f8f5;
    --blanco: #ffffff;

    --texto: #253429;
    --texto-suave: #68756c;
    --borde: #dce5dd;

    --error-texto: #a32727;
    --error-fondo: #fff0f0;
    --error-borde: #f1cece;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;

    min-height: 100vh;
    min-height: 100dvh;

    font-family: Arial, Helvetica, sans-serif;
    color: var(--texto);

    background:
        radial-gradient(
            circle at top left,
            #dceede 0,
            transparent 45%
        ),
        var(--fondo);
}

button,
input {
    font: inherit;
}

button,
input,
a {
    -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   CONTENEDOR Y TARJETA
   ========================================================= */

.pantalla-login {
    min-height: 100vh;
    min-height: 100dvh;

    display: grid;
    place-items: center;

    padding: 30px 18px;
}

.tarjeta-login {
    width: 100%;
    max-width: 450px;

    padding: 38px;

    background: var(--blanco);

    border: 1px solid #e3ebe4;
    border-top: 5px solid var(--verde);
    border-radius: 20px;

    box-shadow: 0 16px 45px rgba(35, 75, 42, 0.08);
}

/* =========================================================
   LOGO
   El fondo blanco permite integrar el PNG original.
   ========================================================= */

.logo-contenedor {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100px;
    margin-bottom: 26px;

    background: var(--blanco);
}

.logo {
    display: block;

    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 115px;

    object-fit: contain;
}

/* =========================================================
   TÍTULO Y DESCRIPCIÓN
   ========================================================= */

.encabezado-login {
    margin-bottom: 30px;
    text-align: center;
}

.etiqueta {
    display: inline-block;

    margin-bottom: 16px;
    padding: 8px 13px;

    color: var(--verde-oscuro);
    background: var(--verde-claro);

    border-radius: 20px;

    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
}

.encabezado-login h1 {
    margin: 0 0 12px;

    font-size: 28px;
    line-height: 1.2;
}

.descripcion {
    margin: 0;

    color: var(--texto-suave);

    font-size: 14px;
    line-height: 1.7;
}

/* =========================================================
   CAMPOS DEL FORMULARIO
   ========================================================= */

.campo {
    margin-bottom: 21px;
}

.campo label {
    display: block;
    margin-bottom: 9px;

    font-size: 14px;
    font-weight: bold;
}

.campo input {
    width: 100%;
    min-height: 51px;

    padding: 13px 14px;

    border: 1px solid var(--borde);
    border-radius: 10px;

    color: var(--texto);
    background: var(--blanco);

    font-size: 16px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.campo input::placeholder {
    color: #8a958d;
}

.campo input:focus {
    border-color: var(--verde);
    outline: none;

    box-shadow: 0 0 0 3px rgba(67, 159, 71, 0.15);
}

/* =========================================================
   CAMPO DE CONTRASEÑA
   ========================================================= */

.password-contenedor {
    position: relative;
}

.password-contenedor input {
    padding-right: 88px;
}

.mostrar-password {
    position: absolute;

    top: 4px;
    right: 4px;

    min-height: 43px;
    padding: 0 12px;

    border: none;
    border-radius: 7px;

    color: var(--verde-oscuro);
    background: transparent;

    font-size: 13px;
    font-weight: bold;

    cursor: pointer;
}

.mostrar-password:hover:not(:disabled) {
    background: var(--verde-claro);
}

.mostrar-password:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* =========================================================
   BOTÓN INGRESAR
   ========================================================= */

.boton-ingresar {
    width: 100%;
    min-height: 51px;

    margin-top: 5px;
    padding: 13px 18px;

    border: none;
    border-radius: 10px;

    color: var(--blanco);
    background: var(--verde-oscuro);

    font-size: 16px;
    font-weight: bold;

    cursor: pointer;

    transition:
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.boton-ingresar:hover:not(:disabled) {
    background: var(--verde-hover);

    box-shadow: 0 5px 14px rgba(46, 125, 50, 0.18);
}

.boton-ingresar:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

button:focus-visible {
    outline: 3px solid #8dc393;
    outline-offset: 3px;
}

/* =========================================================
   MENSAJES DEL FORMULARIO
   ========================================================= */

.mensaje-login {
    margin: 0 0 16px;
    padding: 12px 14px;

    border: 1px solid transparent;
    border-radius: 9px;

    font-size: 13px;
    line-height: 1.6;

    overflow-wrap: anywhere;
}

.mensaje-login[hidden] {
    display: none;
}

.mensaje-login.error {
    color: var(--error-texto);
    background: var(--error-fondo);
    border-color: var(--error-borde);
}

.mensaje-login.exito {
    color: var(--verde-hover);
    background: var(--verde-claro);
    border-color: #cce4ce;
}

/* =========================================================
   AYUDA Y PIE DE PÁGINA
   ========================================================= */

.ayuda {
    margin: 24px 0 0;

    color: var(--texto-suave);
    text-align: center;

    font-size: 12px;
    line-height: 1.8;
}

.pie-login {
    margin-top: 25px;
    padding-top: 20px;

    border-top: 1px solid #edf1ed;

    color: var(--texto-suave);
    text-align: center;

    font-size: 11px;
    line-height: 1.5;
}

/* =========================================================
   ADAPTACIÓN PARA CELULARES
   ========================================================= */

@media (max-width: 480px) {
    .pantalla-login {
        padding: 20px 16px;
    }

    .tarjeta-login {
        padding: 28px 23px;
        border-radius: 16px;
    }

    .logo-contenedor {
        min-height: 85px;
        margin-bottom: 22px;
    }

    .logo {
        max-height: 95px;
    }

    .encabezado-login {
        margin-bottom: 25px;
    }

    .encabezado-login h1 {
        font-size: 25px;
    }

    .descripcion {
        font-size: 13px;
    }
}

/* =========================================================
   PANTALLAS BAJAS / CELULAR HORIZONTAL
   ========================================================= */

@media (max-height: 650px) {
    .pantalla-login {
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .logo-contenedor {
        min-height: 65px;
        margin-bottom: 18px;
    }

    .logo {
        max-height: 75px;
    }
}

/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}