/* ==========================================================================
   Las palabras que nunca se apagan — Previsiones La Paz
   ========================================================================== */
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Josefin Sans"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/josefin-sans-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Josefin Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/josefin-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Josefin Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/josefin-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --sage: #698984;
  --sage-dark: #3F5C55;
  --deep: #1B302B;
  --deeper: #10201C;
  --gold: #A3916D;
  --gold-light: #CDB98C;
  --gold-text: #7A6845;   /* dorado legible sobre blanco (contraste AA) */
  --cream: #FBF6EC;
  --paper: #F6EFE2;
  --ink: #1F3A33;
  --flor: #D9862C;
  --line: #E3D9C6;
  --error: #9B2C1F;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Josefin Sans", "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(31, 58, 51, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, canvas { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--sage-dark); }
[hidden] { display: none !important; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; background: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--flor); outline-offset: 3px; }

/* ---------- barra de marca (el logotipo vive sobre blanco, como su archivo original) ---------- */
.brandbar {
  background: #fff;
  display: flex; justify-content: center; align-items: center;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.brandbar__logo { width: 172px; height: auto; }

/* ---------- pantallas ---------- */
.screen { animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- bienvenida ---------- */
.screen--hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 100%, rgba(217,134,44,.20), transparent 60%),
    radial-gradient(90% 60% at 50% 0%, #2A4740 0%, transparent 70%),
    linear-gradient(180deg, var(--deep), var(--deeper));
  color: var(--cream);
  min-height: calc(100vh - 80px);
  min-height: calc(100svh - 80px);
  display: flex; align-items: center;
}
.hero {
  position: relative; z-index: 1;
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 48px 24px 56px;
  text-align: center;
}
.eyebrow {
  font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-light); margin: 0 0 18px;
}
.hero__title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(44px, 13vw, 68px);
  line-height: 1.0; margin: 0;
  color: #FFF9EE;
  text-shadow: 0 0 40px rgba(255, 196, 110, .25);
}
.ornament { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 22px auto; }
.ornament span { width: 70px; height: 1px; background: var(--gold-light); opacity: .8; }
.ornament i { width: 10px; height: 10px; background: var(--gold-light); transform: rotate(45deg); }
.hero__sub { font-family: var(--serif); font-style: italic; font-size: 25px; line-height: 1.3; margin: 0 0 14px; color: #F4EAD4; }
.hero__text { font-size: 18px; color: rgba(251, 246, 236, .86); margin: 0 0 30px; }
.hero__note { font-size: 15px; color: rgba(251, 246, 236, .72); margin: 18px 0 0; }
.hero__credit { font-size: 14px; letter-spacing: .02em; color: var(--gold-light); margin: 28px 0 0; }

/* luz de velas: solo opacidad/transform → ligero para el teléfono */
.candles { position: absolute; inset: 0; pointer-events: none; }
.glow {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 120, .55), rgba(255, 170, 80, .12) 45%, transparent 70%);
  will-change: opacity, transform;
  animation: flicker 3.2s ease-in-out infinite alternate;
}
.g1 { width: 300px; height: 300px; left: -110px; bottom: 6%; }
.g2 { width: 220px; height: 220px; right: -70px; bottom: 22%; animation-duration: 2.6s; animation-delay: -1s; }
.g3 { width: 160px; height: 160px; right: 22%; top: 8%; opacity: .5; animation-duration: 4s; }
@keyframes flicker {
  0% { opacity: .55; transform: scale(1); }
  35% { opacity: .8; transform: scale(1.04); }
  60% { opacity: .62; transform: scale(.98); }
  100% { opacity: .9; transform: scale(1.06); }
}

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 14px 26px;
  border-radius: 999px; border: 2px solid transparent;
  font-family: var(--sans); font-weight: 600; font-size: 16px;
  letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn--xl { width: 100%; min-height: 62px; font-size: 17px; letter-spacing: .07em; }
