/* ==================================================================
   Zona WiFi · Gobernación de Nariño
   Portal cautivo MikroTik — hoja de estilos única (sin dependencias)
   Todos los recursos son locales: el usuario no tiene salida a
   internet antes de autenticarse.
   ================================================================== */

/* --- Tipografía institucional (opcional) -------------------------
   Copie Hind Madurai en /assets/fonts/. Si no existe, el navegador
   usa la pila de sistema sin romper el diseño.                    */
@font-face {
    font-family: 'Hind Madurai';
    src: url('../fonts/HindMadurai-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Hind Madurai';
    src: url('../fonts/HindMadurai-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Hind Madurai';
    src: url('../fonts/HindMadurai-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    --verde-lima:    #A5D64B;
    --verde-claro:   #6FC25A;
    --verde-medio:   #189B4E;
    --verde-hondo:   #0B7A3B;
    --verde-tinta:   #05421F;
    --amarillo:      #F2C230;
    --blanco:        #FFFFFF;
    --gris-texto:    #6B7280;

    --panel:         rgba(255, 255, 255, 0.30);
    --panel-borde:   rgba(255, 255, 255, 0.45);

    --radio-campo:   12px;
    --radio-panel:   22px;
    --sombra-panel:  0 18px 40px rgba(4, 48, 24, 0.22);

    --fuente: 'Hind Madurai', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--fuente);
    color: var(--verde-tinta);
    background: var(--verde-medio);
}

.portal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------------------------- Marca ---------------------------- */
.marca {
    background: var(--blanco);
    padding: 18px 20px 16px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(4, 48, 24, 0.12);
    position: relative;
    z-index: 2;
}

.marca__logo {
    height: 52px;
    width: auto;
    max-width: 88%;
    object-fit: contain;
    display: inline-block;
}

/* --------------------------- Lienzo ---------------------------- */
.lienzo {
    flex: 1;
    position: relative;
    isolation: isolate;
    padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
    background:
        linear-gradient(163deg,
            var(--verde-lima)  0%,
            var(--verde-claro) 30%,
            var(--verde-medio) 62%,
            var(--verde-hondo) 100%);
}

/* Ondas decorativas: eco del patrón del manual de identidad */
.lienzo::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url('../images/waves.svg') center bottom / cover no-repeat;
    opacity: 0.9;
    pointer-events: none;
}

.lienzo > * {
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

/* -------------------------- Noticia ---------------------------- */
.noticia {
    margin: 0 0 22px;
    animation: entrar 0.5s ease both;
}

.noticia__foto {
    border: 4px solid var(--amarillo);
    border-radius: 18px;
    overflow: hidden;
    line-height: 0;
    box-shadow: 0 10px 24px rgba(4, 48, 24, 0.25);
}

.noticia__foto img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

.noticia__titulo {
    margin: 16px 0 6px;
    font-size: 1.32rem;
    line-height: 1.22;
    font-weight: 700;
    color: var(--verde-tinta);
    letter-spacing: -0.01em;
}

.noticia__resumen {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.42;
    color: rgba(255, 255, 255, 0.94);
    text-shadow: 0 1px 2px rgba(4, 48, 24, 0.25);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ------------------------- Zona WiFi --------------------------- */
.zonawifi {
    text-align: center;
    margin: 26px auto 18px;
    animation: entrar 0.5s 0.08s ease both;
}

.zonawifi__onda {
    width: 92px;
    height: 58px;
    display: block;
    margin: 0 auto -18px;
    fill: none;
    stroke: var(--blanco);
    stroke-width: 9;
    stroke-linecap: round;
    filter: drop-shadow(0 3px 5px rgba(4, 48, 24, 0.3));
}

.zonawifi__texto {
    margin: 0;
    font-size: 2.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    text-shadow: 0 4px 8px rgba(4, 48, 24, 0.3);
}

.zonawifi__texto span { color: var(--blanco); }
.zonawifi__texto em {
    color: var(--verde-lima);
    font-style: normal;
}

/* --------------------------- Tarjeta --------------------------- */
.tarjeta {
    background: var(--panel);
    border: 1px solid var(--panel-borde);
    border-radius: var(--radio-panel);
    box-shadow: var(--sombra-panel);
    padding: 20px 18px 22px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: entrar 0.5s 0.16s ease both;
}

.tarjeta__titulo {
    margin: 0 0 16px;
    text-align: center;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--verde-tinta);
}

/* --------------------------- Campos ---------------------------- */
.campo { margin-bottom: 12px; }

.campo__label {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.campo__input {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--verde-tinta);
    background: var(--blanco);
    border: 1.5px solid transparent;
    border-radius: var(--radio-campo);
    box-shadow: 0 2px 6px rgba(4, 48, 24, 0.10);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    appearance: none;
}

.campo__input::placeholder { color: var(--gris-texto); }

.campo__input:focus {
    outline: none;
    border-color: var(--verde-hondo);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.65);
}

.campo__input:focus-visible { outline: 2px solid var(--blanco); outline-offset: 2px; }

.campo__input.es-invalido {
    border-color: #C0392B;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18);
}

.campo__error {
    margin: 5px 2px 0;
    min-height: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #FFE8E4;
    text-shadow: 0 1px 2px rgba(120, 20, 10, 0.55);
}

.campo__error:empty { display: none; }

/* ------------------------ Autorizaciones ----------------------- */
.obligatorios {
    margin: 14px 2px 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--verde-tinta);
}

