/* ==============================
   Variables y base de la página
   ============================== */
:root {
  --color-primary-soft: #ffcba4;
  --color-primary: #ff8c00;
  --color-primary-dark: #f07f00;
  --color-secondary: #1c3144;
  --color-text: #26323d;
  --color-muted: #7d8791;
  --color-bg: #f6f3ed;
  --color-surface: #ffffff;
  --color-alt-bg: #fff7ef;
  --color-border: #ece5da;
  --shadow-soft: 0 12px 30px rgba(28, 49, 68, 0.08);
  --radius: 14px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: clamp(16px, calc(10.4px + 0.8vw), 24px);
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 10px;
  border: 1px dashed var(--color-border);
  background: #fff;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

.container {
  width: min(3000px, 92%);
  margin-inline: auto;
}

.section {
  padding: 2.75rem 0;
  scroll-margin-top: 5.5rem;
}

.section:not(.hero) > .container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3.5rem);
  box-shadow: var(--shadow-soft);
}

.section.alt > .container {
  background: var(--color-alt-bg);
  border-color: #ffe1c2;
}

.section.highlight > .container {
  background: #fff3e2;
  border-color: #ffd8a6;
}

.section h2 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}

.section-intro {
  color: var(--color-muted);
  max-width: 760px;
  margin-top: 0;
}

/* ==============================
   Cabecera y navegación
   ============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 243, 237, 0.92);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(6px);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.site-header.over-hero {
  background: transparent;
  border-bottom-color: transparent;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.2px;
}

.logo-mark {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.35s ease;
}

.nav-toggle-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-secondary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.35s ease;
}

.nav-open .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-open .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-list a {
  font-weight: 500;
  font-size: 0.8em;
  color: var(--color-muted);
  transition: color 0.35s ease;
}

/* Menú móvil abierto: el panel es blanco, así que los enlaces van en oscuro */
.site-header.nav-open .nav-list a {
  color: var(--color-muted);
}

.nav-list a:hover,
.footer-links a:hover {
  color: var(--color-primary);
}

/* ==============================
   Hero y CTAs
   ============================== */
.hero {
  position: relative;
  margin-top: calc(-1 * var(--header-height, 68px));
  padding-top: calc(6rem + var(--header-height, 68px));
  padding-bottom: 7rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 214, 165, 0.45), transparent 70%),
    linear-gradient(180deg, #fff8ee 0%, #fdf2e3 100%);
  color: var(--color-text);
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(28, 49, 68, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 49, 68, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9), transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9), transparent 75%);
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  will-change: transform;
  pointer-events: none;
}

.hero-blob--one {
  width: 560px;
  height: 560px;
  left: -140px;
  top: -180px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 168, 76, 0.7), transparent 70%);
}

.hero-blob--two {
  width: 520px;
  height: 520px;
  right: -120px;
  top: 15%;
  background: radial-gradient(circle at 70% 30%, rgba(133, 188, 224, 0.6), transparent 70%);
}

.hero-blob--three {
  width: 460px;
  height: 460px;
  left: 32%;
  bottom: -200px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 203, 164, 0.55), transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero .eyebrow {
  color: var(--color-primary-dark);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.hero-title {
  margin: 0 auto 1.4rem;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  max-width: 15ch;
}

.hero-title-accent {
  background: linear-gradient(100deg, #f07f00 0%, #ffb45e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  color: var(--color-muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  max-width: 620px;
  margin-inline: auto;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

/* Indicador de progreso de scroll */
.scroll-progress {
  position: fixed;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 34vh;
  z-index: 30;
  pointer-events: none;
}

.scroll-progress-track {
  position: absolute;
  inset: 0;
  background: rgba(28, 49, 68, 0.12);
  border-radius: 3px;
}

.scroll-progress-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ffcba4, #ff8c00);
  border-radius: 3px;
  transform: scaleY(0);
  transform-origin: top;
}

.scroll-progress-dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 14px rgba(255, 140, 0, 0.6);
}

/* Con el menú móvil abierto, el indicador queda por detrás para no entorpecer */
body.nav-open .scroll-progress {
  z-index: 5;
}

.eyebrow {
  color: var(--color-secondary);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
}

h1 {
  margin: 0 0 1rem;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
}

.lead {
  color: var(--color-muted);
  font-size: 1.05rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 8px 24px rgba(255, 140, 0, 0.35);
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}

.btn-primary:hover::after {
  left: 130%;
}

.btn-secondary {
  background: #ffffff;
  color: var(--color-secondary);
  border: 1px solid var(--color-secondary);
}

.btn-secondary:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ==============================
   Tarjetas informativas
   ============================== */
.card-grid {
  display: grid;
  align-items: stretch;
  gap: 1rem;
}

.card-grid > * {
  min-width: 0;
}

.card-grid > .collapsible-panel {
  align-self: start;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: 0 18px 40px rgba(31, 41, 51, 0.12);
}

.card h3,
.tip-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.card p,
.tip-card p {
  margin: 0;
  color: var(--color-muted);
}

.full-width {
  grid-column: 1 / -1;
}

.card-accent {
  display: block;
  width: 2.6rem;
  height: 0.4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-soft));
  margin-bottom: 0.8rem;
}

.feature-overlay {
  position: relative;
  width: 100%;
  min-height: clamp(420px, 42vw, 720px);
  display: grid;
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  background: #fff5ec;
}

.feature-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  border: 0;
  border-radius: var(--radius);
}

