:root {
  color-scheme: light;
  --ink: #102a3a;
  --muted: #587080;
  --surface: #ffffff;
  --line: #dce7e6;
  --brand: #0f766e;
  --brand-dark: #164e63;
  --brand-soft: #dff6f1;
  --danger: #b42318;
  --shadow: 0 22px 60px rgba(15, 76, 86, 0.16);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(45, 212, 191, 0.18), transparent 32rem),
    radial-gradient(circle at 90% 12%, rgba(14, 116, 144, 0.12), transparent 28rem),
    #f3f8f7;
}

button, a { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 800; }
.brand img { width: 42px; height: 42px; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; }
.toplink { color: var(--brand-dark); font-size: 14px; font-weight: 750; text-decoration: none; }
.toplink:hover { text-decoration: underline; }

.home-main { flex: 1; display: grid; place-items: center; padding: clamp(40px, 8vw, 90px) 20px; }
.hero { width: min(1100px, 100%); display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(28px, 6vw, 76px); align-items: center; }
.eyebrow { color: var(--brand); font-size: 13px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 12px 0 18px; font-size: clamp(40px, 6vw, 72px); line-height: .98; letter-spacing: -.045em; }
.lead { max-width: 680px; color: var(--muted); font-size: clamp(18px, 2.4vw, 23px); line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(15, 118, 110, .22);
}
.button:hover { transform: translateY(-1px); }
.button.secondary { background: white; color: var(--brand-dark); border-color: var(--line); box-shadow: none; }
.button[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.feature-card { padding: 28px; border: 1px solid rgba(255,255,255,.65); border-radius: 24px; background: rgba(255,255,255,.78); box-shadow: var(--shadow); }
.feature-card img { width: 72px; height: 72px; }
.feature-card h2 { margin: 20px 0 8px; font-size: 24px; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.feature-list { display: grid; gap: 13px; margin: 24px 0 0; padding: 0; list-style: none; }
.feature-list li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.feature-list li::before { content: "✓"; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 900; }

.portal-shell { height: 100vh; overflow: hidden; }
.portal-header { height: 58px; min-height: 58px; padding-block: 7px; }
.portal-header .brand img { width: 34px; height: 34px; }
.portal-frame { width: 100%; height: calc(100vh - 58px); border: 0; background: #fff; }
.portal-status { flex: 1; display: grid; place-items: center; padding: 28px; text-align: center; }
.portal-status-card { width: min(620px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.portal-status-card h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.08; }
.portal-status-card p { color: var(--muted); line-height: 1.6; }
.config-code { display: block; margin: 18px 0; padding: 12px; border-radius: 8px; background: #f5f8f8; color: var(--danger); font: 700 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.footer { padding: 22px; color: var(--muted); text-align: center; font-size: 13px; }

.official-shell { min-height: 100vh; background: #f6faf9; }
.official-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 26px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
}
.official-nav { display: flex; justify-content: center; gap: clamp(14px, 2.4vw, 32px); }
.official-nav a { color: var(--muted); font-size: 14px; font-weight: 720; text-decoration: none; }
.official-nav a:hover { color: var(--brand); }
.official-login-top { min-height: 42px; padding: 9px 16px; font-size: 13px; box-shadow: none; }
.official-hero {
  width: min(1240px, calc(100% - 36px));
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(420px, 1.18fr);
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
  margin: 0 auto;
  padding: clamp(54px, 8vw, 108px) 0;
}
.official-hero-copy h1 { max-width: 680px; font-size: clamp(42px, 6vw, 76px); }
.official-hero-copy .lead { max-width: 630px; }
.official-carousel {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 28px;
  background: linear-gradient(135deg, #dff6f1, #dcecf0);
  box-shadow: var(--shadow);
}
.official-carousel-slides { position: absolute; inset: 0; }
.official-carousel-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .55s ease; }
.official-carousel-slide.active { opacity: 1; }
.official-carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.official-carousel-slide figcaption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border-radius: 14px;
  color: white;
  background: rgba(9, 38, 48, .76);
  backdrop-filter: blur(8px);
}
.official-carousel-slide figcaption span { font-size: 13px; line-height: 1.45; }
.official-carousel-placeholder { height: 100%; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--brand-dark); font-weight: 800; }
.official-carousel-placeholder img { width: 105px; height: 105px; }
.carousel-control {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  color: white;
  background: rgba(9, 38, 48, .6);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}
.carousel-control.prev { left: 14px; }
.carousel-control.next { right: 14px; }
.carousel-dots { position: absolute; z-index: 4; bottom: 12px; left: 50%; display: flex; gap: 7px; transform: translateX(-50%); }
.carousel-dot { width: 9px; height: 9px; padding: 0; border: 1px solid white; border-radius: 50%; background: rgba(255,255,255,.42); cursor: pointer; }
.carousel-dot.active { background: white; transform: scale(1.18); }
.official-section { padding: clamp(58px, 7vw, 92px) max(18px, calc((100vw - 1240px) / 2)); scroll-margin-top: 76px; }
.official-section-tint { border-block: 1px solid #dfecea; background: #eaf5f2; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.section-heading h2, .official-cta h2 { margin: 7px 0 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.035em; }
.section-heading > p { max-width: 520px; margin: 0; color: var(--muted); line-height: 1.6; }
.official-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.official-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 34px rgba(15, 76, 86, .07);
}
.official-card h3 { margin: 10px 0 8px; font-size: 20px; line-height: 1.25; }
.official-card p { margin: 0 0 14px; color: var(--muted); line-height: 1.6; white-space: pre-line; }
.card-kicker { color: var(--brand); font-size: 11px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.card-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--brand-dark); background: var(--brand-soft); font-size: 22px; font-weight: 900; }
.card-meta { margin-top: auto; color: var(--muted); }
.card-link { align-self: flex-start; margin-top: auto; color: var(--brand); font-weight: 800; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.news-card.urgent { border-color: #fdba74; border-left: 6px solid #ea580c; background: #fffaf5; }
.news-card.urgent .card-kicker { color: #c2410c; }
.group-card .whatsapp-button { align-self: flex-start; min-height: 42px; margin-top: auto; padding: 9px 14px; background: linear-gradient(135deg, #15803d, #047857); box-shadow: none; font-size: 13px; }
.official-empty { grid-column: 1 / -1; margin: 0; padding: 28px; border: 1px dashed #b9cdca; border-radius: 16px; color: var(--muted); text-align: center; background: rgba(255,255,255,.62); }
.official-cta {
  width: min(1240px, calc(100% - 36px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: clamp(60px, 8vw, 104px) auto;
  padding: clamp(28px, 5vw, 54px);
  border-radius: 25px;
  color: white;
  background: linear-gradient(135deg, #0f766e, #164e63);
  box-shadow: var(--shadow);
}
.official-cta .eyebrow { color: #99f6e4; }
.official-cta .button { color: var(--brand-dark); background: white; box-shadow: none; }
.official-footer { display: flex; justify-content: space-between; gap: 20px; padding: 30px clamp(18px, 4vw, 64px); border-top: 1px solid var(--line); color: var(--muted); background: white; font-size: 13px; }
.official-footer > div { display: grid; gap: 5px; }
.official-footer strong { color: var(--ink); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .topbar { padding-inline: 16px; }
  .brand-copy small { display: none; }
  .portal-header .brand-copy span { font-size: 14px; }
  .official-topbar { grid-template-columns: 1fr auto; min-height: 66px; }
  .official-nav { display: none; }
  .official-login-top { font-size: 0; }
  .official-login-top::after { content: "Ingresar"; font-size: 13px; }
  .official-hero { grid-template-columns: 1fr; width: min(100% - 28px, 680px); padding: 44px 0 62px; }
  .official-carousel { min-height: 320px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 12px; }
  .official-card-grid { grid-template-columns: 1fr; }
  .official-cta { align-items: flex-start; flex-direction: column; }
  .official-footer { flex-direction: column; }
}

@media (min-width: 761px) and (max-width: 1050px) {
  .official-hero { grid-template-columns: 1fr; }
  .official-carousel { min-height: 460px; }
  .official-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .official-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
