:root {
    --verde: #004438;
    --verde-aviso: #0a5545;
    --verde-acento: #00ce7c;
    --verde-texto: #04342c;
    --naranja: #ffa400;
    --texto-suave: #9fd9bd;
}

/* Todas las medidas estan en rem: el tamaño base crece con la pantalla */
html {
    font-size: clamp(14px, min(1.15vw, 2.3vh), 22px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--verde);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Pantalla completa ---------- */

.card {
    background-color: var(--verde);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 3rem 1.25rem;
}

.curve {
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: max(32vh, 11rem);
}

/* Hojas grandes en baja opacidad, esquina inferior derecha */
.leaves {
    position: absolute;
    right: -6%;
    bottom: -18%;
    width: 46%;
    max-width: 60rem;
}

.brand {
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.brand-logo {
    height: 3.75rem;
    margin-right: 1rem;
    border-radius: 0.6rem;
}

.content {
    position: relative;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 23.75rem) minmax(0, 36rem);
    justify-content: space-between;
    align-items: center;
    column-gap: 4rem;
    padding: 2.5rem 6% 2.5rem 0;
}

/* ---------- Zona derecha ---------- */

.hero {
    margin-top: 4rem;
}

.hero-bar {
    display: block;
    width: 1.75rem;
    height: 3px;
    background: var(--naranja);
    margin-bottom: 0.75rem;
}

.hero-title {
    color: #ffffff;
    font-size: 2.1rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 0.4rem;
}

.hero-subtitle {
    color: var(--texto-suave);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.value {
    border-top: 2px solid var(--verde-acento);
    padding-top: 0.6rem;
    display: flex;
    flex-direction: column;
}

.value i {
    color: var(--verde-acento);
    font-size: 1.4rem;
}

.value.naranja {
    border-top-color: var(--naranja);
}

.value.naranja i {
    color: var(--naranja);
}

.value strong {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.3rem;
}

.value span {
    color: var(--texto-suave);
    font-size: 0.75rem;
}

/* ---------- Formularios ---------- */

#formAdmin {
    display: none;
    animation: fade-in 0.25s ease both;
}

#formUsers {
    display: block;
    animation: fade-in 0.25s ease both;
}

.formLogin {
    position: relative;
    max-width: 23.75rem;
}

.title {
    font-size: 1.5rem;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.2;
    margin: 0 0 0.25rem;
}

.subtitle {
    font-size: 0.8125rem;
    color: var(--texto-suave);
    margin: 0 0 0.875rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: var(--naranja);
    color: var(--verde);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.625rem;
}

.notice {
    border-left: 3px solid var(--naranja);
    background: var(--verde-aviso);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #ffd78a;
    margin-bottom: 1rem;
}

.row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.625rem;
}

.field {
    margin-bottom: 0.625rem;
}

.label {
    display: block;
    font-size: 0.6875rem;
    color: var(--texto-suave);
    margin-bottom: 0.2rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
}

.forgot {
    color: var(--naranja);
    text-decoration: none;
}

.forgot:hover {
    text-decoration: underline;
}

.inputLogin {
    width: 100%;
    height: 2.375rem;
    background: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 0 0.875rem;
    font: inherit;
    font-size: 0.75rem;
    color: #222222;
    outline: none;
}

/* Evita el fondo azul del autocompletado del navegador */
.inputLogin:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px #ffffff inset;
    -webkit-text-fill-color: #222222;
}

.inputLogin::placeholder {
    color: #888888;
}

.inputLogin:focus {
    box-shadow: 0 0 0 2px var(--naranja);
}

.inputLogin:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px #ffffff inset, 0 0 0 2px var(--naranja);
}

select.inputLogin {
    appearance: none;
    cursor: pointer;
    padding-right: 2.1rem;
}

select.inputLogin:invalid {
    color: #888888;
}

/* Iconos dentro de los campos */
.input-wrap {
    position: relative;
    display: block;
}

.input-wrap .trail,
.input-wrap .lead {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #888888;
    font-size: 0.875rem;
}

.input-wrap .trail {
    right: 0.875rem;
    pointer-events: none;
}

.input-wrap .lead {
    left: 0.875rem;
    pointer-events: none;
}

.inputLogin.has-lead {
    padding-left: 2.25rem;
}

