/* ===== DESIGN TOKENS ===== */
:root {
  --bg-hero: #102320;
  --bg-card-dark: #183530;
  --bg-light: #f8fafc;
  --color-action: #B0CB1F;
  --color-info: #00A0E3;
  --color-info-bg: #e8f6fd;
  --text-dark: #102320;
  --text-light: #ffffff;
  --kofi-red: #FF5E5B;
  --font-main: 'Public Sans', 'Noto Sans', sans-serif;
  --radius: 12px;
  --shadow-card: 0 4px 16px rgba(0,0,0,0.08);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); color: var(--text-dark); line-height: 1.6; overflow-x: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ===== UTILITY ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== NAVBAR ===== */
#navbar {
  position: fixed; top: 0; width: 100%; z-index: 100;
  background: var(--bg-hero);
  padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  transition: box-shadow 0.3s;
}
#navbar.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.45); }
#navbar .logo { height: 36px; }

#btn-acceder-nav {
  background: var(--color-info); color: #fff; border: none;
  border-radius: 8px; padding: 8px 20px;
  font-family: var(--font-main); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s;
}
#btn-acceder-nav:disabled { opacity: 0.45; cursor: not-allowed; }
#btn-acceder-nav:not(:disabled):hover { opacity: 0.85; }

/* ===== HERO ===== */
#hero {
  background: linear-gradient(160deg, var(--bg-hero) 0%, var(--bg-card-dark) 100%);
  padding: 120px 24px 80px; text-align: center; color: var(--text-light);
}
#hero .hero-logo { height: 80px; margin: 0 auto 24px; }
#hero h1 { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; max-width: 600px; margin: 0 auto 32px; line-height: 1.3; }

.hero-stats { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stat { background: rgba(255,255,255,0.08); border-radius: 10px; padding: 14px 20px; min-width: 110px; }
.hero-stat .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--color-action); display: block; }
.hero-stat .stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.7); }

#btn-hero-cta {
  display: inline-block; background: var(--color-action); color: var(--text-dark);
  border: none; border-radius: 28px; padding: 16px 40px;
  font-family: var(--font-main); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
}
#btn-hero-cta:disabled { opacity: 0.6; cursor: not-allowed; }
#btn-hero-cta:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(176,203,31,0.4); }
.hero-lock-icon { font-size: 0.8rem; margin-right: 6px; }

/* Hero fade-in on load */
.hero-content { opacity: 0; transform: translateY(24px); }
.hero-content.visible { animation: fadeSlideUp 0.7s ease forwards; }
@keyframes fadeSlideUp { to { opacity: 1; transform: translateY(0); } }