.feature-stack {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(0.9rem, 2vw, 1.5rem);
  display: grid;
  justify-items: center;
  gap: 0.8rem;
}

.feature-card {
  width: min(92%, 640px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.3s ease;
}

.feature-card summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  color: var(--color-text);
  padding: 0.9rem 3rem 0.9rem 1.1rem;
  position: relative;
  transition: color 0.25s ease;
}

.feature-card summary:hover {
  color: var(--color-primary-dark);
}

.feature-card summary::-webkit-details-marker {
  display: none;
}

.feature-card summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5em;
  height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  font-weight: 600;
  color: var(--color-primary-dark);
  background: rgba(255, 140, 0, 0.12);
  border-radius: 50%;
}

.feature-card[open] summary::after {
  content: "−";
}

.collapsible-panel summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  color: var(--color-text);
  padding: 0.9rem 3rem 0.9rem 1.1rem;
  position: relative;
  transition: color 0.25s ease;
}

.collapsible-panel summary:hover {
  color: var(--color-primary-dark);
}

.collapsible-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5em;
  height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  font-weight: 600;
  color: var(--color-primary-dark);
  background: rgba(255, 140, 0, 0.12);
  border-radius: 50%;
}

.collapsible-panel[open] summary::after {
  content: "−";
}

.collapsible-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.45s ease, opacity 0.32s ease, transform 0.45s ease;
}

.collapsible-content p {
  margin: 0;
  padding: 0 1.1rem 1rem;
  color: var(--color-muted);
}

/* ==============================
   Bienestar y descarga
   ============================== */
.tips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 1rem;
}

.tips > * {
  min-width: 0;
}

.tip-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tip-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: rgba(255, 140, 0, 0.12);
  color: var(--color-primary-dark);
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.tip-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: 0 18px 40px rgba(31, 41, 51, 0.12);
}

.highlight {
  background: transparent;
}

.download-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.coming-soon {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.coming-soon p {
  margin: 0;
  font-weight: 600;
  color: var(--color-muted);
}

/* ==============================
   Banner de consentimiento
   ============================== */
.consent-banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 20;
  width: min(720px, calc(100% - 2rem));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.consent-banner[hidden] {
  display: none;
}

.consent-banner p {
  margin: 0;
  flex: 1 1 300px;
  font-size: 0.95rem;
  color: var(--color-text);
}

.consent-actions {
  display: flex;
  gap: 0.6rem;
}

@media (max-width: 640px) {
  .consent-actions {
    width: 100%;
  }

  .consent-actions .btn {
    flex: 1;
  }
}

/* ==============================
   Footer
   ============================== */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: #fff;
  padding: 1.3rem 0;
  font-size: 0.8em;
}

.footer-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-wrap p {
  margin: 0;
  color: var(--color-muted);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

/* ==============================
   Responsive
   ============================== */
@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
  }

  #primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    display: none;
  }

  .nav-open #primary-nav {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }

  .nav-list li {
    width: 100%;
  }

  .nav-list a {
    display: block;
    padding: 0.8rem 1.5rem;
  }

  .download-wrap,
  .three-col,
  .tips {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-bottom: 5.5rem;
  }

  .feature-overlay {
    min-height: clamp(420px, 56vw, 680px);
  }
}

@media (max-width: 640px) {
  .section {
    padding: 1.75rem 0;
  }

  .section:not(.hero) > .container {
    padding: 1.5rem 1.25rem;
    border-radius: 18px;
  }

  .hero {
    padding-top: calc(4rem + var(--header-height, 68px));
  }

  .feature-overlay {
    min-height: clamp(400px, 84vw, 620px);
  }
}

/* ==============================
   Páginas internas y autenticación
   ============================== */
.page-hero {
  background:
    radial-gradient(ellipse 80% 100% at 50% 0%, rgba(255, 214, 165, 0.45), transparent 70%),
    linear-gradient(180deg, #fff8ee 0%, #fdf2e3 100%);
  color: var(--color-text);
  text-align: center;
  padding: 3.5rem 0 3rem;
  margin-bottom: 2rem;
}

.page-hero h1 {
  margin-bottom: 0.5rem;
}

.page-hero .lead {
  color: var(--color-muted);
  max-width: 640px;
  margin-inline: auto;
}

.auth-container {
  max-width: 620px;
}

.form {
  display: grid;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

.form-field label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-secondary);
}

.form-field .hint {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font: inherit;
  color: var(--color-text);
  background: #fff;
}

.form-field input:focus,
.form-field select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.checkbox-field input {
  width: auto;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.35rem;
}

.auth-switch {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.auth-switch a {
  color: var(--color-primary);
  font-weight: 600;
}

.form-alert {
  display: none;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.form-alert.visible {
  display: block;
}

.form-alert.error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.form-alert.success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

.form-alert.info {
  background: #fff7ef;
  border: 1px solid #ffd8a6;
  color: #7a4a00;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   Documentos legales
   ============================== */
.legal-doc {
  display: grid;
  gap: 0.75rem;
}

.legal-doc h2 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  margin: 1.75rem 0 0;
}

.legal-doc h3 {
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  margin: 1.25rem 0 0;
}

.legal-doc p {
  margin: 0;
}

.legal-doc ul {
  margin: 0;
  padding-left: 1.25rem;
}

.legal-doc li + li {
  margin-top: 0.35rem;
}

.legal-doc a {
  color: var(--color-primary);
  font-weight: 600;
}

.legal-doc a:hover {
  text-decoration: underline;
}
