/* Portal GranjApp. Los tokens copian TemaCarbon (ESTILO.md §2.1.1 y §3): si cambia el tema de la app, se cambian aquí.
   Solo en la web: --verde-marca (logo) y los espacios grandes de sección (--esp-2xl, --esp-3xl). */

@font-face { font-family: "Inter"; src: url("/fuentes/inter_regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fuentes/inter_medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fuentes/inter_semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fuentes/inter_bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --fondo: #F2F4F0;
  --superficie: #FFFFFF;
  --borde: #DCE7D6;
  --borde-fuerte: #C5D6BC;
  --texto: #1C201D;
  --texto-2: #6B6F6C;
  --primario: #1C201D;
  --sobre-primario: #FFFFFF;
  --acento: #C9A24B;
  --contenedor-primario: #F4E7C7;
  --neutro: #EDEFEC;
  --peligro: #993C1D;
  --fondo-peligro: #FCEBEB;
  --exito: #3B6D11;
  --aviso: #854F0B;
  --info: #185FA5;
  --mortalidad: #993C1D;
  --alimento: #854F0B;
  --agua: #185FA5;
  --peso: #3B6D11;
  --insumos: #0F6E56;
  --verde-marca: #569466;

  --esp-xs: 4px; --esp-s: 8px; --esp-m: 12px; --esp-l: 16px; --esp-xl: 24px;
  --esp-2xl: 40px; --esp-3xl: 72px;
  --radio-chico: 8px; --radio-medio: 12px; --radio-tarjeta: 16px; --radio-grande: 20px;
  --alto-boton: 48px;
  --sombra: 0 1px 2px rgba(28, 32, 29, .06), 0 8px 24px rgba(28, 32, 29, .06);
  --ancho: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
.cifra { font-variant-numeric: tabular-nums; }
.contenedor { max-width: var(--ancho); margin: 0 auto; padding: 0 var(--esp-l); }
.oculto { display: none !important; }

/* ---------- Encabezado ---------- */
.encabezado { position: sticky; top: 0; z-index: 10; background: rgba(242, 244, 240, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--borde); }
.encabezado .contenedor { display: flex; align-items: center; gap: var(--esp-l); min-height: 68px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.marca img { width: 38px; height: 38px; }
.marca strong { font-size: 20px; letter-spacing: -0.02em; }
.marca .etiqueta { font-size: 12px; font-weight: 600; color: var(--aviso); background: var(--contenedor-primario); padding: 2px 8px; border-radius: 999px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: var(--esp-xs); }
.nav a.enlace { text-decoration: none; color: var(--texto-2); font-weight: 500; padding: 12px; border-radius: var(--radio-chico); }
.nav a.enlace:hover { color: var(--texto); background: var(--neutro); }
@media (max-width: 760px) { .nav a.enlace { display: none; } }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--esp-s);
  min-height: var(--alto-boton); padding: 0 22px; border-radius: var(--radio-medio);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .08s ease, background .15s ease;
}
.boton:active { transform: translateY(1px); }
.boton-principal { background: var(--primario); color: var(--sobre-primario); }
.boton-principal:hover { background: #2C322E; }
.boton-secundario { background: var(--superficie); color: var(--texto); border-color: var(--borde-fuerte); }
.boton-secundario:hover { background: var(--neutro); }
.boton-dorado { background: var(--acento); color: var(--texto); }
.boton-dorado:hover { background: #BE9640; }
.boton-ancho { width: 100%; }
.boton[disabled], .boton[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.boton-texto { background: none; border: 0; color: var(--texto); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: var(--alto-boton); padding: 0 var(--esp-s); }

/* ---------- Portada ---------- */
.hero { padding: var(--esp-3xl) 0 var(--esp-2xl); overflow: hidden; }
.hero .contenedor { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--esp-2xl); align-items: center; }
.sobretitulo { display: inline-flex; align-items: center; gap: var(--esp-s); font-size: 14px; font-weight: 600; color: var(--texto-2); margin-bottom: var(--esp-l); }
.sobretitulo::before { content: ""; width: 24px; height: 3px; border-radius: 2px; background: var(--acento); }
.hero h1 { font-size: clamp(36px, 5.2vw, 58px); font-weight: 700; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--contenedor-primario) 62%); }
.hero .bajada { font-size: 19px; color: var(--texto-2); margin: var(--esp-xl) 0 var(--esp-xl); max-width: 34em; }
.acciones { display: flex; flex-wrap: wrap; gap: var(--esp-m); }
.sello-play { display: inline-flex; align-items: center; gap: var(--esp-s); margin-top: var(--esp-l); font-size: 14px; color: var(--texto-2); }
.sello-play b { color: var(--texto); }

.telefono { position: absolute; width: 260px; border-radius: 38px; background: #111315; padding: 9px; box-shadow: 0 30px 60px rgba(28, 32, 29, .22); }
.telefono img { border-radius: 30px; width: 100%; height: auto; }
@media (max-width: 900px) {
  .hero { padding-top: var(--esp-2xl); }
  .hero .contenedor { grid-template-columns: 1fr; }
}

.franja { background: var(--superficie); border-top: 1px solid var(--borde); border-bottom: 1px solid var(--borde); }
.cifras { display: grid; grid-template-columns: repeat(4, 1fr); }
.cifras div { padding: var(--esp-xl) var(--esp-l); border-left: 1px solid var(--borde); }
.cifras div:first-child { border-left: 0; }
.cifras b { display: block; font-size: 18px; }
.cifras span { color: var(--texto-2); font-size: 14px; }
@media (max-width: 760px) { .cifras { grid-template-columns: 1fr 1fr; } .cifras div:nth-child(3) { border-left: 0; } .cifras div:nth-child(n+3) { border-top: 1px solid var(--borde); } }

.seccion { padding: var(--esp-3xl) 0; }
.seccion-titulo { max-width: 640px; margin-bottom: var(--esp-2xl); }
.seccion-titulo h2 { font-size: clamp(28px, 3.4vw, 40px); }
.seccion-titulo p { color: var(--texto-2); font-size: 18px; margin-top: var(--esp-m); }

.rejilla { display: grid; gap: var(--esp-l); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .rejilla { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .rejilla { grid-template-columns: 1fr; } }

.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio-tarjeta); padding: var(--esp-xl); }
.funcion h3 { font-size: 18px; margin: var(--esp-l) 0 var(--esp-s); }
.funcion p { color: var(--texto-2); }
.icono-cat { width: 48px; height: 48px; border-radius: var(--radio-medio); display: grid; place-items: center; }
.icono-cat svg { width: 26px; height: 26px; }
.cat-mortalidad { color: var(--mortalidad); background: rgba(153, 60, 29, .15); }
.cat-alimento { color: var(--alimento); background: rgba(133, 79, 11, .15); }
.cat-agua { color: var(--agua); background: rgba(24, 95, 165, .15); }
.cat-peso { color: var(--peso); background: rgba(59, 109, 17, .15); }
.cat-insumos { color: var(--insumos); background: rgba(15, 110, 86, .15); }
.cat-dinero { color: var(--aviso); background: rgba(201, 162, 75, .22); }

.dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: var(--esp-2xl); align-items: center; }
@media (max-width: 900px) { .dos-columnas { grid-template-columns: 1fr; } }
.lista-check { list-style: none; padding: 0; margin: var(--esp-xl) 0 0; display: grid; gap: var(--esp-l); }
.lista-check li { display: grid; grid-template-columns: 28px 1fr; gap: var(--esp-m); }
.lista-check li::before { content: ""; width: 28px; height: 28px; border-radius: 50%; background: var(--contenedor-primario) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23854F0B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 16px no-repeat; }
.lista-check b { display: block; }
.lista-check span { color: var(--texto-2); }