.btn--gold { background: linear-gradient(180deg, #D8C79E, #B9A578); color: var(--deeper); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.btn--primary { background: var(--deep); color: #FFF9EE; }
.btn--primary:hover { background: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--outline { background: transparent; color: var(--ink); border-color: var(--gold); width: 100%; letter-spacing: .06em; line-height: 1.25; }
.link {
  background: none; border: 0; padding: 10px 6px;
  color: var(--sage-dark); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; font-size: 16px;
}

/* ---------- app ---------- */
.screen--app { padding: 22px 16px 40px; }
.wrap { max-width: 560px; margin: 0 auto; }
.progress { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress__bar { display: block; height: 100%; width: 20%; background: linear-gradient(90deg, var(--sage), var(--gold)); transition: width .35s ease; }
.steplabel { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); margin: 12px 0 6px; }
.step { animation: fade .35s ease both; }
.q {
  display: block;
  font-family: var(--serif); font-weight: 600;
  font-size: 30px; line-height: 1.15;
  color: var(--ink); margin: 6px 0 14px;
}
.opt { font-family: var(--sans); font-weight: 400; font-size: 16px; color: var(--sage-dark); }
.hint { font-size: 16px; color: #4A5F59; margin: 10px 0 16px; }
.label { display: block; font-size: 16px; font-weight: 600; margin: 16px 0 6px; }
.small { font-size: 14px; color: #4A5F59; }
.error { color: var(--error); font-size: 16px; font-weight: 600; margin: 10px 0 0; }

.field {
  width: 100%; min-height: 54px;
  padding: 12px 16px;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff; font-size: 18px;
  transition: border-color .2s ease;
}
.field:focus { border-color: var(--sage); outline: none; box-shadow: 0 0 0 4px rgba(105, 137, 132, .18); }
.field--lg { font-family: var(--serif); font-size: 28px; font-weight: 600; }
.field--area { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.35; resize: vertical; min-height: 150px; }
.counter { text-align: right; font-size: 14px; color: #4A5F59; margin: 6px 2px 0; }
.counter.is-near { color: var(--error); font-weight: 600; }

/* foto */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 260px; padding: 24px;
  border: 2px dashed var(--gold); border-radius: 20px;
  background: #fff; color: var(--sage-dark);
  text-align: center; cursor: pointer;
}
.dropzone:focus-within { outline: 3px solid var(--flor); outline-offset: 3px; }
.dropzone.is-over { background: #FFF7E8; }
.dropzone__title { font-size: 20px; font-weight: 600; color: var(--ink); }
.dropzone__meta { font-size: 14px; }

.cropper__frame {
  position: relative;
  width: min(100%, 360px); aspect-ratio: 4 / 5; margin: 0 auto;
  border-radius: 180px 180px 18px 18px;
  overflow: hidden; background: #ddd;
  box-shadow: 0 0 0 6px #fff, 0 0 0 8px var(--gold-light), var(--shadow);
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.cropper__frame:active { cursor: grabbing; }
.cropper__frame canvas { width: 100%; height: 100%; }
.cropper__guide { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,.28)) 33.33% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,.28)) 66.66% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,.28)) 0 33.33% / 100% 1px no-repeat,
    linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,.28)) 0 66.66% / 100% 1px no-repeat;
  opacity: 0; transition: opacity .2s ease; }
