/* ============================================
   Opeosaki - Enfermería 2026 — Landing Nueva
   ============================================ */

/* Self-hosted fonts (RGPD: no Google CDN) */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-stretch: 100%; font-display: swap; src: url('../fonts/bricolage-grotesque-latin.woff2') format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('../fonts/schibsted-grotesk-latin.woff2') format('woff2'); }

/* View Transitions API — Medical cross reveal (dark/light toggle) */
::view-transition-old(root),
::view-transition-new(root) { mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 0; animation: none; }
::view-transition-new(root) { z-index: 1; animation: crossReveal 0.5s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)); }

@keyframes crossReveal {
  from { clip-path: polygon(48% 0%, 52% 0%, 52% 48%, 100% 48%, 100% 52%, 52% 52%, 52% 100%, 48% 100%, 48% 52%, 0% 52%, 0% 48%, 48% 48%); }
  to { clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 100%, 100% 100%, 100% 100%, 0% 100%, 0% 100%, 0% 100%, 0% 0%, 0% 0%); }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Tokens --- */
:root {
  --bg: oklch(97.2% 0.004 175);
  --surface: oklch(93.5% 0.01 175);
  --text: oklch(22% 0.02 55);
  --text-secondary: oklch(42% 0.015 55);
  --text-muted: oklch(56% 0.01 55);

  --primary: oklch(48% 0.1 175);
  --primary-solid: oklch(48% 0.1 175);
  --primary-hover: oklch(42% 0.1 175);
  --primary-soft: oklch(93% 0.035 175);

  --accent: oklch(60% 0.13 65);
  --border: oklch(89% 0.006 55);

  --success-soft: oklch(93% 0.035 175);
  --error: oklch(48% 0.16 25);
  --error-soft: oklch(93% 0.04 25);

  --font-display: 'Bricolage Grotesque', Georgia, serif;
  --font-body: 'Schibsted Grotesk', system-ui, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 100px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: oklch(14.5% 0.007 175);
  --surface: oklch(19% 0.012 175);
  --text: oklch(90% 0.005 55);
  --text-secondary: oklch(68% 0.01 55);
  --text-muted: oklch(52% 0.006 55);

  --primary: oklch(68% 0.1 175);
  --primary-solid: oklch(50% 0.11 175);
  --primary-hover: oklch(56% 0.11 175);
  --primary-soft: oklch(23% 0.035 175);

  --accent: oklch(70% 0.11 65);
  --border: oklch(25% 0.006 55);

  --success-soft: oklch(23% 0.035 175);
  --error: oklch(62% 0.13 25);
  --error-soft: oklch(20% 0.035 25);
}

/* --- Base --- */
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}

::selection {
  background: var(--primary-soft);
  color: var(--text);
}

a, button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }
img, svg { display: block; }

/* --- Focus --- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.btn-cta:focus-visible {
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--primary) 18%, transparent);
}

/* --- Layout --- */
.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding-left: max(clamp(1.25rem, 4vw, 2rem), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(1.25rem, 4vw, 2rem), env(safe-area-inset-right, 0px));
}

/* --- Labels --- */
.label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* ============================================
   Header
   ============================================ */
.header {
  padding: 1rem 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

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

.nav-login {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-login:hover {
  color: var(--primary);
}

/* --- Theme toggle --- */
.theme-toggle {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface);
}

.icon-sun { display: block; }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: clamp(2rem, 7vh, 4.5rem) 0 clamp(2rem, 5vh, 3.5rem);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw + 0.5rem, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  max-width: 520px;
  margin-bottom: 1.25rem;
}

html[data-theme="dark"] .hero h1 {
  line-height: 1.15;
}

.hero .lead {
  font-size: clamp(1rem, 2vw + 0.3rem, 1.12rem);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 460px;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
}

html[data-theme="dark"] .hero .lead {
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  background: var(--primary-solid);
  color: oklch(98% 0 0);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  min-height: 50px;
  transition:
    background 0.2s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.2s;
}

.btn-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px color-mix(in oklch, var(--primary-solid) 22%, transparent);
}

.btn-cta:active {
  transform: scale(0.98);
  box-shadow: none;
}

.btn-cta-sm {
  font-size: 0.92rem;
  padding: 0.72rem 1.5rem;
  min-height: 44px;
}

.btn-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.btn-link:hover {
  color: var(--primary);
}

/* ============================================
   Demo
   ============================================ */
.demo {
  background: var(--surface);
  padding: clamp(2rem, 5vh, 3rem) 0 clamp(2.5rem, 6vh, 4rem);
}

.demo-question {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.demo-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.demo-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.2s var(--ease),
    opacity 0.3s;
  min-height: 48px;
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

/* Hover — pointer devices only */
@media (hover: hover) and (pointer: fine) {
  .demo-option:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-soft);
  }

  .demo-option:hover:not(:disabled) .option-letter {
    color: var(--primary);
  }
}

