/* =============================================
   AUTENTICACIÓN - AGROCOM
   ============================================= */

:root {
    --verde-principal: #198754;
    --verde-oscuro: #0d5c38;
    --verde-claro: #eaf7ef;
    --verde-suave: #bfe4cc;
    --amarillo: #f6c945;
    --amarillo-claro: #fff3b8;
    --blanco: #ffffff;
    --texto: #24332b;
    --texto-suave: #65736b;
    --borde: #dce8e0;
    --error: #c0392b;
}

/* Reinicio básico */

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    padding: 20px;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--texto);

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(246, 201, 69, 0.24) 0,
            rgba(246, 201, 69, 0.24) 120px,
            transparent 121px
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(25, 135, 84, 0.18) 0,
            rgba(25, 135, 84, 0.18) 170px,
            transparent 171px
        ),
        linear-gradient(135deg, #f4fff7 0%, #fffbee 100%);

    background-attachment: fixed;
}

/* Contenedor principal centrado */

.contenedor-autenticacion {
    width: 100%;
    min-height: calc(100vh - 40px);

    display: flex;
    justify-content: center;
    align-items: center;
}

/* Tarjeta */

.tarjeta-autenticacion {
    position: relative;
    width: 100%;
    max-width: 450px;
    padding: 38px 42px 30px;

    background-color: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(25, 135, 84, 0.16);
    border-top: 7px solid var(--amarillo);
    border-radius: 24px;

    box-shadow:
        0 22px 55px rgba(13, 92, 56, 0.16),
        0 5px 15px rgba(0, 0, 0, 0.06);

    overflow: hidden;
}

/* Decoración interior */

.tarjeta-autenticacion::before {
    content: "";
    position: absolute;
    top: -75px;
    right: -75px;

    width: 170px;
    height: 170px;

    border-radius: 50%;
    background-color: rgba(246, 201, 69, 0.13);
    pointer-events: none;
}

.tarjeta-autenticacion::after {
    content: "";
    position: absolute;
    bottom: -95px;
    left: -95px;

    width: 190px;
    height: 190px;

    border-radius: 50%;
    background-color: rgba(25, 135, 84, 0.08);
    pointer-events: none;
}

/* Logo */

.logo-agrocom {
    position: relative;
    z-index: 1;

    width: 92px;
    height: 92px;
    margin: -3px auto 13px;

    display: flex;
    justify-content: center;
    align-items: center;

    background: linear-gradient(145deg, #ffffff, var(--verde-claro));
    border: 3px solid var(--amarillo);
    border-radius: 50%;

    box-shadow:
        0 8px 20px rgba(25, 135, 84, 0.18),
        0 0 0 7px rgba(246, 201, 69, 0.12);
}

.logo-agrocom svg {
    width: 72px;
    height: 72px;
}

.logo-agrocom circle {
    fill: transparent;
    stroke: transparent;
}

.logo-agrocom .tallo {
    fill: none;
    stroke: var(--verde-oscuro);
    stroke-width: 6;
    stroke-linecap: round;
}

.logo-agrocom .hoja {
    fill: var(--verde-principal);
}

.logo-agrocom .hoja-derecha {
    fill: #43a85f;
}

/* Encabezado */

.encabezado-autenticacion {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 27px;
}

.nombre-marca {
    margin: 0;
    color: var(--verde-oscuro);
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 2px;
    line-height: 1;
}

.nombre-marca span {
    color: #e3ad08;
}

.encabezado-autenticacion h2 {
    margin: 12px 0 6px;
    color: var(--texto);
    font-size: 24px;
    font-weight: 750;
}

.subtitulo {
    margin: 0;
    color: var(--texto-suave);
    font-size: 14px;
    line-height: 1.5;
}

/* Formulario */

#formAutenticacion {
    position: relative;
    z-index: 1;
}

.grupo-formulario {
    margin-bottom: 20px;
}

.grupo-formulario label {
    display: block;
    margin-bottom: 8px;

    color: var(--verde-oscuro);
    font-size: 14px;
    font-weight: 700;
}

/* Inputs con icono */

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

.icono-input {
    position: absolute;
    left: 15px;
    z-index: 2;

    color: var(--verde-principal);
    font-size: 17px;
    pointer-events: none;
}

