/* miDiarioEscolar · Estilos de la web (midiarioescolar.cl) */

/* FUENTES (autoalojadas; licencia en /fonts/OFL.txt) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/inter.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/fraunces.woff2') format('woff2');
}

:root {
  --navy: #0D1F3C;
  --navy-mid: #162C52;
  --navy-light: #1E3A6A;
  --orange: #F5821F;
  --orange-light: #FF9A3C;
  --orange-pale: #FEF0E4;
  --bg: #FFFFFF;
  --bg-soft: #F7F9FC;
  --fg: #1A1A2E;
  --fg-mid: #4A5568;
  --fg-muted: #718096;
  --border: #E2E8F0;
  --white: #FFFFFF;
  --error: #C53030;
  --ok: #22693A;
  --ok-pale: #E6F4EA;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1628;
    --bg-soft: #0F1E38;
    --fg: #F0F4F8;
    --fg-mid: #CBD5E0;
    --fg-muted: #90A0B7;
    --border: #1E3A6A;
    --orange-pale: #1E2D45;
    --error: #FC8181;
    --ok: #68D391;
    --ok-pale: #1C3A2E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1628;
  --bg-soft: #0F1E38;
  --fg: #F0F4F8;
  --fg-mid: #CBD5E0;
  --fg-muted: #90A0B7;
  --border: #1E3A6A;
  --orange-pale: #1E2D45;
  --error: #FC8181;
  --ok: #68D391;
  --ok-pale: #1C3A2E;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

[hidden]:not([hidden="until-found" i]) { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* Enlace para saltar al contenido (visible solo al recibir el foco) */
.saltar {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 200;
  background: var(--orange);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.saltar:focus { top: 12px; }

.visualmente-oculto {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* NAV */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,31,60,0.97);
  backdrop-filter: blur(8px);
  padding: 0 24px;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-mark {
  width: 38px; height: 38px;
  background: #fff;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 3px;
}
.logo-mark img { width: 32px; height: 32px; display: block; }
.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}
.logo-text span { color: var(--orange); }
.nav-cta {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--orange-light); }
@media (max-width: 400px) {
  nav { padding: 0 16px; }
  .logo-text { font-size: 1rem; }
  .nav-cta { padding: 8px 14px; }
}

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #1a4480 100%);
  padding: 80px 24px 100px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(245,130,31,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,130,31,0.10) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,130,31,0.15);
  border: 1px solid rgba(245,130,31,0.35);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--orange-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-wrap: balance;
  margin-bottom: 24px;
}
.hero h1 em {
  font-style: normal;
  color: var(--orange);
}
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: rgba(255,255,255,0.75);
  max-width: 600px;
  margin: 0 auto 40px;
  text-wrap: balance;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}
.btn-primary {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { background: var(--orange-light); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.btn-outline:hover { border-color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.05); }

/* STAT STRIP */
.stats-strip {
  background: var(--orange);
  padding: 20px 24px;
}
.stats-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.stat-item .num {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-item .label {
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.3;
  max-width: 110px;
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.3);
}
@media (max-width: 560px) {
  .stats-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
  .stat-divider { display: none; }
}

/* SECTIONS */
section { padding: 80px 24px; }
.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}
.section-label--claro { color: var(--orange-light); }
.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--fg);
  text-wrap: balance;
  margin-bottom: 16px;
}
.section-sub {
  font-size: 1.05rem;
  color: var(--fg-mid);
  max-width: 600px;
  text-wrap: balance;
}
.centered { text-align: center; margin: 0 auto; }
.centered .section-sub { margin: 0 auto; }
.content-wrap { max-width: 1100px; margin: 0 auto; }