.cropper__frame.is-dragging .cropper__guide { opacity: 1; }
.zoom { display: flex; align-items: center; gap: 12px; margin: 22px auto 4px; max-width: 360px; }
.zoom input { flex: 1; accent-color: var(--sage-dark); height: 36px; }
.zoom__btn { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row--center { justify-content: center; }

/* chips */
.chips { display: grid; gap: 10px; }
.chip {
  text-align: left; padding: 14px 16px; min-height: 54px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff;
  font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.25;
  cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--sage); background: #EEF3F1; }

/* vínculo */
.fs { border: 0; padding: 0; margin: 0; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 54px; padding: 10px 8px;
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff;
  font-size: 17px; cursor: pointer;
}
.choice input:checked + span { border-color: var(--sage-dark); background: var(--deep); color: #FFF9EE; }
.choice input:focus-visible + span { outline: 3px solid var(--flor); outline-offset: 2px; }
.choice--wide { grid-column: 1 / -1; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0 6px; font-size: 17px; cursor: pointer; }
.check input { width: 26px; height: 26px; flex: none; margin: 1px 0 0; accent-color: var(--sage-dark); }

/* diseños */
.designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.design {
  padding: 6px 6px 10px; border: 2px solid var(--line); border-radius: 16px; background: #fff;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.design__thumb { width: 100%; aspect-ratio: 9 / 16; height: auto; border-radius: 10px; background: #eee; }
.design__name { font-size: 13px; line-height: 1.2; font-weight: 600; text-align: center; min-height: 32px; display: flex; align-items: center; }
.design[aria-checked="true"] { border-color: var(--sage-dark); box-shadow: 0 0 0 3px rgba(105,137,132,.35); }
.bigpreview { margin: 20px auto 0; max-width: 360px; }
.bigpreview canvas { width: 100%; height: auto; border-radius: 14px; box-shadow: var(--shadow); }

.nav { display: flex; gap: 12px; margin-top: 28px; position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(251,246,236,0), var(--cream) 30%); }
.nav .btn { letter-spacing: .06em; padding: 12px 18px; }
.nav .btn--primary { flex: 1; }

/* ---------- resultado ---------- */
.final__title { font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.12; text-align: center; margin: 10px 0 10px; }
.final__text { text-align: center; color: #4A5F59; margin: 0 0 20px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #fff; padding: 6px; border-radius: 999px; border: 1px solid var(--line); }
.tab { border: 0; border-radius: 999px; padding: 10px 8px; background: transparent; cursor: pointer; font-weight: 600; font-size: 16px; line-height: 1.15; }
.tab small { display: block; font-weight: 400; font-size: 12px; color: #4A5F59; }
.tab.is-active { background: var(--deep); color: #FFF9EE; }
.tab.is-active small { color: var(--gold-light); }
.result { margin: 18px auto; max-width: 380px; }
.result__img { width: 100%; height: auto; border-radius: 14px; box-shadow: var(--shadow); background: #eee; -webkit-touch-callout: default; }
.result__hint { font-size: 14px; text-align: center; color: #4A5F59; margin-top: 10px; }
.actions { display: grid; gap: 12px; justify-items: center; }
.actions .btn { width: 100%; }

.care { margin: 40px -16px 0; padding: 36px 16px; background: linear-gradient(180deg, #EEF3F1, #E3ECE8); border-top: 1px solid #D5E1DC; }
.care__inner { max-width: 560px; margin: 0 auto; }
.care__title { font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.15; margin: 0 0 10px; }
.lead { margin-top: 20px; background: #fff; border-radius: 18px; padding: 20px 18px; box-shadow: var(--shadow); }
.lead__intro { margin: 0 0 6px; }
.check--consent { font-size: 16px; line-height: 1.4; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.lead-ok { margin-top: 20px; background: #fff; border-radius: 18px; padding: 22px; text-align: center; box-shadow: var(--shadow); }
.lead-ok__title { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0 0 6px; }

/* ---------- pie, carga, aviso ---------- */
.foot { text-align: center; font-size: 14px; color: #4A5F59; padding: 26px 16px calc(26px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.foot p { margin: 4px 0; }
.foot__motto { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); }
.loading {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: rgba(16, 32, 28, .88); color: var(--cream); font-size: 18px; text-align: center; padding: 24px;
}
.loading__flame {
  width: 22px; height: 34px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #FFF8E0, #FFD27A 45%, #E9862C 80%);
  box-shadow: 0 0 40px 12px rgba(255, 190, 100, .45);
  animation: flicker 1.1s ease-in-out infinite alternate;
}
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 45; max-width: min(92vw, 480px);
  background: var(--deep); color: #FFF9EE; padding: 14px 18px; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: 16px; text-align: center;
}

@media (min-width: 720px) {
  .brandbar__logo { width: 200px; }
  .hero { padding-top: 70px; }
  .screen--app { padding-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
