/* ============================================================
   DESIGN TOKENS
   Colores: amarillo (acento) + verde (confianza). El rojo se
   reserva únicamente para errores de validación del formulario.
   ============================================================ */
:root {
  color-scheme: dark;

  /* Color */
  --c-base: 8 20 15;
  --c-surface: 13 32 23;
  --c-raised: 20 46 33;
  --c-fg: 244 244 235;
  --c-muted: 165 181 168;
  --c-line: 244 244 235;
  --c-accent: 250 204 51;
  --c-accent-soft: 255 230 138;
  --c-on-accent: 8 20 15;
  --c-success: 51 210 113;
  --c-warning: 245 166 34;
  --c-danger: 248 113 105;

  /* Tipografía */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --tracking-wide: .18em;
  --tracking-label: .25em;

  /* Espaciado */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 5rem;
  --space-16: 8rem;

  /* Bordes y radios */
  --radius-sm: .5rem;
  --radius-md: .8rem;
  --radius-card: 1.25rem;
  --radius-pill: 9999px;
  --line-soft: rgb(var(--c-line) / .10);
  --line-strong: rgb(var(--c-line) / .22);

  /* Sombras */
  --shadow-card: 0 24px 60px -30px rgb(0 0 0 / .7);
  --shadow-float: 0 18px 40px -16px rgb(0 0 0 / .55);
  --shadow-accent: 0 14px 32px -14px rgb(250 204 51 / .45);

  /* Layout */
  --container-max: 80rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 1280px) { :root { --container-max: 84rem; } }
@media (min-width: 1536px) { :root { --container-max: 90rem; } }

/* ============================================================
   BASE
   ============================================================ */
