/* ==========================================================================
   EGONIA — egonia.site
   Hoja de estilos principal
   ========================================================================== */

:root {
  /* Paleta */
  --navy-950: #050D1A;
  --navy-900: #0A1628;
  --navy-800: #12233D;
  --navy-700: #1B3355;
  --blue-500: #2E7CF6;
  --cyan-400: #38BDF8;
  --emerald-400: #2DD4A8;
  --white: #FFFFFF;
  --off-white: #F4F7FB;
  --slate-300: #B8C6DA;
  --slate-400: #94A6BE;
  --slate-500: #6B7F99;

  --grad-brand: linear-gradient(135deg, var(--blue-500), var(--emerald-400));
  --grad-text: linear-gradient(100deg, #6EA8FF, var(--cyan-400) 45%, var(--emerald-400));

  /* Tipografía */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Layout */
  --container: 1140px;
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 76px;

  --shadow-glow-blue: 0 0 40px rgba(46, 124, 246, 0.25);
  --shadow-card: 0 18px 46px rgba(2, 8, 20, 0.5);
  --border-glass: 1px solid rgba(148, 166, 190, 0.16);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--slate-300);
  background-color: var(--navy-950);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--white);
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

a { color: var(--cyan-400); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--emerald-400); }

ul { padding-left: 1.3em; }

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- Utilidades ---------- */
.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section { padding: 6.5rem 0; position: relative; }
.section--alt { background: var(--navy-900); }

.section-head { max-width: 640px; margin-bottom: 3.5rem; }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--emerald-400);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--grad-brand);
  border-radius: 2px;
}
.section-head--center .eyebrow::after {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--grad-brand);
  border-radius: 2px;
}

.section-title { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.section-sub { color: var(--slate-400); font-size: 1.06rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, border-color 0.22s ease;
  white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; flex: none; }

.btn--primary {
  background: var(--grad-brand);
  color: var(--white);
  box-shadow: 0 8px 26px rgba(46, 124, 246, 0.35);
}
.btn--primary:hover {
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(45, 212, 168, 0.4);
}

.btn--ghost {
  background: transparent;
  color: var(--off-white);
  border: 1px solid rgba(148, 166, 190, 0.35);
}
.btn--ghost:hover {
  color: var(--white);
  border-color: var(--emerald-400);
  transform: translateY(-2px);
}

.btn--sm { padding: 0.55rem 1.25rem; font-size: 0.9rem; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(5, 13, 26, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(148, 166, 190, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--white);
}
.brand:hover { color: var(--white); }
.brand img { width: 40px; height: 40px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: 0.3em;
  color: var(--off-white);
}

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--slate-300);
  position: relative;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--grad-brand);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.main-nav a:hover { color: var(--white); }
.main-nav a:hover::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 1rem; }

/* Selector de idioma */
.lang-toggle {
  display: inline-flex;
  border: 1px solid rgba(148, 166, 190, 0.3);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(10, 22, 40, 0.6);
}
.lang-toggle button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--slate-400);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.42rem 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.lang-toggle button.is-active {
  background: var(--grad-brand);
  color: var(--white);
}

/* Menú hamburguesa */
.nav-toggle {
  display: none;
  appearance: none;
  background: transparent;
  border: 1px solid rgba(148, 166, 190, 0.3);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--off-white);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 4rem) 0 5rem;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(720px 500px at 78% 18%, rgba(46, 124, 246, 0.18), transparent 65%),
    radial-gradient(640px 460px at 12% 82%, rgba(45, 212, 168, 0.12), transparent 65%),
    var(--navy-950);
}
#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.hero-content { max-width: 760px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  border: var(--border-glass);
  background: rgba(18, 35, 61, 0.55);
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--slate-300);
  margin-bottom: 1.6rem;
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 10px var(--emerald-400);
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--slate-400);
  max-width: 580px;
  margin-bottom: 2.4rem;
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3.5rem; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.6rem;
}
.hero-stat .num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
}
.hero-stat .lbl { font-size: 0.88rem; color: var(--slate-500); }

