/* Tema "Andino Online" — design-system compartido de CM Herramientas.
 *
 * Portado desde el bloque <style> de core/templates/core/base.html en
 * pagina_web_propia, que no viajo en la extraccion de la herramienta. Solo
 * contiene lo que este proyecto usa: el resto del tema original (orbs del
 * home, glass-cards oscuras, gradientes de marketing) pertenece al sitio
 * publico y aqui no tendria a quien aplicarse.
 *
 * Se carga DESPUES de tailwind.build.css: eso es intencional, varias reglas
 * (.online-field.pl-10) tienen que ganarle al padding base de la utilidad.
 */

/* ---- BASE ---- */
body { font-family: 'IBM Plex Sans', sans-serif; }
[x-cloak] { display: none !important; }
html { scroll-behavior: smooth; }

/* El preflight de Tailwind oculta con `[hidden]:where(:not([hidden=until-found]))`,
   y `:where()` no suma especificidad: la regla vale (0,1,0), lo mismo que
   cualquier `.una-clase{display:flex}`. En un empate gana la que va despues,
   y los <style> de las plantillas van despues de esta hoja. Asi quedaban
   visibles avisos marcados `hidden` en la pantalla de toma de lecturas: el
   naranja de envio detenido salia vacio (el texto lo pone el JS) y el verde
   anunciaba "Lectura guardada" sin que se hubiera guardado nada.
   El !important zanja el empate una vez para todas las plantillas. */
[hidden]:not([hidden='until-found']) { display: none !important; }

/* ---- TEMA CLARO DEL PORTAL ---- */
/* En el sitio original el degradado colgaba de <main>, que su base.html
   siempre ponia. Aqui las plantillas de `cuentas` cuelgan de <section> y la
   base de servicios_publicos trae su propio <main>: aplicarlo al body cubre
   los dos casos sin anidar <main> dentro de <main>. */
.andino-online {
    background:
        radial-gradient(ellipse 70% 45% at 95% 0%, rgba(77, 214, 164, .10) 0%, transparent 65%),
        radial-gradient(ellipse 55% 35% at 5% 100%, rgba(26, 58, 109, .06) 0%, transparent 60%),
        #F8F9FA;
    background-attachment: fixed;
    color: #212529;
    min-height: 100vh;
}

/* ---- ESTRUCTURA DE PAGINA ---- */
.online-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 6rem 1rem 3rem;
    color: #212529;
}
.online-container {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
}
.online-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: linear-gradient(135deg, #1A3A6D 0%, #0D1E3A 100%);
    color: #FFFFFF;
    box-shadow: 0 10px 30px -10px rgba(26, 58, 109, .22);
}
.online-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 1rem;
    box-shadow: 0 10px 30px -10px rgba(26, 58, 109, .15);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.online-card:hover {
    border-color: rgba(77, 214, 164, .55);
    box-shadow: 0 14px 34px -14px rgba(26, 58, 109, .24);
    transform: translateY(-2px);
}

/* ---- MARCA EN LA CABECERA ---- */
.nav-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    text-decoration: none;
    line-height: 1;
}
.nav-brand-cm {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #4DD6A4;
    transition: color .2s ease;
}
.nav-brand-sep {
    display: inline-block;
    width: 1px;
    height: 1.1em;
    background: rgba(77, 214, 164, .35);
    margin: 0 8px;
    vertical-align: middle;
    align-self: center;
}
.nav-brand-sub {
    font-size: .9rem;
    font-weight: 500;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .75);
    text-transform: uppercase;
    transition: color .2s ease;
}
.nav-brand:hover .nav-brand-cm  { color: #6ee7c0; }
.nav-brand:hover .nav-brand-sub { color: rgba(255, 255, 255, 1); }

/* ---- DATOS ---- */
.online-stat-label {
    color: #6B7280;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.online-stat-value {
    color: #1A3A6D;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.online-table {
    width: 100%;
    border-collapse: collapse;
    background: #FFFFFF;
}
.online-table th {
    color: #6B7280;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: .75rem 1rem;
    text-transform: uppercase;
}
.online-table td {
    border-top: 1px solid #E5E7EB;
    color: #374151;
    font-size: .9rem;
    padding: .8rem 1rem;
}

/* ---- BOTONES ---- */
.online-button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: .75rem;
    background: #4DD6A4;
    color: #0D1E3A;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 700;
    padding: .75rem 1.1rem;
    transition: background .2s ease, box-shadow .2s ease, transform .1s ease;
}
.online-button-primary:hover {
    background: #3BC490;
    box-shadow: 0 10px 24px -12px rgba(26, 58, 109, .35);
}
.online-button-primary:active { transform: scale(.98); }
.online-button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid #CBD5E1;
    border-radius: .75rem;
    background: #FFFFFF;
    color: #1A3A6D;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 700;
    padding: .72rem 1rem;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.online-button-secondary:hover {
    border-color: rgba(77, 214, 164, .75);
    background: rgba(77, 214, 164, .08);
}

/* ---- CAMPOS ---- */
.online-field {
    width: 100%;
    border: 1px solid #CBD5E1;
    border-radius: .75rem;
    background: #FFFFFF;
    color: #212529;
    font-size: .9rem;
    padding: .75rem 1rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.online-field::placeholder { color: #9CA3AF; }
/* Los campos con icono adentro necesitan ganarle al padding base de
   .online-field (esta hoja carga despues de tailwind.build.css). */
.online-field.pl-10 { padding-left: 2.5rem; }
.online-field.pr-11 { padding-right: 2.75rem; }
.online-field:focus {
    border-color: #4DD6A4;
    box-shadow: 0 0 0 3px rgba(77, 214, 164, .18);
    outline: none;
}

/* ---- ETIQUETAS DE ESTADO ---- */
.online-badge-positive,
.online-badge-warning,
.online-badge-danger,
.online-badge-neutral {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 9999px;
    font-size: .72rem;
    font-weight: 700;
    padding: .25rem .65rem;
}
.online-badge-positive {
    background: rgba(77, 214, 164, .13);
    color: #0F766E;
    border: 1px solid rgba(77, 214, 164, .30);
}
.online-badge-warning {
    background: rgba(245, 158, 11, .12);
    color: #B45309;
    border: 1px solid rgba(245, 158, 11, .28);
}
.online-badge-danger {
    background: rgba(217, 83, 79, .10);
    color: #B91C1C;
    border: 1px solid rgba(217, 83, 79, .25);
}
.online-badge-neutral {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
}

/* ---- ANIMACION DE ENTRADA ---- */
.andino-fade-up { animation: andino-fade-up .55s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes andino-fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .online-card,
    .online-button-primary,
    .online-button-secondary,
    .online-field { transition: none; }
    .online-card:hover { transform: none; }
    .andino-fade-up { animation: none; }
}