/* --- Answer states --- */
.demo-option.correct {
  background: var(--success-soft);
  border-color: var(--primary);
  animation: answerCorrect 0.4s var(--ease);
}

.demo-option.correct .option-letter {
  background: var(--primary-solid);
  color: oklch(98% 0 0);
}

.demo-option.incorrect {
  background: var(--error-soft);
  border-color: var(--error);
  animation: answerIncorrect 0.4s ease;
}

.demo-option.incorrect .option-letter {
  background: var(--error);
  color: oklch(98% 0 0);
}

.demo-option.dimmed {
  opacity: 0.35;
}

.demo-option:disabled {
  cursor: default;
}

@keyframes answerCorrect {
  0% { transform: scale(0.97); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

@keyframes answerIncorrect {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* --- Feedback --- */
.demo-feedback {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  animation: fadeUp 0.35s var(--ease);
}

.demo-result {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.demo-result.is-correct { color: var(--primary); }
.demo-result.is-incorrect { color: var(--error); }

.demo-explanation {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* --- Nudge --- */
.demo-nudge {
  text-align: center;
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease);
}

.demo-nudge.visible {
  opacity: 1;
  transform: translateY(0);
}

.demo-nudge p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ============================================
   Showcase sections
   ============================================ */
.showcase {
  padding: clamp(2rem, 5vh, 3rem) 0;
}

.showcase-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.showcase-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
}

.showcase-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.showcase-text span {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Progress bars showcase */
.showcase-progress {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.showcase-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.showcase-bar-header span:last-child {
  color: var(--text-muted);
  font-weight: 600;
}

.showcase-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.showcase-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  transition: width 0.8s var(--ease);
}

.showcase-bar-fill-accent {
  background: var(--accent);
}

.showcase-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ============================================
   Features
   ============================================ */
.features {
  padding: clamp(1.5rem, 4vh, 2.5rem) 0;
}

.feature-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.feature-item {
  padding: 0.85rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.feature-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.feature-item span {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

@media (max-width: 400px) {
  .feature-items {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Pricing
   ============================================ */
.pricing {
  padding: clamp(3rem, 8vh, 5rem) 0 clamp(2rem, 5vh, 3.5rem);
  text-align: center;
}

.price-amount {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.price-detail {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.price-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.price-legal {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

.price-legal a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.price-legal a:hover {
  color: var(--text-secondary);
}

/* ============================================
   Footer
   ============================================ */
footer {
  padding: 3rem 0 clamp(1.5rem, 3vh, 2.5rem);
  padding-bottom: max(clamp(1.5rem, 3vh, 2.5rem), env(safe-area-inset-bottom, 0px));
}

footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--text-secondary);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero staggered entrance */
.hero .label    { animation: fadeUp 0.5s var(--ease) both; }
.hero h1        { animation: fadeUp 0.5s var(--ease) 0.07s both; }
.hero .lead     { animation: fadeUp 0.5s var(--ease) 0.14s both; }
.hero-actions   { animation: fadeUp 0.5s var(--ease) 0.21s both; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
}

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

/* ============================================
   Accessibility — Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   Responsive
   ============================================ */

/* Tablet / iPad (768px+) */
@media (min-width: 768px) {
  html { font-size: 17px; }

  .wrap { max-width: 720px; }

  .hero {
    padding: clamp(2.5rem, 8vh, 5rem) 0 clamp(2rem, 5vh, 4rem);
  }

  .hero h1 {
    font-size: clamp(2.8rem, 5vw, 3.8rem);
    max-width: 640px;
  }

  .hero .lead {
    font-size: 1.15rem;
    max-width: 580px;
  }

  .btn-cta {
    min-height: 54px;
    padding: 0.95rem 2.5rem;
    font-size: 1.05rem;
  }

  .demo-option {
    padding: 1rem 1.25rem;
    min-height: 52px;
    font-size: 0.95rem;
  }

  .option-letter {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .price-amount {
    font-size: clamp(4rem, 8vw, 5.5rem);
  }
}

/* iPad Pro / large tablet (1024px+) */
@media (min-width: 1024px) {
  .wrap { max-width: 820px; }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: clamp(1.75rem, 7vw, 2.2rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-cta {
    width: 100%;
  }

  .btn-link {
    text-align: center;
  }

  .demo-option {
    padding: 0.75rem 0.85rem;
    font-size: 0.88rem;
  }

  .option-letter {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 0.75rem;
  }
}

@media (max-width: 360px) {
  .hero h1 {
    font-size: 1.65rem;
  }

  .price-amount {
    font-size: 3rem;
  }
}