html { scroll-behavior: smooth; }
body {
  background-color: rgb(var(--c-base));
  color: rgb(var(--c-fg));
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}
img { max-width: 100%; }
h1, h2, h3, .font-display { font-family: var(--font-display); }
section[id] { scroll-margin-top: 5.5rem; }
::selection { background: rgb(var(--c-accent) / .35); }
:focus-visible {
  outline: 2px solid rgb(var(--c-accent));
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
.skip-link {
  position: fixed; top: .75rem; left: .75rem; z-index: 1500;
  transform: translateY(-150%);
  background: rgb(var(--c-accent)); color: rgb(var(--c-on-accent));
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .85rem;
}
.skip-link:focus { transform: translateY(0); }
[hidden] { display: none !important; }

.container-page {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* ============================================================
   COMPONENTES
   ============================================================ */
.site-header {
  background: rgb(var(--c-base) / .78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}
.card {
  background: rgb(var(--c-surface) / .92);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: border-color .2s var(--ease), background-color .3s ease, transform .2s var(--ease);
}
.card-hover:hover {
  border-color: rgb(var(--c-accent) / .4);
  transform: translateY(-2px);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 44px; padding: .7rem 1.5rem; border-radius: var(--radius-pill);
  font-size: .875rem; font-weight: 600; line-height: 1.2;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease,
              transform .2s var(--ease), box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: rgb(var(--c-accent));
  color: rgb(var(--c-on-accent));
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  background: rgb(var(--c-accent-soft));
  transform: translateY(-1px);
  box-shadow: 0 18px 38px -14px rgb(var(--c-accent) / .55);
}
.btn-ghost {
  border: 1px solid var(--line-strong);
  color: rgb(var(--c-fg) / .88);
  background: transparent;
}
.btn-ghost:hover { border-color: rgb(var(--c-accent) / .55); color: rgb(var(--c-accent)); }
.hero .btn-ghost { border-color: rgb(242 240 233 / .28); color: rgb(242 240 233 / .88); }
.hero .btn-ghost:hover { border-color: #FACC33; color: #FFE68A; }

/* Estado de carga de una acción: sin spinner, con shimmer */
.btn.is-loading { pointer-events: none; position: relative; overflow: hidden; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 15%, rgb(255 255 255 / .28) 45%, transparent 70%);
  background-size: 220% 100%;
  animation: shimmer 1.1s linear infinite;
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-soft);
  color: rgb(var(--c-fg) / .8);
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.icon-btn:hover {
  color: rgb(var(--c-accent));
  border-color: rgb(var(--c-accent) / .5);
  background: rgb(var(--c-accent) / .08);
}
.eyebrow {
  font-size: .6875rem; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: rgb(var(--c-accent)); font-weight: 600;
}
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .35rem .7rem; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  color: rgb(var(--c-muted));
}
.section-pad { padding-top: var(--space-10); padding-bottom: var(--space-10); }
@media (min-width: 640px) { .section-pad { padding-top: var(--space-12); padding-bottom: var(--space-12); } }
@media (min-width: 1024px) { .section-pad { padding-top: var(--space-16); padding-bottom: var(--space-16); } }
.section-divider {
  height: 1px; max-width: 64rem; margin: 0 auto;
  background: linear-gradient(90deg, transparent, rgb(var(--c-accent) / .4), transparent);
}
.accent-gradient {
  background: linear-gradient(135deg, #FFE68A 0%, #FACC33 48%, #A87C12 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.badge-accent {
  background: rgb(var(--c-accent));
  color: rgb(var(--c-on-accent));
}

/* Hero: oscuro en ambos temas */
.hero {
  --c-accent: 250 204 51;
  --c-accent-soft: 255 230 138;
  --c-success: 51 210 113;
}
.hero-overlay {
  background: linear-gradient(180deg, rgb(6 16 12 / .42) 0%, rgb(6 16 12 / .6) 52%, rgb(6 16 12 / .97) 100%);
}
.hero h1 { text-shadow: 0 4px 36px rgb(6 16 12 / .5); }
.hero-glow {
  background: radial-gradient(60% 55% at 50% 42%, rgb(28 88 49 / .45) 0%, rgb(6 16 12 / 0) 70%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .85rem; border-radius: var(--radius-pill);
  border: 1px solid rgb(242 240 233 / .22);
  background: rgb(6 16 12 / .35);
  backdrop-filter: blur(8px);
  font-size: .6875rem; letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: rgb(242 240 233 / .9);
}
.dot { width: 7px; height: 7px; border-radius: var(--radius-pill); background: currentColor; flex: none; }
.dot-live { color: #33D271; box-shadow: 0 0 0 0 rgb(51 210 113 / .55); animation: pulse 2.2s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(51 210 113 / .45); }
  70% { box-shadow: 0 0 0 8px rgb(51 210 113 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(51 210 113 / 0); }
}

/* Media: esqueleto de carga, error y reintento */
.media {
  position: relative; overflow: hidden; isolation: isolate;
  background: rgb(var(--c-raised));
  border-radius: inherit;
}
.media img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  opacity: 1; transition: opacity .45s ease, transform .7s var(--ease);
}
.media.is-loading img { opacity: 0; }
.media.is-loading::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg,
    rgb(var(--c-fg) / .03) 15%,
    rgb(var(--c-fg) / .12) 40%,
    rgb(var(--c-fg) / .03) 65%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}
.media.is-error img { display: none; }
.media-fallback {
  display: none; position: absolute; inset: 0; z-index: 2;
  flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  padding: var(--space-4); text-align: center;
  background: rgb(var(--c-raised));
  color: rgb(var(--c-muted));
}
.media.is-error .media-fallback { display: flex; }
.media-fallback p { font-size: .75rem; }
.retry {
  margin-top: var(--space-1); font-size: .6875rem; font-weight: 600;
  min-height: 32px; padding: .25rem .7rem; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  color: rgb(var(--c-fg)); background: rgb(var(--c-base) / .4);
}
.retry:hover { border-color: rgb(var(--c-accent)); color: rgb(var(--c-accent)); }
@keyframes shimmer { to { background-position: -220% 0; } }

/* Formulario */
.field label { display: block; font-size: .8rem; font-weight: 500; margin-bottom: .4rem; }
.input {
  width: 100%; min-height: 46px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: rgb(var(--c-base) / .5);
  color: rgb(var(--c-fg));
  padding: .7rem .9rem; font-size: .9rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input::placeholder { color: rgb(var(--c-muted) / .85); }
.input:focus {
  outline: 2px solid rgb(var(--c-accent)); outline-offset: 1px; border-color: transparent;
}
.field.is-invalid .input { border-color: rgb(var(--c-danger)); }
.field-error { margin-top: .35rem; font-size: .75rem; color: rgb(var(--c-danger)); }
.field.is-valid .input { border-color: rgb(var(--c-success) / .6); }
.field-check label { display: inline; font-size: inherit; font-weight: 400; margin: 0; }
.checkbox {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 18px; height: 18px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgb(var(--c-base) / .6);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.checkbox:checked {
  background: rgb(var(--c-accent));
  border-color: rgb(var(--c-accent));
}
.checkbox:checked::after {
  content: "";
  display: block;
  width: 4px; height: 9px;
  margin: 2px auto 0;
  border: solid rgb(var(--c-on-accent));
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox:focus-visible { outline: 2px solid rgb(var(--c-accent)); outline-offset: 2px; }
.field.is-invalid .checkbox { border-color: rgb(var(--c-danger)); }

/* Toast y CTA flotante */
.toast {
  position: fixed; left: 50%; bottom: 6rem; z-index: 1300;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1.1rem; border-radius: var(--radius-pill);
  background: rgb(var(--c-surface)); color: rgb(var(--c-fg));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-float);
  font-size: .8125rem; font-weight: 500; white-space: nowrap;
  animation: toast-in .25s var(--ease);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  display: flex; align-items: center; gap: 10px;
  background: #25D366; color: #fff; padding: 12px 20px;
  border-radius: var(--radius-pill); font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 32px rgb(37 211 102 / .35);
  transition: transform .2s var(--ease), box-shadow .2s ease;
}
.whatsapp-float:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgb(37 211 102 / .5); }

/* Ajustes responsive */
@media (max-width: 640px) {
  .whatsapp-float { bottom: 16px; right: 16px; padding: 12px; }
  .toast { bottom: 5.25rem; max-width: calc(100vw - 2rem); white-space: normal; text-align: left; }
}
@media (min-width: 1280px) {
  .hero-inner {
    max-width: var(--container-max);
    padding-inline: clamp(1rem, 4vw, 2rem);
    padding-top: var(--space-10);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
