/* Cuestionario de admisión a pantalla completa y banner de cookies. Usa los tokens de styles.css. */

html.funnel-lock, html.funnel-lock body { overflow: hidden; }

.funnel {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  background: var(--cream); color: var(--ink);
  font-family: var(--font);
  opacity: 0; transition: opacity .25s ease;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.funnel.is-open { opacity: 1; }
.funnel[hidden] { display: none; }

.funnel-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 32px; }
.funnel-logo { width: auto; height: 34px; }
.funnel-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; transition: background-color .2s ease; }
.funnel-close:hover, .funnel-close:focus-visible { background: rgba(0, 53, 45, .08); outline: none; }
.funnel-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.funnel-progress { height: 3px; margin: 0 32px; border-radius: 3px; background: var(--cream-edge); overflow: hidden; }
.funnel-progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .4s var(--ease-out); }

.funnel-body { flex: 1; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: 32px; }

.funnel-step { position: relative; width: 100%; max-width: 720px; opacity: 0; transition: opacity .35s ease, transform .45s var(--ease-out); }
.funnel-step.from-bottom { transform: translateY(36px); }
.funnel-step.from-top { transform: translateY(-36px); }
.funnel-step.is-in { opacity: 1; transform: none; }

.funnel-count { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 15px; font-weight: 600; color: var(--brand); }
.funnel-title { font-size: clamp(24px, 3vw, 32px); font-weight: 500; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
.funnel-title a, .funnel-desc a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.funnel-desc { margin-top: 10px; font-size: 18px; line-height: 1.45; color: var(--grey); }

.funnel-input {
  display: block; width: 100%; margin-top: 32px; padding: 6px 0 10px;
  border: 0; border-bottom: 2px solid rgba(0, 53, 45, .35); border-radius: 0;
  background: transparent; color: var(--brand);
  font: 400 clamp(22px, 2.6vw, 30px)/1.3 var(--font);
  outline: none; transition: border-color .2s ease;
}
.funnel-input::placeholder { color: rgba(0, 53, 45, .3); }
.funnel-input:focus { border-bottom-color: var(--brand); }

.funnel-phone { display: flex; align-items: flex-end; gap: 14px; }
.funnel-phone .funnel-input { flex: 1; min-width: 0; }
.funnel-prefix {
  flex: none; margin-top: 32px; padding: 8px 6px 12px;
  border: 0; border-bottom: 2px solid rgba(0, 53, 45, .35); border-radius: 0;
  background: transparent; color: var(--brand);
  font: 500 18px/1.3 var(--font); cursor: pointer; outline: none;
}
.funnel-prefix:focus { border-bottom-color: var(--brand); }

.funnel-options { display: grid; gap: 10px; margin-top: 28px; max-width: 520px; }
.funnel-options.is-legal { grid-template-columns: repeat(2, minmax(0, 200px)); }
.funnel-option {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px;
  border: 1px solid rgba(0, 53, 45, .3); border-radius: 10px;
  background: rgba(0, 53, 45, .04); color: var(--brand);
  font: 500 18px/1.3 var(--font); text-align: left; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.funnel-option:hover, .funnel-option:focus-visible { background: rgba(0, 53, 45, .1); outline: none; }
.funnel-option:focus-visible { border-color: var(--brand); }
.funnel-key { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; border: 1px solid rgba(0, 53, 45, .4); border-radius: 6px; background: #fff; font-size: 13px; font-weight: 700; }
.funnel-option-label { flex: 1; }
.funnel-check { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.funnel-option.is-selected { border-color: var(--brand); background: rgba(0, 53, 45, .14); }
.funnel-option.is-selected .funnel-key { background: var(--brand); border-color: var(--brand); color: #fff; }
.funnel-option.is-selected .funnel-check { opacity: 1; }
.funnel-option.is-blinking { animation: funnel-blink .32s steps(2, start) 1; }
@keyframes funnel-blink { 50% { background: rgba(0, 53, 45, .04); } }

.funnel-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 28px; }
.funnel-next {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 26px;
  border: var(--btn-edge); border-radius: 999px;
  background: var(--btn-grad); box-shadow: var(--btn-glow); color: #fff;
  font: 700 17px/1 var(--font); cursor: pointer; transition: filter .2s ease, transform .2s ease;
}
.funnel-next:hover, .funnel-next:focus-visible { filter: brightness(1.12); transform: translateY(-1px); outline: none; }
.funnel-next svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.funnel-hint { font-size: 13px; color: var(--grey); }
.funnel-hint b { font-weight: 600; }
.funnel-link { border: 0; background: none; padding: 8px 4px; color: var(--brand); font: 500 16px/1 var(--font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.funnel-error { display: inline-flex; margin-top: 16px; padding: 6px 12px; border-radius: 6px; background: #fdecea; color: #a12d22; font-size: 15px; }
.funnel-error[hidden] { display: none; }

.funnel-back {
  position: fixed; right: 32px; bottom: calc(28px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 0; border-radius: 10px; background: var(--brand); color: #fff; cursor: pointer;
  transition: filter .2s ease;
}
.funnel-back[hidden] { display: none; }
.funnel-back:hover, .funnel-back:focus-visible { filter: brightness(1.25); outline: none; }
.funnel-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.funnel-status { text-align: left; }
.funnel-spinner { display: block; width: 36px; height: 36px; margin-bottom: 22px; border: 3px solid var(--cream-edge); border-top-color: var(--brand); border-radius: 50%; animation: funnel-spin .8s linear infinite; }
@keyframes funnel-spin { to { transform: rotate(360deg); } }
.funnel-done-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 22px; border-radius: 50%; background: var(--btn-grad); color: #fff; }
.funnel-done-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 640px) {
  .funnel-top { padding: 14px 16px; }
  .funnel-logo { height: 28px; }
  .funnel-progress { margin: 0 16px; }
  .funnel-body { align-items: flex-start; padding: 40px 16px 96px; }
  .funnel-desc { font-size: 16px; }
  .funnel-option { font-size: 16px; }
  .funnel-options.is-legal { grid-template-columns: 1fr 1fr; }
  .funnel-hint { display: none; }
  .funnel-back { right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .funnel, .funnel-step, .funnel-progress i { transition: none; }
  .funnel-step.from-bottom, .funnel-step.from-top { transform: none; }
  .funnel-option.is-blinking, .funnel-spinner { animation: none; }
}

/* Banner de cookies */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 150;
  display: flex; align-items: center; gap: 20px; max-width: 760px; margin: 0 auto; padding: 18px 20px;
  border: 1px solid var(--cream-edge); border-radius: 18px;
  background: #fff; color: var(--ink); box-shadow: 0 20px 48px rgba(15, 30, 25, .16);
  font: 400 14px/1.5 var(--font);
}
.cookie-text { flex: 1; }
.cookie-text a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.cookie-actions { display: flex; gap: 10px; flex: none; }
.cookie-btn {
  min-width: 112px; min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--brand); border-radius: 999px;
  background: #fff; color: var(--brand); font: 600 15px/1 var(--font); cursor: pointer;
}
.cookie-btn:hover, .cookie-btn:focus-visible { filter: brightness(1.1); outline: 2px solid transparent; }
.cookie-settings { margin-left: 16px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; opacity: .8; }

@media (max-width: 640px) {
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 14px; }
  .cookie-actions .cookie-btn { flex: 1; }
}