/* ===== QUÉ ES GLYNU ===== */
#que-es { background: #fff; padding: 64px 24px; }
#que-es .section-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 20px; }
.aviso-medico {
  background: var(--color-info-bg); border-left: 4px solid var(--color-info);
  border-radius: 0 8px 8px 0; padding: 20px 24px; max-width: 760px; margin: 0 auto;
}
.aviso-medico p { color: #1a4a6b; font-size: 0.95rem; line-height: 1.7; }
.que-es-desc { max-width: 760px; margin: 24px auto 0; }
.que-es-desc p { font-size: 0.95rem; color: #444; }

/* ===== CALCULADORAS / HERRAMIENTAS ===== */
#calculadoras { background: linear-gradient(160deg, #102320 0%, #1b3a30 100%); padding: 64px 24px; }
#herramientas { background: linear-gradient(160deg, #0c1e2d 0%, #13293a 100%); padding: 64px 24px; }
.features-block-header { text-align: center; margin-bottom: 40px; }
.features-block-header .section-title { color: #fff; font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; }
.block-subtitle { color: rgba(255,255,255,0.55); font-size: 0.9rem; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1200px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  position: relative; border-radius: 14px; overflow: hidden; cursor: pointer;
  min-height: 112px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.2s, box-shadow 0.2s; outline: none;
}
.feature-card:hover, .feature-card:focus-visible {
  transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}
.card-front {
  padding: 22px 14px; display: flex; flex-direction: column;
  align-items: center; gap: 10px; text-align: center; transition: opacity 0.25s;
}
.card-front i { font-size: 1.5rem; }
.calculadora .card-front i { color: var(--color-action); }
.herramienta .card-front i { color: var(--color-info); }
.card-front h3 { font-size: 0.8rem; font-weight: 700; color: rgba(255,255,255,0.9); line-height: 1.3; }
.card-back {
  position: absolute; inset: 0; padding: 16px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.25s;
}
.calculadora .card-back { background: rgba(176,203,31,0.16); border: 1px solid rgba(176,203,31,0.35); }
.herramienta .card-back { background: rgba(0,160,227,0.16); border: 1px solid rgba(0,160,227,0.35); }
.card-back p { font-size: 0.82rem; color: rgba(255,255,255,0.92); text-align: center; line-height: 1.55; }
.feature-card:hover .card-back, .feature-card:focus-visible .card-back, .feature-card.active .card-back { opacity: 1; }
.feature-card:hover .card-front, .feature-card:focus-visible .card-front, .feature-card.active .card-front { opacity: 0; }

/* ===== DISCLAIMER FÓRMULAS ===== */
#formulas-disclaimer { background: #fff; padding: 40px 24px; }
.formula-aviso {
  background: var(--color-info-bg); border: 1px solid var(--color-info);
  border-radius: 8px; padding: 20px 24px; max-width: 760px; margin: 0 auto;
}
.formula-aviso p { font-size: 0.88rem; color: #1a4a6b; line-height: 1.7; }

/* ===== KOFI + CTA ===== */
#kofi-cta { background: var(--bg-hero); padding: 56px 24px; color: var(--text-light); }
#kofi-cta .kofi-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 32px; flex-wrap: wrap; max-width: 900px; margin: 0 auto;
}
#kofi-cta .kofi-left h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
#kofi-cta .kofi-left p { font-size: 0.9rem; color: rgba(255,255,255,0.75); margin-bottom: 16px; }

.btn-kofi {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--kofi-red); color: #fff; border: none;
  border-radius: 8px; padding: 12px 24px;
  font-family: var(--font-main); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: opacity 0.2s;
}
.btn-kofi:hover { opacity: 0.85; }

#btn-glynu-kofi {
  background: var(--color-action); color: var(--text-dark); border: none;
  border-radius: 8px; padding: 16px 36px;
  font-family: var(--font-main); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; white-space: nowrap;
}
#btn-glynu-kofi:disabled { opacity: 0.45; cursor: not-allowed; }
#btn-glynu-kofi:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(176,203,31,0.4); }

/* ===== FOOTER ===== */
footer { background: #0a1a17; color: rgba(255,255,255,0.6); padding: 32px 24px; text-align: center; font-size: 0.85rem; }
footer .footer-legal { margin-top: 12px; }
footer a { color: var(--color-info); margin: 0 8px; font-size: 0.82rem; transition: opacity 0.2s; }
footer a:hover { opacity: 0.7; }

/* ===== CONSENT MODAL ===== */
#consent-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72);
  z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px;
}
#consent-overlay.hidden { display: none; }

#consent-card {
  background: #fff; border-radius: 14px; padding: 20px 20px 22px;
  width: min(68%, 340px); box-shadow: 0 10px 40px rgba(0,0,0,0.7);
}
.consent-header {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; margin-bottom: 14px;
}
.consent-header .icon-badge {
  width: 22px; height: 22px; background: var(--color-action); border-radius: 5px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px;
}
.consent-header h2 { font-size: 13px; font-weight: 700; color: var(--text-dark); }

.consent-checks { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.consent-check {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; font-size: 11px; color: #374151; line-height: 1.4;
}
.consent-check input[type="checkbox"] { display: none; }
.check-box {
  width: 16px; height: 16px; border: 2px solid #ccc; border-radius: 3px;
  flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.consent-check input:checked + .check-box { border-color: var(--color-info); background: var(--color-info); }
.consent-check input:checked + .check-box::after { content: '✓'; color: #fff; font-size: 9px; font-weight: bold; }
.consent-check a { color: var(--color-info); text-decoration: underline; }

#btn-consent-accept {
  width: 100%; padding: 11px; background: #ccc; color: #fff; border: none;
  border-radius: 8px; font-family: var(--font-main); font-size: 12px; font-weight: 700;
  cursor: not-allowed; transition: background 0.2s, box-shadow 0.2s;
}
#btn-consent-accept.enabled { background: var(--color-action); color: var(--text-dark); cursor: pointer; box-shadow: 0 3px 8px rgba(176,203,31,0.35); }
#btn-consent-accept.enabled:hover { box-shadow: 0 5px 14px rgba(176,203,31,0.5); }
.consent-note { font-size: 9px; color: #bbb; text-align: center; margin-top: 7px; }

/* ===== COOKIE BANNER ===== */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; background: #1a1a1a; color: #eee;
  padding: 14px 24px; z-index: 999; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
#cookie-banner.hidden { display: none; }
#cookie-banner p { flex: 1; min-width: 200px; }
#cookie-banner a { color: var(--color-info); text-decoration: underline; }
.btn-cookie-ok {
  padding: 8px 20px; border: none; border-radius: 6px;
  font-family: var(--font-main); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; background: var(--color-action); color: var(--text-dark); white-space: nowrap;
}

/* ===== SCROLL ANIMATIONS ===== */
.fade-in { opacity: 0; transform: translateY(24px) scale(0.98); transition: opacity 0.55s ease, transform 0.55s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0) scale(1); }
.fade-in-delay-1 { transition-delay: 0.08s; }
.fade-in-delay-2 { transition-delay: 0.16s; }
.fade-in-delay-3 { transition-delay: 0.24s; }
.fade-in-delay-4 { transition-delay: 0.32s; }
.fade-in-delay-5 { transition-delay: 0.40s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #kofi-cta .kofi-inner { flex-direction: column; text-align: center; }
  #consent-card { width: min(90%, 340px); }
  .hero-stats { gap: 10px; }
  .hero-stat { min-width: 90px; padding: 12px 14px; }
}
