/* ==========================================================
   Yeca · QR de regalo · Estilos
   Paleta tomada del Anexo Operativo (Bungee/Allura PDF):
   navy #1F3A6B · orange #FF7A2E · cream #FBEFC2 · ink #1A1815
   ========================================================== */

:root {
  --navy:        #1F3A6B;
  --navy-dk:     #152849;
  --orange:      #FF7A2E;
  --orange-dk:   #E56118;
  --cream:       #F5DA82;
  --cream-lt:    #FBEFC2;
  --moss:        #4A6D3A;
  --clay:        #9B3F2E;
  --ink:         #1A1815;
  --ink-soft:    #3F3B35;
  --ink-mute:    #7A7367;
  --line:        #D9D5CD;
  --line-soft:   #EFEAE0;
  --white:       #FFFFFF;

  --radius:      12px;
  --radius-lg:   16px;
  --radius-pill: 999px;

  --shadow-sm:   0 1px 2px rgba(31, 58, 107, .08);
  --shadow-md:   0 4px 14px rgba(31, 58, 107, .12);

  --font:        'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body {
  background: var(--cream-lt);
  min-height: 100vh;
  min-height: 100dvh;
}

/* App container — mobile-first, max 440px on wide screens */
.app {
  max-width: 440px;
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 22px 32px;
  animation: fadeIn .25s ease-out;
}
.screen.is-active { display: flex; }

.screen--landing,
.screen--regalo,
.screen--confirma { background: var(--cream-lt); }

.screen--datos { background: var(--white); }

.screen__footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   HEADERS
   ============================================================ */
.brand-header {
  display: flex;
  justify-content: center;
  padding: 14px 0 4px;
}
.brand-wordmark {
  height: 44px;
  width: auto;
}

.step-header {
  position: relative;
  text-align: center;
  padding: 8px 40px 16px;
}
.step-header__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}
.step-header__sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-mute);
}

.back {
  position: absolute;
  left: 0;
  top: 4px;
  background: transparent;
  border: 0;
  color: var(--navy);
  cursor: pointer;
  padding: 6px;
}


/* ============================================================
   HERO (screen 1)
   ============================================================ */
.hero {
  text-align: center;
  margin-top: 18px;
}
.hero__title {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  margin: 12px 0 8px;
}
.hero__sub {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0 0 28px;
}
.hero__icons {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 18px;
  margin: 8px 0 24px;
}
.hero__icons img {
  width: 110px;
  height: auto;
}


/* ============================================================
   FORM
   ============================================================ */
.form {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.field {
  display: flex;
  flex-direction: column;
  margin: 0 0 14px;
  border: 0;
  padding: 0;
}
.field__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.feedback-block textarea {
  font: inherit;
  font-size: 16px;       /* iOS no-zoom */
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder,
.feedback-block textarea::placeholder { color: var(--ink-mute); }
.field input:focus,
.field select:focus,
.feedback-block textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 46, .18);
}
.field select {
  appearance: none;
  background: var(--white) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 6 5-6' stroke='%237A7367' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 14px center;
  padding-right: 38px;
}

.field.has-error input,
.field.has-error select {
  border-color: var(--clay);
}
.form-error {
  color: var(--clay);
  font-size: 13px;
  margin: 4px 0 12px;
}


/* ============================================================
   RATING (estrellas)
   ============================================================ */
.rating__stars {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  margin-top: 4px;
}
.star {
  font-size: 32px;
  color: var(--line);
  background: transparent;
  border: 0;
  padding: 4px 6px;
  cursor: pointer;
  transition: color .15s, transform .1s;
  line-height: 1;
}
.star:hover { transform: scale(1.08); }
.star.is-on { color: var(--orange); }


/* ============================================================
   CARDS DE REGALO
   ============================================================ */