.roles { display: grid; gap: var(--esp-m); }
.rol { display: grid; grid-template-columns: auto 1fr; gap: var(--esp-l); align-items: start; }
.rol .avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--primario); color: var(--acento); }
.rol h3 { font-size: 17px; }
.rol p { color: var(--texto-2); font-size: 15px; margin-top: 2px; }

/* Planes */
.plan { display: flex; flex-direction: column; gap: var(--esp-l); position: relative; }
.plan h3 { font-size: 20px; }
.plan .limite { display: flex; align-items: baseline; gap: var(--esp-s); }
.plan .limite b { font-size: 34px; letter-spacing: -0.02em; }
.plan .limite span { color: var(--texto-2); }
.plan hr { border: 0; border-top: 1px solid var(--borde); margin: 0; width: 100%; }
.plan .nota { color: var(--texto-2); font-size: 14px; }
.plan .boton { margin-top: auto; }
.plan.destacado { border: 2px solid var(--acento); box-shadow: var(--sombra); }
.plan .insignia { position: absolute; top: -13px; left: var(--esp-xl); background: var(--acento); color: var(--texto); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.aclaracion { color: var(--texto-2); font-size: 14px; margin-top: var(--esp-l); }

.proximo { display: flex; align-items: center; gap: var(--esp-xl); background: var(--primario); color: #fff; border-radius: var(--radio-grande); padding: var(--esp-2xl); }
.proximo h2 { font-size: 28px; }
.proximo p { color: rgba(255, 255, 255, .72); margin-top: var(--esp-s); }
.proximo .chip { background: var(--acento); color: var(--texto); }
.proximo .acciones { margin-left: auto; }
@media (max-width: 760px) { .proximo { flex-direction: column; align-items: flex-start; padding: var(--esp-xl); } .proximo .acciones { margin-left: 0; } }

.chip { display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--neutro); color: var(--texto); white-space: nowrap; }
.chip-exito { background: rgba(59, 109, 17, .15); color: var(--exito); }
.chip-aviso { background: rgba(133, 79, 11, .15); color: var(--aviso); }
.chip-peligro { background: rgba(153, 60, 29, .15); color: var(--peligro); }
.chip-info { background: rgba(24, 95, 165, .15); color: var(--info); }

/* ---------- Pie ---------- */
.pie { background: var(--primario); color: rgba(255, 255, 255, .72); padding: var(--esp-2xl) 0 var(--esp-xl); font-size: 14px; }
.pie .contenedor { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--esp-xl); }
.pie .marca strong { color: #fff; }
.pie h4 { color: #fff; margin: 0 0 var(--esp-s); font-size: 14px; }
.pie ul { list-style: none; padding: 0; margin: 0; }
.pie li a { display: inline-block; padding: 6px 0; min-height: 32px; text-decoration: none; }
.pie li a:hover { color: #fff; }
.pie .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: var(--esp-l); }
@media (max-width: 760px) { .pie .contenedor { grid-template-columns: 1fr; } }

/* ---------- Páginas de cuenta y pago ---------- */
.pagina { padding: var(--esp-2xl) 0 var(--esp-3xl); min-height: calc(100vh - 68px - 160px); }
.angosto { max-width: 560px; margin: 0 auto; }
.pagina h1 { font-size: 28px; margin-bottom: var(--esp-s); }
.pagina .bajada { color: var(--texto-2); margin-bottom: var(--esp-xl); }
.pila { display: grid; gap: var(--esp-l); }
.tarjeta h2 { font-size: 18px; margin-bottom: var(--esp-m); }
.tarjeta-cabecera { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-m); margin-bottom: var(--esp-m); }
.tarjeta-cabecera h2 { margin: 0; }

.fila { display: flex; justify-content: space-between; gap: var(--esp-l); padding: var(--esp-m) 0; border-top: 1px solid var(--borde); }
.fila:first-of-type { border-top: 0; }
.fila .etiqueta-fila { color: var(--texto-2); }
.fila .valor { font-weight: 600; text-align: right; }
.fila.total { border-top: 2px solid var(--texto); margin-top: var(--esp-xs); }
.fila.total .valor, .fila.total .etiqueta-fila { font-size: 20px; font-weight: 700; color: var(--texto); }

.campo { display: grid; gap: var(--esp-xs); }
.campo label { font-weight: 600; font-size: 14px; }
.campo input { font: inherit; min-height: var(--alto-boton); padding: 0 var(--esp-m); border: 1px solid var(--borde-fuerte); border-radius: var(--radio-chico); background: var(--superficie); color: var(--texto); }
.campo input:focus { outline: 2px solid var(--acento); border-color: var(--acento); }

.aviso { display: flex; gap: var(--esp-m); padding: var(--esp-m) var(--esp-l); border-radius: var(--radio-chico); font-size: 15px; }
.aviso-peligro { background: var(--fondo-peligro); color: var(--peligro); }
.aviso-info { background: rgba(24, 95, 165, .1); color: var(--info); }
.aviso-aviso { background: rgba(133, 79, 11, .12); color: var(--aviso); }
.aviso-exito { background: rgba(59, 109, 17, .12); color: var(--exito); }

.seguro { display: flex; gap: var(--esp-m); align-items: flex-start; color: var(--texto-2); font-size: 14px; }
.seguro svg { flex: none; width: 20px; height: 20px; color: var(--exito); margin-top: 2px; }

.resultado { text-align: center; padding: var(--esp-2xl) var(--esp-xl); }
.resultado .circulo { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto var(--esp-l); }
.resultado .circulo svg { width: 36px; height: 36px; }
.resultado h1 { margin-bottom: var(--esp-s); }
.resultado p { color: var(--texto-2); }
.resultado .acciones { justify-content: center; margin-top: var(--esp-xl); }
.circulo-exito { background: rgba(59, 109, 17, .15); color: var(--exito); }
.circulo-peligro { background: rgba(153, 60, 29, .15); color: var(--peligro); }
.circulo-neutro { background: var(--neutro); color: var(--texto-2); }

.girando { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--borde); border-top-color: var(--acento); animation: girar .9s linear infinite; margin: 0 auto var(--esp-l); }
@keyframes girar { to { transform: rotate(360deg); } }

