/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f3f8fd;
  --bg-paper: #ffffff;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-2: rgba(255, 255, 255, 0.32);
  --glass-border: rgba(255, 255, 255, 0.6);
  --ink: #12274a;
  --ink-soft: #3d5674;
  --ink-mute: #6c84a0;
  --accent: #2170e0;
  --accent-2: #14b3ac;
  --accent-soft: #e4eefc;
  --line: rgba(18, 39, 74, 0.1);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Manrope", var(--sans);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  text-wrap: balance;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
}
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: #fff;
  z-index: 9999; border-radius: 8px; font-weight: 600; font-size: 14px;
}
.skip-link:focus { top: 1rem; }

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

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; } /* defensive — gotcha A.4.5 */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-2);
}

/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .95rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background .35s var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 14px 30px -10px rgba(33, 112, 224, 0.55);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 38px -12px rgba(33, 112, 224, 0.6); }
.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.btn-ghost:hover { transform: translateY(-3px); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* =============================================================
   4b. Aviso de entorno de pruebas (regulatorio)
   ============================================================= */
.test-env-banner {
  background: #f2e3c8;
  border-bottom: 1px solid #c08a3d;
  color: #5c4108;
  font-size: .8rem;
  font-weight: 600;
  text-align: center;
  padding: .5rem 1rem;
}

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: .9rem 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem .7rem .55rem 1.1rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 10px 30px -18px rgba(18, 39, 74, 0.25);
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--ink); font-size: 15px; }
.brand span { white-space: nowrap; }
.brand img { width: 30px; height: 30px; object-fit: contain; }

@media (max-width: 480px) {
  .brand { gap: .4rem; font-size: 11.5px; }
  .brand img { width: 26px; height: 26px; }
}
.nav .btn { padding: .65rem 1.25rem; font-size: 13.5px; }

.nav-actions { display: flex; align-items: center; gap: .5rem; }

.lang-switch { position: relative; }
.lang-switch summary {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  list-style: none;
  padding: .5rem .7rem;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background .25s var(--ease-out), color .25s var(--ease-out);
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { background: var(--accent-soft); color: var(--accent); }
.lang-switch[open] summary { background: var(--accent-soft); color: var(--accent); }
.lang-switch .flag { width: 18px; height: 13px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(18, 39, 74, 0.12) inset; }
.lang-switch .chevron { width: 12px; height: 12px; flex: none; transition: transform .3s var(--ease-out); }
.lang-switch[open] .chevron { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  z-index: 99;
  display: grid;
  gap: .15rem;
  min-width: 150px;
  padding: .5rem;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 22px 40px -18px rgba(18, 39, 74, 0.35);
}
.lang-menu a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .7rem;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background .25s var(--ease-out), color .25s var(--ease-out);
}
.lang-menu a:hover { background: var(--accent-soft); color: var(--accent); }
.lang-menu a.is-active { color: var(--accent); font-weight: 700; }

.menu-btn {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--ink);
  transition: background .3s var(--ease-out), color .3s var(--ease-out);
}
.menu-btn:hover { background: var(--accent-soft); color: var(--accent); }
.menu-btn svg { width: 20px; height: 20px; }

.site-menu {
  display: none;
  position: absolute;
  top: calc(100% + .6rem);
  right: 1.25rem;
  z-index: 99;
  flex-direction: column;
  gap: .2rem;
  min-width: 220px;
  padding: .6rem;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 22px 40px -18px rgba(18, 39, 74, 0.35);
}
.site-menu.is-open { display: flex; }
.site-menu a {
  padding: .65rem .8rem;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background .25s var(--ease-out), color .25s var(--ease-out);
}
.site-menu a:hover { background: var(--accent-soft); color: var(--accent); }

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative;
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
  overflow: clip;
}
.hero-mesh {
  position: absolute;
  inset: -10% -10% 0 -10%;
  z-index: -1;
  background:
    radial-gradient(at 18% 22%, rgba(33, 112, 224, 0.24) 0%, transparent 55%),
    radial-gradient(at 82% 15%, rgba(20, 179, 172, 0.22) 0%, transparent 55%),
    radial-gradient(at 55% 70%, rgba(33, 112, 224, 0.14) 0%, transparent 60%);
  filter: blur(60px) saturate(140%);
  animation: meshDrift 26s ease-in-out infinite;
}
@keyframes meshDrift {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(6deg); }
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-note { font-size: 13px; color: var(--ink-mute); display: flex; align-items: center; gap: .45rem; margin-top: 1rem; }
.hero-note .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); display: inline-block; }