.acepta {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 2px 5px 8px;
    font-size: 0.85rem;
    line-height: 1.35;
    color: var(--verde-tinta);
    cursor: pointer;
}

.acepta input {
    position: absolute;
    opacity: 0;
    width: 18px; height: 18px;
    margin: 0;
}

.acepta__marca {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 5px;
    background: var(--blanco);
    box-shadow: inset 0 0 0 1.5px rgba(5, 66, 31, 0.18);
    transition: background 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.acepta input:checked + .acepta__marca {
    background: var(--verde-hondo);
    box-shadow: inset 0 0 0 1.5px var(--verde-hondo);
}

.acepta input:checked + .acepta__marca::after {
    content: "";
    position: absolute;
    left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid var(--blanco);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(42deg);
}

.acepta input:focus-visible + .acepta__marca {
    outline: 2px solid var(--blanco);
    outline-offset: 2px;
}

.acepta__texto a {
    color: var(--verde-tinta);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------------------------- Botón ---------------------------- */
.boton {
    position: relative;
    width: 100%;
    height: 50px;
    margin-top: 16px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--blanco);
    background: var(--verde-hondo);
    border: 0;
    border-radius: 25px;
    box-shadow: 0 8px 18px rgba(4, 48, 24, 0.30);
    cursor: pointer;
    transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.boton:hover  { background: #0A6733; }
.boton:active { transform: translateY(2px); box-shadow: 0 4px 10px rgba(4, 48, 24, 0.30); }
.boton:focus-visible { outline: 3px solid var(--blanco); outline-offset: 3px; }

.boton[disabled] { opacity: 0.75; cursor: progress; }

.boton__spinner {
    display: none;
    position: absolute;
    top: 50%; right: 20px;
    width: 18px; height: 18px;
    margin-top: -9px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: var(--blanco);
    border-radius: 50%;
    animation: girar 0.7s linear infinite;
}

.boton.esta-enviando .boton__spinner { display: block; }

/* ----------------------------- Pie ----------------------------- */
.pie {
    margin-top: 22px;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.85);
}

/* -------------------------- Animación -------------------------- */
@keyframes entrar {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

@keyframes girar { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ------------------------ Pantallas bajas ---------------------- */
@media (max-height: 700px) {
    .noticia__foto { display: none; }
    .zonawifi { margin-top: 14px; }
    .zonawifi__texto { font-size: 2.1rem; }
}

/* ------------------------ Escritorio --------------------------- */
@media (min-width: 720px) {
    .lienzo { padding-top: 34px; }
    .lienzo > * { max-width: 470px; }
    .noticia__titulo { font-size: 1.45rem; }
}