.historial { display: grid; }
.pago { display: grid; grid-template-columns: 1fr auto; gap: var(--esp-xs) var(--esp-m); padding: var(--esp-m) 0; border-top: 1px solid var(--borde); }
.pago:first-child { border-top: 0; }
.pago .detalle { color: var(--texto-2); font-size: 14px; }
.pago .monto { font-weight: 600; text-align: right; }
.vacio { color: var(--texto-2); font-size: 15px; }
.usuario { display: flex; align-items: center; gap: var(--esp-s); font-size: 14px; color: var(--texto-2); }
@media (max-width: 600px) { .usuario > span { display: none; } }

/* Sección de finanzas: banda carbón para destacarla */
.finanzas { background: var(--primario); color: #fff; }
.finanzas h2 { font-size: clamp(30px, 3.6vw, 44px); }
.finanzas .sobretitulo { color: var(--acento); }
.finanzas .bajada { color: rgba(255, 255, 255, .72); font-size: 18px; margin: var(--esp-m) 0 var(--esp-xl); }
.finanzas-telefono { position: relative; display: flex; justify-content: center; padding: var(--esp-l) 0 var(--esp-xl); }
.finanzas-telefono .telefono { position: relative; width: 300px; background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08); }
.chip-dia { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); background: var(--acento); color: var(--texto); font-weight: 700; font-size: 14px; padding: 8px 16px; border-radius: 999px; white-space: nowrap; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.lista-finanzas { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--esp-l); }
.lista-finanzas li { padding-left: var(--esp-l); border-left: 3px solid var(--acento); }
.lista-finanzas b { display: block; }
.lista-finanzas span { color: rgba(255, 255, 255, .68); font-size: 15px; }
.nota-finanzas { margin-top: var(--esp-xl); font-size: 14px; color: rgba(255, 255, 255, .6); padding: var(--esp-m) var(--esp-l); border: 1px dashed rgba(255, 255, 255, .25); border-radius: var(--radio-chico); }
@media (max-width: 900px) { .finanzas-telefono { order: 2; } .finanzas-telefono .telefono { width: 250px; } }