/* PROBLEM */
.problem-section { background: var(--bg-soft); }
.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 52px;
}
.problem-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}
.problem-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--navy-light));
}
.problem-icon {
  font-size: 2rem;
  margin-bottom: 14px;
  display: block;
}
.problem-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}
.problem-card p {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* SOLUTION */
.solution-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  margin-top: 60px;
}
@media (max-width: 720px) {
  .solution-split { grid-template-columns: 1fr; gap: 36px; }
}
.solution-visual {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: 20px;
  padding: 40px 32px;
  color: #fff;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.solution-visual::after {
  content: '';
  position: absolute;
  bottom: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(245,130,31,0.25) 0%, transparent 70%);
}
.flow-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 20px;
}
.flow-steps { list-style: none; }
.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.flow-step:last-child { margin-bottom: 0; }
.flow-num {
  width: 28px; height: 28px;
  background: var(--orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}
.flow-step-text strong { font-size: 0.9rem; display: block; margin-bottom: 2px; }
.flow-step-text span { font-size: 0.82rem; opacity: 0.75; }

.solution-points {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.solution-point {
  display: flex;
  gap: 14px;
}
.sp-icon {
  width: 40px; height: 40px;
  background: var(--orange-pale);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.sp-text h3 { font-size: 0.97rem; font-weight: 700; color: var(--fg); margin-bottom: 4px; }
.sp-text p { font-size: 0.88rem; color: var(--fg-muted); }

/* HOW IT WORKS */
.how-section { background: var(--navy); }
.how-section .section-title { color: #fff; }
.how-section .section-sub { color: rgba(255,255,255,0.65); }
.how-tabs {
  display: flex;
  gap: 8px;
  margin: 40px 0 32px;
  flex-wrap: wrap;
}
.how-tab {
  padding: 10px 22px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.65);
  background: transparent;
  transition: all 0.2s;
}
.how-tab[aria-selected="true"] {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.how-tab:hover:not([aria-selected="true"]) {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}
/* Sin JavaScript se ven los dos paneles, cada uno con su título. */
.how-panels { margin-top: 40px; }
.how-tabs:not([hidden]) + .how-panels { margin-top: 0; }
.how-panel-title {
  grid-column: 1 / -1;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.how-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.how-panel + .how-panel { margin-top: 32px; }
.how-step {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 24px 20px;
}
.how-step-num {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.how-step h4 { font-size: 0.97rem; font-weight: 700; color: #fff; margin-bottom: 6px; }
.how-step p { font-size: 0.85rem; color: rgba(255,255,255,0.6); line-height: 1.55; }
.how-highlight {
  background: rgba(245,130,31,0.12);
  border: 1px solid rgba(245,130,31,0.3);
  border-radius: 14px;
  padding: 20px 24px;
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.how-highlight .big { font-size: 2.4rem; font-weight: 800; color: var(--orange); font-variant-numeric: tabular-nums; line-height: 1; }
.how-highlight .desc { color: rgba(255,255,255,0.85); font-size: 0.95rem; }
.how-highlight .desc strong { color: #fff; }

/* BENEFITS */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 52px;
}
.benefit-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(13,31,60,0.1);
}
.benefit-emoji { font-size: 2rem; margin-bottom: 12px; display: block; }
.benefit-card h3 { font-size: 1rem; font-weight: 700; color: var(--fg); margin-bottom: 6px; }
.benefit-card p { font-size: 0.88rem; color: var(--fg-muted); line-height: 1.6; }
.benefit-tag {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--orange-pale);
  color: var(--orange);
}

/* TESTIMONIALS
   La sección está retirada hasta tener testimonios reales con permiso.
   Estos estilos se conservan para volver a añadirla (ver README). */
.testimonials-section { background: var(--bg-soft); }
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.testimonial {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
}
.stars { color: var(--orange); font-size: 1rem; margin-bottom: 12px; letter-spacing: 2px; }
.testimonial blockquote {
  font-size: 0.95rem;
  color: var(--fg-mid);
  line-height: 1.65;
  margin-bottom: 16px;
  font-style: italic;
}
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.av1 { background: var(--navy); }
.av2 { background: #2D6A4F; }
.av3 { background: #7B2D8B; }
.author-name { font-size: 0.9rem; font-weight: 700; color: var(--fg); }
.author-role { font-size: 0.78rem; color: var(--fg-muted); }

/* DEMO FORM */
.demo-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 90px 24px;
}
.demo-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.demo-inner .section-title { color: #fff; }
.demo-inner .section-sub { color: rgba(255,255,255,0.7); margin: 0 auto 40px; }
.demo-form {
  background: var(--bg);
  border-radius: 20px;
  padding: 40px 36px;
  text-align: left;
}
@media (max-width: 480px) { .demo-form { padding: 28px 20px; } }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-group .req { color: var(--orange); }
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.95rem;
  color: var(--fg);
  font-family: inherit;
  transition: border-color 0.2s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245,130,31,0.25);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group--error input,
.form-group--error select,
.form-group--error textarea { border-color: var(--error); }
.form-error { font-size: 0.8rem; color: var(--error); min-height: 0; }
.form-error:empty { display: none; }
.form-hint { font-size: 0.78rem; color: var(--fg-muted); }
.form-required-note { font-size: 0.8rem; color: var(--fg-muted); margin-bottom: 16px; }

.form-group label.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--fg-mid);
  cursor: pointer;
}
.form-check input {
  width: 18px; height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--orange);
}
.form-check a { color: var(--orange); }
.form-group--error label.form-check { color: var(--error); }

/* Campo trampa para bots: fuera de la vista y del orden de tabulación */
.trampa {
  position: absolute !important;
  left: -10000px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-submit {
  margin-top: 24px;
  width: 100%;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 15px 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s;
}
.form-submit:hover { background: var(--orange-light); transform: translateY(-2px); }
.form-submit:disabled { opacity: 0.7; cursor: progress; transform: none; }
.form-status { margin-top: 14px; font-size: 0.9rem; text-align: center; }
.form-status:empty { display: none; }
.form-status--error { color: var(--error); font-weight: 600; }
.form-note { text-align: center; margin-top: 14px; font-size: 0.8rem; color: var(--fg-muted); }

/* SUCCESS STATE */
.form-success {
  text-align: center;
  padding: 32px 16px;
}
.form-success .check-icon {
  width: 60px; height: 60px;
  background: var(--ok-pale);
  color: var(--ok);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.8rem;
  font-weight: 800;
}
.form-success h3 { font-size: 1.2rem; font-weight: 700; color: var(--fg); margin-bottom: 8px; }
.form-success h3:focus { outline: none; }
.form-success p { font-size: 0.9rem; color: var(--fg-muted); }

/* FOOTER */
footer {
  background: var(--navy);
  padding: 40px 24px;
  text-align: center;
}
.footer-logo { margin-bottom: 12px; }
.footer-wordmark { font-size: 1.1rem; font-weight: 700; color: #fff; }
.footer-wordmark span { color: var(--orange); }
.footer-tagline { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: 20px; }
.footer-links { display: flex; gap: 8px 24px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; list-style: none; }
.footer-links a { font-size: 0.82rem; color: rgba(255,255,255,0.65); text-decoration: none; }
.footer-links a:hover { color: var(--orange); }
.footer-copy { font-size: 0.78rem; color: rgba(255,255,255,0.5); }
.footer-copy a { color: rgba(255,255,255,0.75); }
.footer-copy a:hover { color: var(--orange); }

/* PÁGINAS SECUNDARIAS (privacidad, 404, respuesta del formulario) */
.pagina { padding: 64px 24px 80px; }
.legal { max-width: 760px; margin: 0 auto; }
.legal h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 8px;
}
.legal .fecha { font-size: 0.85rem; color: var(--fg-muted); margin-bottom: 32px; }
.legal h2 { font-size: 1.15rem; margin: 32px 0 10px; }
.legal p, .legal li { color: var(--fg-mid); font-size: 0.97rem; }
.legal .section-label { color: var(--orange); font-size: 0.78rem; }
.legal p + p { margin-top: 10px; }
.legal ul { padding-left: 1.3em; margin: 10px 0; }
.legal li + li { margin-top: 4px; }
.legal a { color: var(--orange); }
.legal strong { color: var(--fg); }

.aviso {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.aviso .aviso__codigo {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 4.5rem;
  line-height: 1;
  color: var(--orange);
  margin-bottom: 12px;
}
.aviso h1 { font-family: 'Fraunces', Georgia, serif; font-size: 1.9rem; line-height: 1.2; margin-bottom: 12px; }
.aviso p { color: var(--fg-mid); margin-bottom: 12px; }
.aviso ul { text-align: left; color: var(--fg-mid); margin: 0 0 12px 1.2em; }
.aviso .btn-primary { margin-top: 16px; }