.contenedor-input input {
    width: 100%;
    height: 50px;
    padding: 0 48px 0 46px;

    color: var(--texto);
    font-family: inherit;
    font-size: 15px;

    background-color: #fbfefc;
    border: 2px solid var(--borde);
    border-radius: 12px;
    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.contenedor-input input::placeholder {
    color: #9aa79f;
}

.contenedor-input input:hover {
    border-color: var(--verde-suave);
}

.contenedor-input input:focus {
    background-color: var(--blanco);
    border-color: var(--verde-principal);
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.12);
}

/* Botón para mostrar contraseña */

.btn-mostrar-contrasenia {
    position: absolute;
    right: 8px;
    z-index: 3;

    width: 37px;
    height: 37px;
    padding: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    background: transparent;
    border: none;
    border-radius: 9px;
    cursor: pointer;

    font-size: 17px;
    opacity: 0.65;

    transition:
        background-color 0.2s ease,
        opacity 0.2s ease,
        transform 0.2s ease;
}

.btn-mostrar-contrasenia:hover {
    background-color: var(--verde-claro);
    opacity: 1;
    transform: scale(1.05);
}

.btn-mostrar-contrasenia:focus-visible {
    outline: 3px solid rgba(246, 201, 69, 0.55);
}

/* Mensajes */

.mensaje-formulario {
    display: none;
    margin: 2px 0 15px;
    padding: 11px 13px;

    color: var(--error);
    background-color: #fff0ee;
    border: 1px solid #f2bbb4;
    border-left: 4px solid var(--error);
    border-radius: 9px;

    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

/* Se muestra cuando JavaScript agrega contenido */

.mensaje-formulario:not(:empty) {
    display: block;
}

/* Botón principal */

.btn-iniciar-sesion {
    position: relative;
    width: 100%;
    min-height: 52px;
    margin-top: 3px;
    padding: 13px 20px;

    color: var(--blanco);
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.3px;

    background: linear-gradient(
        135deg,
        var(--verde-principal),
        var(--verde-oscuro)
    );

    border: none;
    border-radius: 13px;
    box-shadow: 0 9px 20px rgba(13, 92, 56, 0.24);
    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.btn-iniciar-sesion::after {
    content: "→";
    margin-left: 9px;
    color: var(--amarillo);
    font-size: 19px;
}

.btn-iniciar-sesion:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(13, 92, 56, 0.3);
    filter: brightness(1.05);
}

.btn-iniciar-sesion:active {
    transform: translateY(0);
}

.btn-iniciar-sesion:focus-visible {
    outline: 4px solid rgba(246, 201, 69, 0.5);
    outline-offset: 3px;
}

.btn-iniciar-sesion:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Registro */

.opciones-autenticacion {
    margin-top: 22px;

    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;

    color: var(--texto-suave);
    font-size: 14px;
    text-align: center;
}

.opciones-autenticacion a {
    color: var(--verde-principal);
    font-weight: 800;
    text-decoration: none;

    border-bottom: 2px solid var(--amarillo);
    transition:
        color 0.2s ease,
        border-color 0.2s ease;
}

.opciones-autenticacion a:hover {
    color: var(--verde-oscuro);
    border-bottom-color: var(--verde-principal);
}

/* Parte inferior */

.separador {
    position: relative;
    z-index: 1;

    width: 75%;
    height: 1px;
    margin: 24px auto 15px;

    background: linear-gradient(
        to right,
        transparent,
        var(--verde-suave),
        transparent
    );
}

.frase-agrocom {
    position: relative;
    z-index: 1;

    margin: 0;
    color: var(--verde-oscuro);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

/* Diseño adaptable */

@media (max-width: 520px) {
    body {
        padding: 14px;
    }

    .contenedor-autenticacion {
        min-height: calc(100vh - 28px);
    }

    .tarjeta-autenticacion {
        padding: 32px 23px 25px;
        border-radius: 20px;
    }

    .logo-agrocom {
        width: 80px;
        height: 80px;
    }

    .logo-agrocom svg {
        width: 62px;
        height: 62px;
    }

    .nombre-marca {
        font-size: 30px;
    }

    .encabezado-autenticacion h2 {
        font-size: 21px;
    }

    .opciones-autenticacion {
        flex-direction: column;
    }
}