/* Vitrina del hero: un teléfono con la captura completa; las pantallas pasan de lado (js/portada.js) */
.vitrina { position: relative; display: flex; flex-direction: column; align-items: center; }
.vitrina .mancha { position: absolute; inset: 20px -10% 80px; border-radius: 50%; background: radial-gradient(closest-side, rgba(86, 148, 102, .28), transparent); filter: blur(10px); }
.vitrina .telefono { position: relative; width: 280px; border-radius: 40px; padding: 9px; overflow: hidden; }
.riel { display: flex; border-radius: 31px; overflow: hidden; }
.riel img { flex: 0 0 100%; width: 100%; height: auto; border-radius: 0; transition: transform .7s cubic-bezier(.4, 0, .2, 1); }
.leyenda-vitrina { position: relative; margin-top: var(--esp-l); font-weight: 600; min-height: 1.6em; }
.puntos { position: relative; display: flex; }
.puntos button { width: 32px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.puntos span { width: 8px; height: 8px; border-radius: 999px; background: var(--borde-fuerte); transition: width .3s ease, background .3s ease; }
.puntos button[aria-current="true"] span { width: 22px; background: var(--acento); }
@media (max-width: 900px) { .vitrina .telefono { width: 240px; } }
.finanzas-telefono .telefono { width: 300px; border-radius: 38px; padding: 9px; }
.finanzas-telefono .telefono img { border-radius: 30px; }
