/* Compensar · Escarapela digital. Paleta medida del logo y verificada (ver docs/diseno.md):
   naranja de marca #FF6600 solo en rellenos grandes; texto naranja #C94A00 (4.7:1); botón #E85A00 con texto blanco
   en 19 px bold (3.6:1, texto grande); verde lima #CCD400 solo con texto oscuro encima; verde tierra #1F3B17. */
:root {
  --naranja: #FF6600;
  --naranja-boton: #E85A00;
  --naranja-texto: #C94A00;
  --naranja-suave: #FFE8D6;
  --lima: #CCD400;
  --verde-texto: #3B6B12;
  --tierra: #1F3B17;
  --texto: #1F2A1C;
  --texto-2: #4B5348;
  --fondo: #FFF7F0;
  --tarjeta: rgba(255, 255, 255, .86);
  --borde: rgba(31, 42, 28, .12);
  --font: 'Roboto', system-ui, sans-serif;
  --mono: 'Roboto Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--texto); background: var(--fondo);
  height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.center { text-align: center; }

/* ---------- fondo: el isotipo respira y su punto central brota */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
  background: radial-gradient(90% 70% at 100% 0%, #FFE2CC 0%, rgba(255,226,204,0) 60%), radial-gradient(70% 60% at 0% 100%, #F2F5C8 0%, rgba(242,245,200,0) 65%); }
.iso { position: absolute; width: min(760px, 110vw); right: max(-200px, -18vw); top: max(-160px, -14vw); opacity: .16; overflow: visible; }
.iso .d { fill: var(--naranja); transform-box: fill-box; transform-origin: center; animation: breathe 7s ease-in-out infinite; }
.iso .d2 { animation-delay: -1.2s; } .iso .d3 { animation-delay: -2.4s; } .iso .d5 { animation-delay: -3.6s; } .iso .d6 { animation-delay: -4.8s; }
.iso .heart { animation: heart 12s ease-in-out infinite; }
.iso .sprout { opacity: 0; animation: sprout 12s ease-in-out infinite; }
.iso .stem { fill: none; stroke: var(--verde-texto); stroke-width: .7; stroke-linecap: round; }
.iso .leaf { fill: var(--lima); }
.iso-sm { width: 340px; left: -150px; right: auto; top: auto; bottom: -120px; opacity: .08; }
.iso-sm circle { fill: var(--naranja); }
@keyframes breathe { 50% { transform: scale(.88) translate(2%, -3%); } }
@keyframes heart { 0%, 30% { fill: var(--naranja); } 45%, 80% { fill: var(--lima); } 100% { fill: var(--naranja); } }
@keyframes sprout { 0%, 40% { opacity: 0; transform: translateY(1.5px); } 55%, 80% { opacity: 1; transform: none; } 95%, 100% { opacity: 0; } }

/* ---------- encabezado */
.top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px 4px; max-width: 1200px; width: 100%; margin: 0 auto; flex: none; }
.logo { height: 40px; width: auto; display: block; }
.startin-credit { font-size: 12px; color: var(--tierra); text-decoration: none; background: rgba(255,255,255,.82); border: 1px solid var(--borde); padding: 7px 11px; border-radius: 999px; white-space: nowrap; }
.startin-credit b { font-weight: 900; }
.startin-credit:hover { border-color: var(--naranja); }

main { position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 1200px; margin: 0 auto; padding: 8px 28px 20px; display: flex; flex-direction: column; }
.view { display: none; }
.view.on { display: flex; flex: 1; min-height: 0; animation: rise .5s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- registro */
#vRegister.on { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font: 700 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--verde-texto); margin: 0 0 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lima); box-shadow: 0 0 0 0 rgba(204,212,0,.7); animation: ping 1.8s infinite; flex: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(204,212,0,0); } 100% { box-shadow: 0 0 0 0 rgba(204,212,0,0); } }
h1 { font-weight: 900; font-size: clamp(44px, 6.4vw, 86px); line-height: .96; letter-spacing: -.025em; margin: 0 0 20px; }
h1 .accent { display: block; color: var(--naranja-texto); }
.lead { font-size: clamp(16px, 1.5vw, 20px); line-height: 1.5; color: var(--texto-2); max-width: 30em; margin: 0 0 24px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 14px; }
.counter { display: inline-flex; align-items: center; gap: 8px; background: var(--tierra); color: #fff; padding: 9px 14px 9px 11px; border-radius: 999px; font-weight: 500; }
.counter b { font-weight: 900; font-variant-numeric: tabular-nums; }
.counter svg, .saved svg { width: 18px; height: 18px; fill: none; stroke: var(--lima); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.when { color: var(--texto-2); font-weight: 500; }

.card { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 28px; padding: 22px 24px 20px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 30px 70px -36px rgba(120, 52, 0, .45); }
.pane { display: none; }
.pane.on { display: block; animation: rise .4s cubic-bezier(.2,.8,.2,1); }
.card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--texto-2); padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px dashed var(--borde); }
.card-head .back { border: 0; background: var(--naranja-suave); color: var(--naranja-texto); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-weight: 900; margin-right: auto; }
.q { font-size: 22px; font-weight: 900; margin: 0 0 14px; letter-spacing: -.01em; }

.intents { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.intent { --c: var(--naranja); display: flex; align-items: center; gap: 12px; text-align: left; min-height: 64px; padding: 12px 12px; border-radius: 18px; border: 1.5px solid var(--borde); background: #fff; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .2s; }
.intent:hover { border-color: var(--c); transform: translateY(-2px); box-shadow: 0 12px 24px -16px var(--c); }
.intent:focus-visible { outline: 3px solid var(--naranja-boton); outline-offset: 2px; }
.intent .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, white); flex: none; }
.intent .ic svg, .picked .ic svg { width: 24px; height: 24px; fill: none; stroke: var(--tierra); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.intent b { font-size: 15px; line-height: 1.15; font-weight: 700; }
.intent[aria-checked="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); }
.intent[aria-checked="true"] .ic { background: var(--lima); }

.picked { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--tierra); color: #fff; border: 0; border-radius: 18px; padding: 10px 14px; margin-bottom: 12px; cursor: pointer; }
.picked .ic { width: 38px; height: 38px; border-radius: 50%; background: var(--lima); display: grid; place-items: center; flex: none; }
.picked small { display: block; font: 700 10.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--lima); }
.picked b { display: block; font-size: 15px; font-weight: 700; }
.picked .chg { margin-left: auto; font-size: 12px; color: #E8F0C8; text-decoration: underline; }

.field { display: block; margin-bottom: 10px; }
.field span { display: block; font-size: 12.5px; font-weight: 700; color: var(--texto-2); margin: 0 0 5px 2px; }
.field input { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1.5px solid rgba(31,42,28,.18); background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: var(--naranja-boton); box-shadow: 0 0 0 4px rgba(255,102,0,.15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 11.5px; line-height: 1.4; color: var(--texto-2); margin: 4px 0 8px; cursor: pointer; }
.consent a { color: var(--naranja-texto); font-weight: 700; }
.consent input { width: 20px; height: 20px; margin: 0; accent-color: var(--naranja-boton); flex: none; }
.err { color: #B3261E; font-size: 13.5px; font-weight: 700; min-height: 1em; margin: 0 0 8px; }
.err:empty { display: none; }
.hint { font-size: 12px; color: var(--texto-2); text-align: center; margin: 8px 0 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 12px 20px; border-radius: 16px; border: 0; font-size: 19px; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .2s, background .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--naranja-boton); color: #fff; box-shadow: 0 14px 30px -14px rgba(232,90,0,.9); }
.btn.primary:hover { background: #D45200; }
.btn.ghost { background: #fff; color: var(--naranja-texto); border: 1.5px solid var(--naranja-boton); }
.btn.link { background: none; min-height: 44px; font-size: 14.5px; color: var(--naranja-texto); text-decoration: underline; text-underline-offset: 3px; padding: 8px; width: auto; }
#seeMine { display: flex; margin: 8px auto 0; }

/* ---------- expidiendo: el isotipo se arma y su corazón brota */
#vIssuing.on { align-items: center; justify-content: center; }
.grow { text-align: center; }
.grow-art { width: 190px; height: 190px; overflow: visible; }
.g { fill: var(--naranja); transform-box: fill-box; transform-origin: center; transform: scale(0); }
.go .g { animation: pop .45s cubic-bezier(.3,1.6,.5,1) forwards; }
.go .g1 { animation-delay: .05s; } .go .g2 { animation-delay: .15s; } .go .g3 { animation-delay: .25s; } .go .g4 { animation-delay: .35s, 1s; } .go .g5 { animation-delay: .45s; } .go .g6 { animation-delay: .55s; }
.go .g4 { animation-name: pop, toGreen; animation-duration: .45s, .5s; animation-fill-mode: forwards, forwards; }
.g-stem { fill: none; stroke: var(--verde-texto); stroke-width: .8; stroke-linecap: round; stroke-dasharray: 12; stroke-dashoffset: 12; }
.g-leaf { fill: var(--lima); stroke: var(--verde-texto); stroke-width: .3; transform-box: fill-box; transform: scale(0); }
.gl1 { transform-origin: 100% 100%; } .gl2 { transform-origin: 0% 100%; }
.go .g-stem { animation: draw .7s ease-out 1.3s forwards; }
.go .gl1 { animation: pop .5s cubic-bezier(.3,1.6,.5,1) 1.8s forwards; }
.go .gl2 { animation: pop .5s cubic-bezier(.3,1.6,.5,1) 2.1s forwards; }
@keyframes pop { to { transform: scale(1); } }
@keyframes toGreen { to { fill: var(--lima); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.grow-lines { list-style: none; padding: 0; margin: 18px 0 0; font: 700 15px/1.3 var(--mono); color: var(--texto-2); min-height: 6em; }
.grow-lines li { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; margin: 6px 0; }
.grow-lines li.in { opacity: 1; transform: none; }
.grow-lines li.done { color: var(--verde-texto); }
.grow-lines li.done::before { content: '✓ '; }

/* ---------- escarapela */
#vBadge.on { flex-direction: column; align-items: center; }
#vBadge .eyebrow { margin-bottom: 10px; }
.badge-wrap { flex: 1; min-height: 0; width: 100%; display: flex; gap: 40px; align-items: center; justify-content: center; }
.tilt { perspective: 1200px; height: 100%; max-height: 640px; display: flex; align-items: center; animation: drop .9s cubic-bezier(.2,.9,.25,1.2); }
@keyframes drop { from { opacity: 0; transform: translateY(-40px) rotate(-4deg); } }
.badge { position: relative; height: 100%; aspect-ratio: 2 / 3; border-radius: 22px; overflow: hidden; transform-style: preserve-3d; transition: transform .25s ease-out; box-shadow: 0 40px 80px -30px rgba(80,40,0,.5), 0 0 0 1px rgba(31,42,28,.08); }
.badge img { width: 100%; height: 100%; display: block; }
.glare { position: absolute; inset: 0; background: radial-gradient(circle at var(--gx, 30%) var(--gy, 20%), rgba(255,255,255,.4), transparent 45%); mix-blend-mode: soft-light; pointer-events: none; }
.side { width: min(360px, 100%); }
.saved { display: flex; gap: 10px; align-items: center; background: var(--tierra); color: #fff; border-radius: 16px; padding: 12px 14px; font-size: 14.5px; font-weight: 500; margin: 0 0 12px; }
.fact { font-size: 14.5px; line-height: 1.45; color: var(--texto-2); margin: 0 0 16px; }
.fact b { color: var(--texto); }
.actions { display: grid; gap: 10px; }
.links { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }

/* ---------- recorte de foto */
.cropper { position: fixed; inset: 0; z-index: 50; background: rgba(20,28,16,.6); display: grid; place-items: center; padding: 16px; }
.crop-box { background: #fff; border-radius: 24px; padding: 20px; width: min(420px, 100%); }
.crop-title { font-size: 20px; font-weight: 900; margin: 0; }
.crop-sub { font-size: 14px; color: var(--texto-2); margin: 4px 0 12px; }
.crop-stage { position: relative; border-radius: 18px; overflow: hidden; touch-action: none; cursor: grab; }
.crop-stage canvas { width: 100%; display: block; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(255,255,255,.55); pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-weight: 900; }
.crop-zoom input { flex: 1; accent-color: var(--naranja-boton); }
.crop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- celular: todo cabe en una pantalla */
@media (max-width: 860px) {
  .top { padding: 12px 16px 2px; }
  .logo { height: 30px; }
  main { padding: 6px 16px 14px; }
  #vRegister.on { display: flex; flex-direction: column; gap: 12px; align-items: stretch; justify-content: flex-start; }
  .eyebrow { font-size: 11px; margin-bottom: 8px; }
  h1 { font-size: clamp(30px, 8.6vw, 40px); margin-bottom: 8px; }
  h1 .accent { display: inline; }
  .lead { font-size: 14px; margin-bottom: 10px; }
  .facts { font-size: 12.5px; gap: 6px; }
  .when { display: none; }
  .counter { padding: 6px 12px 6px 9px; }
  .card { padding: 14px 14px 12px; border-radius: 22px; }
  .card-head { padding-bottom: 9px; margin-bottom: 10px; }
  .q { font-size: 18px; margin-bottom: 10px; }
  .intents { gap: 8px; }
  .intent { min-height: 58px; padding: 9px 10px; gap: 9px; border-radius: 16px; }
  .intent .ic { width: 34px; height: 34px; }
  .intent .ic svg { width: 20px; height: 20px; }
  .intent b { font-size: 13.5px; }
  /* En el paso 2 el formulario ocupa la pantalla. */
  body.step2 .hero { display: none; }
  .field { margin-bottom: 8px; }
  .field input { padding: 11px 12px; }
  .badge-wrap { flex-direction: column; gap: 12px; }
  .tilt { flex: 1; min-height: 0; max-height: none; }
  .side { width: 100%; max-width: 420px; }
  .saved { padding: 9px 12px; font-size: 13px; margin-bottom: 6px; }
  .fact { display: none; }
  #ownActions { grid-template-columns: 1fr 1fr; }
  #ownActions .links, #ownActions:has(#shareBtn[hidden]) #dlBtn { grid-column: 1 / -1; }
  #ownActions .btn:not(.link) { min-height: 48px; font-size: 17px; }
  .lg { display: none; }
}
@media (max-width: 860px) and (max-height: 700px) {
  .lead { display: none; }
  .hint { display: none; }
}
@media (max-width: 360px) { .row2 { grid-template-columns: 1fr; gap: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .g, .g-leaf { transform: none; } .g-stem { stroke-dashoffset: 0; }
}
