/* FUNCIENCIAS® Design System v6.0 */
/* Optimizado: Mobile, Accesibilidad WCAG AA, Seguridad */

/* ===== VARIABLES ===== */
:root {
  --navy: #0C1F38;
  --navy-dark: #061120;
  --green: #37A74A;
  --gold: #C8A84B;
  --gold-dark: #8A6D2B;
  --white: #FFFFFF;
  --off-white: #F8FAFC;
  --border: rgba(10, 17, 40, 0.1);
  
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --max-width: 1140px;
}

/* ===== RESET MEJORADO ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--navy);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 768px) { .container { padding: 0 2rem; } }
@media (min-width: 1024px) { .container { padding: 0 3rem; } }

/* ===== TYPOGRAPHY WCAG AA ===== */
/* Ratio mínimo 4.5:1 para texto normal, 3:1 para texto grande */
body { font-size: clamp(1rem, 0.9rem + 0.5vw, 1.125rem); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}

h1 {
  font-size: clamp(2rem, 5vw + 0.5rem, 3.5rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: clamp(1.25rem, 2vw + 0.25rem, 1.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
  max-width: 65ch;
}

p:last-child { margin-bottom: 0; }

.label {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  display: block;
  margin-bottom: 0.75rem;
}

/* ===== SECTION ===== */
.section { padding: 4rem 0; }
@media (min-width: 768px) { .section { padding: 5rem 0; } }
@media (min-width: 1024px) { .section { padding: 6rem 0; } }

/* ===== HEADER OPTIMIZADO ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--navy);
  padding: 1rem 0;
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.header__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
}

/* NAV MOBILE */
.header__links {
  display: flex;
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--navy);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  transition: right 0.3s ease-in-out;
  z-index: 998;
  padding: 2rem;
}

.header__links.active { right: 0; }
.header__links.active ~ .menu-toggle { position: fixed; }

/* Overlay oscuro */
.header__links::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: -1;
}

.header__links.active::before {
  opacity: 1;
  visibility: visible;
}

.header__link {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.875rem 1.5rem;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 300px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.header__link:hover,
.header__link:focus {
  color: var(--gold);
  background: rgba(255,255,255,0.05);
}

.header__link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.header__link--cta {
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  margin-top: 0.5rem;
}

.header__link--cta:hover,
.header__link--cta:focus {
  background: #2d8f3d;
  color: var(--white);
}

/* MENU TOGGLE MEJORADO */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 52px;
  height: 52px;
  padding: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  border-radius: 4px;
  transition: background 0.15s;
}

.menu-toggle:hover { background: rgba(255,255,255,0.1); }
.menu-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.15s;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* NAV DESKTOP */
@media (min-width: 1024px) {
  .header { padding: 0.875rem 0; }
  .header__logo { font-size: 1.375rem; }
  
  .header__links {
    position: static;
    width: auto;
    height: auto;
    flex-direction: row;
    background: transparent;
    padding: 0;
    gap: 0.25rem;
  }
  
  .header__links::before { display: none; }
  
  .header__link {
    font-size: 0.8125rem;
    width: auto;
    padding: 0.5rem 0.875rem;
    border-radius: 4px;
  }
  
  .header__link--cta { margin-top: 0; }
  .menu-toggle { display: none; }
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  background: var(--navy);
  padding: 5rem 0 3rem;
}

.hero__content {
  width: 100%;
  max-width: 800px;
}

.hero__label {
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  display: block;
}