.hero-visual { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-figure { position: relative; width: min(340px, 78vw); }
.hero-figure img {
  width: 100%;
  filter: drop-shadow(0 40px 60px rgba(18, 39, 74, 0.28));
}
.hero-figure-logo { width: min(420px, 84vw); }
.hero-figure-logo img { border-radius: var(--radius-lg); }

.hero-download-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .85rem; margin-top: 2rem; }
.btn-disabled {
  background: rgba(18, 39, 74, 0.08);
  color: var(--ink-mute);
  cursor: not-allowed;
}
.btn-disabled:hover { transform: none; box-shadow: none; }

/* =============================================================
   7. Glass cards / features
   ============================================================= */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); position: relative; }
.section-head { max-width: 640px; margin-bottom: clamp(2rem, 5vw, 3rem); }
.section-head h1, .section-head h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: .6rem; }
.section-head p { margin-top: .85rem; font-size: 16px; }
.privacy-h2 { font-size: 16px; margin-bottom: .5rem; }

.glass-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
@supports (backdrop-filter: blur(20px)) {
  .glass-card {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
  }
}
.glass-card:hover { transform: translateY(-6px); box-shadow: 0 26px 44px -22px rgba(18, 39, 74, 0.3); }

.feature-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) { .feature-grid { grid-template-columns: repeat(4, 1fr); } }

.feature-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
}
.feature-icon img { width: 30px; height: 30px; object-fit: contain; }
.feature-card h3 { font-size: 16.5px; margin-bottom: .5rem; }
.feature-card p { font-size: 13.5px; line-height: 1.55; }

/* =============================================================
   7b. Audience toggle (pacientes / médicos)
   ============================================================= */
.audience-toggle {
  display: inline-flex;
  gap: .3rem;
  padding: .3rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  margin-bottom: 1.6rem;
}
.audience-tab {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.15rem;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background .35s var(--ease-out), color .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.audience-tab img { width: 18px; height: 18px; }
.audience-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 24px -12px rgba(33, 112, 224, 0.55);
}

.audience-panels { position: relative; }
.audience-panel {
  max-width: 720px;
}
.audience-panel[hidden] { display: none; }
.audience-panel h3 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin-bottom: .6rem; }
.audience-lede { font-size: 15.5px; margin-bottom: 1.3rem; }
.audience-points { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.6rem; }
.audience-points li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.audience-points li::before {
  content: "";
  position: absolute;
  left: 0; top: .5em;
  width: 9px; height: 9px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* =============================================================
   8. Steps ("cómo funciona")
   ============================================================= */
.steps {
  display: grid;
  gap: 1.1rem;
}
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.step-card { position: relative; }
.step-num {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .06em;
}
.step-card h3 { font-size: 17px; margin: .6rem 0 .5rem; }
.step-card p { font-size: 14px; }

/* =============================================================
   8b. Quiénes somos
   ============================================================= */
.founder-card { max-width: 780px; margin-inline: auto; }
.founder-person { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.founder-avatar {
  width: 84px; height: 84px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 10px 24px -10px rgba(18, 39, 74, 0.4);
}
.founder-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.founder-name { font-weight: 700; color: var(--ink); font-size: 15px; }
.founder-role { font-size: 13px; color: var(--ink-mute); }
.founder-quote {
  margin: 0 0 1.5rem;
  padding-left: 1.1rem;
  border-left: 3px solid var(--accent);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  line-height: 1.35;
  color: var(--ink);
}
.founder-bio { display: flex; flex-direction: column; gap: 1rem; }
.founder-bio p { font-size: 14.5px; line-height: 1.65; }

/* =============================================================
   9. Download CTA
   ============================================================= */
.cta-panel {
  border-radius: var(--radius-lg);
  padding: clamp(2.2rem, 6vw, 3.6rem);
  background: linear-gradient(135deg, rgba(33, 112, 224, 0.94), rgba(20, 179, 172, 0.92));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: flex-start;
  position: relative;
  overflow: clip;
}
.cta-panel::before {
  content: "";
  position: absolute;
  inset: -40% -20% -60% -20%;
  background: radial-gradient(45% 45% at 80% 20%, rgba(255,255,255,0.28), transparent 70%);
  pointer-events: none;
}
.cta-panel h2 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.3rem); max-width: 18ch; }
.cta-panel p { color: rgba(255,255,255,0.88); max-width: 52ch; font-size: 15.5px; }
.cta-panel .btn-primary { background: #fff; color: var(--accent); box-shadow: 0 16px 32px -14px rgba(0,0,0,0.35); }
.cta-panel .btn-primary:hover { transform: translateY(-3px); }
.cta-foot { font-size: 12.5px; color: rgba(255,255,255,0.75); }

/* =============================================================
   10. Footer
   ============================================================= */
.footer {
  padding-block: 2.4rem 3rem;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 13px;
  color: var(--ink-mute);
}
.footer-inner .brand { color: var(--ink-mute); }
.footer-inner .brand img { width: 22px; height: 22px; }

/* =============================================================
   11. Responsive extras
   ============================================================= */
@media (min-width: 1280px) {
  .container { padding-inline: 2rem; }
}