/* ---------- Tarjetas de servicios ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  position: relative;
  background: linear-gradient(160deg, rgba(18, 35, 61, 0.65), rgba(10, 22, 40, 0.85));
  border: var(--border-glass);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 180px at 20% 0%, rgba(46, 124, 246, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(45, 212, 168, 0.45);
  box-shadow: var(--shadow-card), var(--shadow-glow-blue);
}
.card:hover::before { opacity: 1; }

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(46, 124, 246, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 1.3rem;
}
.card-icon svg { width: 26px; height: 26px; stroke: url(#icon-grad); }

.card h3 { font-size: 1.18rem; margin-bottom: 0.55rem; }
.card p { font-size: 0.95rem; color: var(--slate-400); margin: 0; }

/* ---------- Nosotros ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-visual {
  position: relative;
  border-radius: var(--radius);
  border: var(--border-glass);
  background:
    radial-gradient(400px 300px at 70% 20%, rgba(46, 124, 246, 0.2), transparent 70%),
    radial-gradient(340px 280px at 20% 85%, rgba(45, 212, 168, 0.16), transparent 70%),
    var(--navy-900);
  padding: 3rem;
  display: grid;
  place-items: center;
  min-height: 380px;
}
.about-visual img { width: 180px; height: 180px; filter: drop-shadow(0 0 34px rgba(46, 124, 246, 0.45)); }

.feature-list { display: grid; gap: 1.4rem; margin-top: 2rem; }
.feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.feature-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(45, 212, 168, 0.1);
  border: 1px solid rgba(45, 212, 168, 0.3);
}
.feature-icon svg { width: 21px; height: 21px; stroke: var(--emerald-400); }
.feature h4 { font-size: 1.02rem; margin-bottom: 0.2rem; }
.feature p { font-size: 0.92rem; color: var(--slate-400); margin: 0; }

/* ---------- Proceso ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 1.9rem 1.6rem;
  border-radius: var(--radius);
  border: var(--border-glass);
  background: rgba(18, 35, 61, 0.4);
}
.step-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
}
.step h3 { font-size: 1.08rem; }
.step p { font-size: 0.92rem; color: var(--slate-400); margin: 0; }

/* ---------- CTA banner ---------- */
.cta-banner {
  position: relative;
  border-radius: calc(var(--radius) + 6px);
  padding: 4rem 3rem;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(600px 300px at 50% -40%, rgba(56, 189, 248, 0.35), transparent 70%),
    linear-gradient(135deg, #10305E, #0B3D33);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.cta-banner h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); max-width: 620px; margin-inline: auto; }
.cta-banner p { color: var(--slate-300); max-width: 520px; margin: 0 auto 2rem; }

/* ---------- Contacto ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.contact-card {
  text-align: center;
  padding: 2.4rem 1.8rem;
}
.contact-card .card-icon { margin-inline: auto; }
.contact-card .value {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--off-white);
  word-break: break-word;
}
.contact-card .value:hover { color: var(--emerald-400); }
.contact-card p { font-size: 0.9rem; color: var(--slate-500); margin: 0.35rem 0 0; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(148, 166, 190, 0.12);
  background: var(--navy-900);
  padding: 3.5rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand p { font-size: 0.92rem; color: var(--slate-400); max-width: 300px; margin-top: 1rem; }
.footer-col h4 {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin-bottom: 1.1rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.footer-col a { color: var(--slate-300); font-size: 0.94rem; }
.footer-col a:hover { color: var(--emerald-400); }

.footer-bottom {
  border-top: 1px solid rgba(148, 166, 190, 0.1);
  padding-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: var(--slate-500);
}

/* ---------- Botón flotante de WhatsApp ---------- */
.whatsapp-fab {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #22C15E, #128C7E);
  box-shadow: 0 10px 28px rgba(18, 140, 126, 0.45);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.whatsapp-fab svg { width: 28px; height: 28px; fill: #fff; }
.whatsapp-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 14px 34px rgba(18, 140, 126, 0.6); }

/* ---------- Páginas legales ---------- */
.legal-hero {
  padding: calc(var(--header-h) + 4.5rem) 0 3rem;
  background:
    radial-gradient(600px 340px at 80% 0%, rgba(46, 124, 246, 0.15), transparent 70%),
    var(--navy-950);
  border-bottom: 1px solid rgba(148, 166, 190, 0.1);
}
.legal-hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
.legal-hero .meta { color: var(--slate-500); font-size: 0.92rem; }

.legal-body { padding: 3.5rem 0 5.5rem; }
.legal-body .container { max-width: 800px; }
.legal-body h2 {
  font-size: 1.4rem;
  margin-top: 2.6rem;
  padding-top: 1.4rem;
}
.legal-body h2:not(:first-child) { border-top: 1px solid rgba(148, 166, 190, 0.12); }
.legal-body h3 { font-size: 1.12rem; margin-top: 1.8rem; }
.legal-body p, .legal-body li { color: var(--slate-300); font-size: 0.99rem; }
.legal-body li { margin-bottom: 0.5rem; }
.legal-body strong { color: var(--off-white); }

.notice-box {
  border: 1px solid rgba(45, 212, 168, 0.35);
  border-left: 4px solid var(--emerald-400);
  background: rgba(45, 212, 168, 0.07);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.4rem;
  margin: 1.6rem 0;
}
.notice-box p { margin: 0; }

.steps-list {
  list-style: none;
  padding: 0;
  margin: 1.6rem 0;
  display: grid;
  gap: 1.1rem;
  counter-reset: dstep;
}
.steps-list li {
  counter-increment: dstep;
  position: relative;
  padding: 1.2rem 1.4rem 1.2rem 4.2rem;
  border: var(--border-glass);
  border-radius: var(--radius-sm);
  background: rgba(18, 35, 61, 0.4);
  margin: 0;
}
.steps-list li::before {
  content: counter(dstep);
  position: absolute;
  left: 1.2rem;
  top: 1.15rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad-brand);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

/* ---------- Animación de aparición ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .whatsapp-fab { transition: none; }
  #hero-canvas { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .services-grid, .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-visual { min-height: 300px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

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

  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(5, 13, 26, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(148, 166, 190, 0.14);
    padding: 0.6rem 1.25rem 1.2rem;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }
  .main-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .main-nav a { padding: 0.85rem 0.2rem; border-bottom: 1px solid rgba(148, 166, 190, 0.08); }
  .main-nav a::after { display: none; }
  .header-cta { display: none; }

  .services-grid, .contact-grid, .process-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .cta-banner { padding: 3rem 1.6rem; }
  .hero-stats { gap: 1.8rem; }
}