.prompt {
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 8px 0 18px;
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
.card {
  position: relative;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.card input { position: absolute; opacity: 0; pointer-events: none; }
.card:hover { transform: translateY(-1px); }
.card.is-selected {
  border-color: var(--orange);
  border-width: 3px;
  box-shadow: var(--shadow-md);
}
.card__icon {
  width: 92px;
  height: auto;
  margin-bottom: 12px;
}
.card__name {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
}
.card__sub {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.cards__hint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
  margin: 4px 0 18px;
}


/* ============================================================
   TÉRMINOS embebidos
   ============================================================ */
.terms {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 14px;
}
.terms__check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.terms__check input { position: absolute; opacity: 0; pointer-events: none; }
.terms__box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--orange);
  background: var(--orange);
  position: relative;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.terms__box::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 11px;
  border: solid var(--white);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  transition: opacity .15s;
}
.terms__check input:not(:checked) ~ .terms__box {
  background: var(--white);
  border-color: var(--ink-mute);
}
.terms__check input:not(:checked) ~ .terms__box::after { opacity: 0; }

.terms__title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}
.terms__list {
  list-style: none;
  margin: 6px 0 8px 30px;
  padding: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.terms__list li::before {
  content: '•';
  color: var(--orange);
  font-weight: 700;
  margin-right: 8px;
}
.terms__foot {
  margin: 4px 0 0 30px;
  font-size: 11px;
  color: var(--ink-mute);
}

.link {
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: var(--navy);
  text-decoration: underline;
  font-weight: 600;
}
.link--privacy {
  display: block;
  text-align: center;
  font-size: 12.5px;
  margin: 14px auto 0;
  padding: 6px 12px;
}


/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font: inherit;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 16px 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  transition: transform .1s, box-shadow .15s, opacity .15s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--primary {
  background: var(--orange);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--orange-dk); }

.btn--navy {
  background: var(--navy);
  color: var(--white);
}
.btn--navy:hover { background: var(--navy-dk); }

.btn--ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  margin-top: 8px;
}
.btn__arrow,
.btn__star {
  font-size: 18px;
  line-height: 1;
}
.btn__star { color: var(--cream); }


/* ============================================================
   CONFIRMACIÓN
   ============================================================ */
.screen--confirma {
  text-align: center;
  align-items: center;
}
.confirm-check {
  margin: 24px 0 8px;
}
.confirm-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  margin: 8px 0 6px;
}
.confirm-sub {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 20px;
}
.code-box {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin: 4px auto 8px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.code-box__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--cream);
}
.code-box__value {
  font-family: 'Inter', monospace;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .08em;
}
.code-help {
  font-size: 12px;
  color: var(--ink-mute);
  margin: 0 0 14px;
}
.divider {
  width: 100%;
  max-width: 320px;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px auto;
}
.review-block,
.feedback-block {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.review-block__title,
.feedback-block__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 6px 0 4px;
}
.review-block__sub,
.feedback-block__sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.4;
}
.feedback-block textarea {
  width: 100%;
  resize: vertical;
  margin-bottom: 10px;
}
.feedback-thanks {
  color: var(--moss);
  font-weight: 600;
  margin-top: 8px;
}


/* ============================================================
   COMMON
   ============================================================ */
.muted-small {
  font-size: 12px;
  color: var(--ink-mute);
  margin: 4px 0 0;
}
.footer-link {
  margin-top: 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .04em;
}


/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn .2s ease-out;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 40, 73, .55);
}
.modal__sheet {
  position: relative;
  background: var(--white);
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 24px 24px 36px;
  animation: slideUp .25s ease-out;
}
.modal__sheet h2 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--navy);
}
.modal__sheet p {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 12px;
}
.modal__close {
  position: absolute;
  top: 10px; right: 14px;
  background: transparent; border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--ink-mute);
  cursor: pointer;
}
@keyframes slideUp {
  from { transform: translateY(40px); }
  to   { transform: translateY(0); }
}


/* ============================================================
   LOADING
   ============================================================ */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(251, 239, 194, .92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 90;
  gap: 16px;
  color: var(--ink-soft);
}
.loading__spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--cream);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ============================================================
   DESKTOP — preview frame
   ============================================================ */
@media (min-width: 600px) {
  body {
    background: linear-gradient(180deg, var(--cream-lt) 0%, var(--cream) 100%);
    padding: 24px 0;
  }
  .app {
    box-shadow: 0 14px 40px rgba(31, 58, 107, .14);
    border-radius: 28px;
    overflow: hidden;
    min-height: 760px;
  }
  .screen {
    min-height: 760px;
  }
}