.input-wrap .toggle-pass {
    pointer-events: auto;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
}

.input-wrap .toggle-pass:hover {
    color: var(--verde);
}

/* ---------- Botones ---------- */

.btnsLogin {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.submit,
.btnAdmin {
    height: 2.625rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font: inherit;
    cursor: pointer;
    transition: filter 0.15s, background-color 0.15s, transform 0.1s;
}

.submit {
    flex: 1;
    background: var(--verde-acento);
    color: var(--verde-texto);
    border: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.btnAdmin {
    padding: 0 1rem;
    background: transparent;
    border: 1px solid var(--texto-suave);
    color: #ffffff;
    font-size: 0.8125rem;
}

.submit:hover {
    filter: brightness(1.08);
}

.btnAdmin:hover {
    background: var(--verde-aviso);
}

.submit:active,
.btnAdmin:active {
    transform: scale(0.98);
}

.submit:focus-visible,
.btnAdmin:focus-visible {
    outline: 2px solid var(--naranja);
    outline-offset: 2px;
}

.manual {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--texto-suave);
    text-decoration: none;
    margin-top: 0.75rem;
}

.manual:hover {
    color: var(--naranja);
}

/* ---------- Pie ---------- */

.card-footer {
    position: relative;
    border-top: 1px solid #1a6455;
    padding-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.seals {
    font-size: 0.6875rem;
    color: #7fb8a5;
}

.copy {
    color: #6fa894;
    font-size: 0.625rem;
    text-align: center;
}

.site {
    font-size: 0.75rem;
    color: #ffffff;
}

.site b {
    color: var(--naranja);
    font-weight: 500;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ---------- Tablets y celulares ---------- */

/* La zona derecha solo se muestra cuando hay espacio */
@media (max-width: 900px) {

    .content {
        grid-template-columns: minmax(0, 23.75rem);
        padding-right: 0;
    }

    .hero {
        display: none;
    }
}

@media (max-width: 600px) {

    .leaves {
        width: 80%;
        bottom: -10%;
    }

    .content {
        grid-template-columns: minmax(0, 1fr);
    }


    .card {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .curve {
        width: 75%;
        height: 11rem;
    }

    .brand-logo {
        margin-right: 0.5rem;
    }

    .formLogin {
        max-width: none;
    }

    .card-footer {
        justify-content: center;
    }

    .copy {
        order: 3;
        width: 100%;
    }
}

@media (max-width: 420px) {

    .row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .btnsLogin {
        flex-direction: column;
    }
}

/* ---------- Recuperar contraseña ---------- */

.rec-page {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.25rem;
}

.rec-page .leaves {
    position: absolute;
    right: -6%;
    bottom: -18%;
    width: 46%;
    max-width: 60rem;
}

.rec-card {
    position: relative;
    width: 100%;
    max-width: 26rem;
    background: #ffffff;
    border-radius: 1rem;
    padding: 2rem 2rem 1.5rem;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.25);
    animation: fade-in 0.25s ease both;
}

.rec-title {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--verde);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.rec-sub {
    font-size: 0.8125rem;
    color: #5f7a72;
    margin-bottom: 1rem;
}

.rec-texto {
    font-size: 0.8125rem;
    color: #333333;
    line-height: 1.45;
    margin-bottom: 0.875rem;
}

.rec-card .label {
    color: #5f7a72;
}

/* Campos con borde, porque el fondo de la tarjeta es blanco */
.rec-card .inputLogin {
    background: #f6f8f7;
    border: 1px solid #cfd8d4;
}

.rec-card .inputLogin:focus {
    border-color: var(--naranja);
}

.rec-card .input-wrap .toggle-pass {
    color: #6b7f78;
}

.rec-card .submit {
    width: 100%;
    background: var(--naranja);
    color: var(--verde-texto);
    margin-top: 0.5rem;
}

.rec-card .submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}

.rec-ayuda {
    font-size: 0.6875rem;
    color: #5f7a72;
    margin-top: 0.25rem;
    min-height: 1em;
}

.rec-link {
    display: block;
    margin: 0.75rem auto 0;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.75rem;
    color: var(--verde);
    text-decoration: underline;
    cursor: pointer;
}

.rec-volver {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.8125rem;
    color: var(--verde);
    text-decoration: none;
}

.rec-volver:hover {
    text-decoration: underline;
}
