/* =========================================================
   MiSeguroEscolar — estilos globales
   Paleta: texto #0E0E0E | acento #FFDC60 | secundario #576BDB
========================================================= */

:root {
  --color-text: #0E0E0E;
  --color-accent: #FFDC60;
  --color-accent-dark: #E9C33F;
  --color-secondary: #576BDB;
  --color-secondary-dark: #4655B3;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F7F7F9;
  --color-border: #E7E7EA;
  --color-muted: #5B5B5F;

  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 2px 8px rgba(14,14,14,0.06);
  --shadow-md: 0 10px 30px rgba(14,14,14,0.08);

  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.narrow { max-width: 820px; }

.text-center { text-align: center; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-accent);
  color: var(--color-text);
  padding: 12px 20px;
  z-index: 999;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin: 0 0 16px;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 18px; }
p:last-child { margin-bottom: 0; }
.lead { font-size: 1.15rem; color: var(--color-muted); margin-bottom: 24px; }
.note { color: var(--color-muted); font-size: 0.95rem; margin-top: 32px; }

.section { padding: 88px 0; }
.section-alt { background: var(--color-bg-alt); }

.section-head { max-width: 720px; margin: 0 auto 48px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }

.btn-primary {
  background: var(--color-accent);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-accent-dark); box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent;
  border-color: var(--color-text);
  color: var(--color-text);
}
.btn-outline:hover { background: var(--color-text); color: #fff; }

.btn-outline-light {
  background: transparent;
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.btn-outline-light:hover { background: rgba(255,255,255,0.15); }

.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-nav { padding: 11px 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.logo-img { height: 38px; width: auto; display: block; }
.logo-text { display: none; }
.logo span { color: var(--color-secondary); }

.main-nav ul {
  display: flex;
  gap: 28px;
}
.main-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  position: relative;
  padding: 4px 0;
}
.main-nav a:hover { color: var(--color-secondary); }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 1px solid var(--color-border);
  background: #fff;
}
.mobile-nav.open { max-height: 500px; }
.mobile-nav ul {
  display: flex;
  flex-direction: column;
  padding: 16px 24px 24px;
  gap: 16px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 96px;
  background: linear-gradient(180deg, #FFF9E6 0%, #FFFFFF 60%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  background: rgba(87,107,219,0.1);
  color: var(--color-secondary-dark);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero-sub { font-size: 1.2rem; font-weight: 600; color: var(--color-text); }
.hero-text { color: var(--color-muted); }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; }

.hero-media { display: flex; justify-content: center; }
.hero-photo {
  position: relative;
  width: 100%;
  max-width: 420px;
}
.hero-photo-inner {
  aspect-ratio: 4/5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: linear-gradient(160deg, var(--color-secondary), #7C8CE8);
}
.hero-photo-inner img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Split section ---------- */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: center;
}
.split.reverse { grid-template-columns: 1.1fr 0.9fr; }
.split.reverse .split-media { order: 2; }
.split.reverse .split-content { order: 1; }

.photo-frame {
  aspect-ratio: 4/5;
  border-radius: var(--radius-lg);
  background: var(--color-secondary);
  background: linear-gradient(160deg, var(--color-secondary), #7C8CE8);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.split-content p { color: var(--color-muted); margin-bottom: 18px; }
.split-content p:last-child { margin-bottom: 0; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 20px; margin-top: 8px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ---------- Cómo puedo ayudarte (tarjetas numeradas) ---------- */
.help-grid { margin-top: 40px; }
.help-card {
  position: relative;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 28px 22px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.help-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.help-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 16px;
}
.help-card p { margin: 0; font-weight: 500; }

/* ---------- Beneficios ---------- */
.benefit-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.benefit-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.benefit-card p { margin: 0; font-size: 0.95rem; color: var(--color-muted); }
.benefit-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: #fff;
}
.benefit-icon svg { width: 26px; height: 26px; }

/* ---------- Coberturas: carrusel ---------- */
.carousel {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}
.carousel-track {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(25% - 15px);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px;
  touch-action: pan-y;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel-track::-webkit-scrollbar { display: none; height: 0; }

.coverage-item {
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 26px 18px;
  text-align: center;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.coverage-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
}
.coverage-icon svg { width: 40px; height: 40px; }
.coverage-icon img { width: 40px; height: 40px; object-fit: contain; }

.carousel-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.15s ease;
}
.carousel-btn svg { width: 20px; height: 20px; }
.carousel-btn:hover { background: var(--color-accent-dark); transform: scale(1.08); }
.carousel-btn:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }

/* ---------- Instituciones: chips flotantes ---------- */
.chip-cloud {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 18px;
}
.chip {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--color-secondary);
  color: var(--color-secondary-dark);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  animation: float 4.5s ease-in-out infinite;
}
.chip:nth-child(2n) { animation-duration: 5.5s; animation-delay: 0.3s; border-color: var(--color-accent-dark); color: var(--color-text); background: #FFFCF2; }
.chip:nth-child(3n) { animation-duration: 5s; animation-delay: 0.6s; }
.chip:nth-child(4n) { animation-duration: 6s; animation-delay: 0.9s; }
.chip:nth-child(5n) { animation-delay: 1.2s; }
.chip:hover { animation-play-state: paused; transform: translateY(-4px); box-shadow: var(--shadow-md); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .chip { animation: none; }
}

/* ---------- FAQ Accordion ---------- */
.accordion { margin-top: 40px; }
.accordion-item {
  border-bottom: 1px solid var(--color-border);
}
.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: none;
  border: none;
  padding: 22px 4px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
  color: var(--color-text);
}
.accordion-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: transform 0.2s ease, background 0.2s ease;
}
.accordion-trigger[aria-expanded="true"] .accordion-icon {
  background: var(--color-accent-dark);
  transform: rotate(45deg);
}
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion-panel p { color: var(--color-muted); padding: 0 4px 22px; margin: 0; }

/* ---------- CTA final ---------- */
.cta-final {
  background: var(--color-secondary);
  color: #fff;
}
.cta-final h2 { color: #fff; }
.cta-final p { color: rgba(255,255,255,0.9); }

.cta-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.cta-contacts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; }

.quote-form {
  background: #fff;
  color: var(--color-text);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.quote-form h3 { margin-bottom: 16px; }

.form-row { margin-bottom: 12px; }
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-row-2 > div { margin: 0; }

input, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: #8B8B90; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(87,107,219,0.15);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: #D64545;
}
textarea { resize: vertical; }

.form-error {
  display: block;
  color: #D64545;
  font-size: 0.82rem;
  margin-top: 4px;
  min-height: 1em;
}

.form-note {
  text-align: center;
  margin-top: 14px;
  font-weight: 600;
  min-height: 1.2em;
}
.form-note.success { color: #1E8A4C; }
.form-note.error { color: #D64545; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-text);
  color: #C9C9CE;
  padding-top: 64px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand .logo { color: #fff; }
.footer-brand .logo span { color: var(--color-accent); }
.footer-brand p { color: #A9A9AF; margin: 14px 0 0; font-size: 0.92rem; line-height: 1.6; max-width: 320px; }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
}
.footer-contact h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 4px;
}
.footer-contact a, .footer-contact-item { font-size: 0.95rem; color: #C9C9CE; }
.footer-contact a:hover { color: var(--color-accent); }

.footer-bottom {
  padding: 22px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: #7C7C82;
}

/* ---------- WhatsApp float ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 90;
  transition: transform 0.15s ease;
}
.whatsapp-float:hover { transform: scale(1.08); }

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .btn-nav { display: none; }
  .menu-toggle { display: flex; }
  .mobile-nav { display: block; }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 320px; margin: 0 auto; }

  .split, .split.reverse {
    grid-template-columns: 1fr;
  }
  .split .split-media, .split.reverse .split-media { order: -1; }
  .split .split-content, .split.reverse .split-content { order: 2; }
  .photo-frame { max-width: 320px; margin: 0 auto; }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }

  .carousel-track { grid-auto-columns: calc(50% - 10px); }

  .cta-inner { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .section { padding: 64px 0; }
  .hero { padding: 48px 0 64px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .form-row-2 { grid-template-columns: 1fr; }
  .cta-contacts { flex-direction: column; align-items: stretch; }
  .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
  .carousel-track { grid-auto-columns: 82%; }
  .carousel-btn { width: 38px; height: 38px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}