.hero__title {
  color: var(--white);
  font-size: clamp(2.25rem, 6vw + 0.5rem, 4rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero__title span { color: var(--gold); }

.hero__subtitle {
  color: rgba(255,255,255,0.85);
  font-size: clamp(1rem, 1.5vw + 0.25rem, 1.25rem);
  line-height: 1.6;
  max-width: 550px;
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .hero__actions { flex-direction: row; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  min-height: 52px;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn--primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

.btn--primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: var(--white);
}

.btn--secondary {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.btn--secondary:hover { background: #2d8f3d; border-color: #2d8f3d; }

.btn--navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.btn--navy:hover { background: var(--navy-dark); }

.btn--white {
  background: transparent;
  border-color: rgba(255,255,255,0.6);
  color: var(--white);
}

.btn--white:hover {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}

.btn--sm {
  padding: 0.625rem 1.25rem;
  min-height: 44px;
  font-size: 0.75rem;
}

.btn--lg {
  padding: 1rem 2.5rem;
  min-height: 56px;
  font-size: 1rem;
}

/* ===== CTA STICKY ===== */
.btn-cta-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 997;
  text-decoration: none;
  display: none;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

@media (max-width: 767px) {
  .btn-cta-sticky { display: block; }
}

/* ===== WHATSAPP ===== */
.whatsapp-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 996;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.whatsapp-btn svg { width: 28px; height: 28px; fill: white; }

@media (max-width: 767px) {
  .whatsapp-btn { bottom: 4.5rem; right: 1rem; width: 52px; height: 52px; }
  .whatsapp-btn svg { width: 24px; height: 24px; }
}

/* ===== MARQUEE ===== */
.marquee {
  background: var(--gold);
  padding: 1rem 0;
  overflow: hidden;
  white-space: nowrap;
}

.marquee__content {
  display: inline-block;
  animation: marquee 30s linear infinite;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--navy);
  letter-spacing: 0.08em;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== CARDS ===== */
.card {
  padding: 1.5rem;
  border: 2px solid var(--border);
  background: var(--white);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color 0.15s;
  border-radius: 4px;
}

.card:hover { border-color: var(--gold); }

.card__title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.card__text {
  color: var(--navy);
  opacity: 0.85;
  line-height: 1.65;
  flex-grow: 1;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

/* ===== METHOD CARDS ===== */
.method-card {
  padding: 1.75rem;
  background: var(--off-white);
  height: 100%;
  border-bottom: 4px solid var(--navy);
  transition: border-color 0.15s;
  border-radius: 4px 4px 0 0;
}

.method-card:hover { border-color: var(--gold); }

.method-card__number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--navy);
  opacity: 0.15;
  margin-bottom: 0.75rem;
  line-height: 1;
  transition: color 0.15s, opacity 0.15s;
}

.method-card:hover .method-card__number {
  color: var(--gold);
  opacity: 1;
}

/* ===== PROBLEM ITEMS ===== */
.problem-item {
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--gold);
  background: rgba(255,255,255,0.03);
  margin-bottom: 1rem;
  border-radius: 0 4px 4px 0;
}

.problem-item:hover { background: rgba(255,255,255,0.08); }

.problem-item__icon {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gold);
  opacity: 0.4;
  margin-bottom: 0.5rem;
}

.problem-item:hover .problem-item__icon { opacity: 1; }

/* ===== STAT CARDS ===== */
.stat-card {
  border: 1px solid var(--border);
  padding: 1.5rem;
  background: var(--white);
  border-radius: 4px;
  transition: transform 0.2s, border-color 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.stat-card__number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.stat-card__title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy);
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.stat-card__text {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* ===== FEATURE ITEMS ===== */
.feature-item {
  position: relative;
  padding-top: 2rem;
  margin-bottom: 2.5rem;
}

.feature-item:last-child { margin-bottom: 0; }

.number-label {
  font-size: 4rem;
  line-height: 1;
  color: var(--gold);
  opacity: 0.12;
  position: absolute;
  top: 0;
  left: -0.25rem;
  font-weight: 800;
  pointer-events: none;
}

/* ===== GRID ===== */
.grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) {
  .grid { gap: 2rem; }
  .grid--md-2 { grid-template-columns: repeat(2, 1fr); }
  .grid--md-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .grid--lg-3 { grid-template-columns: repeat(3, 1fr); }
  .grid--lg-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ===== FLEX ===== */
.flex {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .flex { flex-direction: row; gap: 1.5rem; }
}

.flex--center { align-items: center; justify-content: center; }
.flex--between { justify-content: space-between; align-items: center; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.875rem;
  min-height: 52px;
  border: 2px solid var(--border);
  background: var(--white);
  font-size: 1rem;
  color: var(--navy);
  border-radius: 4px;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--navy);
  opacity: 0.4;
}

.form-textarea { min-height: 140px; resize: vertical; }

/* ===== FAQ ===== */
.faq-item { border-bottom: 1px solid var(--border); }

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.25rem 0;
  text-align: left;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
  border-radius: 4px;
}

.faq-question:hover { color: var(--gold); }
.faq-question:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.faq-question svg {
  flex-shrink: 0;
  margin-left: 1rem;
  transition: transform 0.2s;
}

.faq-question.active svg { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer.open {
  max-height: 500px;
  padding-bottom: 1.25rem;
}

.faq-answer p { color: var(--navy); opacity: 0.85; }

/* ===== FOOTER ===== */
.footer {
  background: var(--navy);
  color: var(--white);
  padding: 4rem 0 2rem;
}

.footer__logo {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.footer__title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.footer__link {
  display: block;
  padding: 0.5rem 0;
  color: rgba(255,255,255,0.7);
  font-size: 0.9375rem;
  transition: color 0.15s;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.footer__link:hover { color: var(--gold); }
.footer__link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
  font-size: 0.8125rem;
  opacity: 0.5;
}

/* ===== BREADCRUMB ===== */
.breadcrumbs {
  padding: 0.75rem 0;
  font-size: 0.875rem;
  color: var(--navy);
  opacity: 0.6;
}

.breadcrumbs a { color: inherit; }
.breadcrumbs a:hover { color: var(--gold); }

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-white { color: var(--white); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--navy); opacity: 0.7; }

.bg-navy { background: var(--navy); }
.bg-gray { background: var(--off-white); }
.bg-white { background: var(--white); }

.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.w-full { width: 100%; }
.hidden { display: none; }

@media (max-width: 767px) {
  .hidden-mobile { display: none !important; }
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, background 0.15s;
  z-index: 100;
}

.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--gold); color: var(--navy); }
.back-to-top:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ===== REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.active { opacity: 1; transform: translateY(0); }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .reveal { opacity: 1; transform: none; }
  .marquee__content { animation: none; }
}

/* ===== PRINT ===== */
@media print {
  .header, .footer, .btn-cta-sticky, .whatsapp-btn, .back-to-top { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}
