body { overscroll-behavior: none; }

#app { min-height: 100dvh; max-width: 560px; margin: 0 auto; }

.screen {
  display: none; flex-direction: column; align-items: center; gap: 18px;
  min-height: 100dvh; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  text-align: center;
}
.screen.active { display: flex; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

h1 { font-size: 46px; margin: 0; line-height: .95; }
h2 { font-size: 34px; margin: 0; line-height: 1; }
.hero { display: grid; font-size: 64px; }
.hero span:empty { display: none; }
.kicker {
  justify-self: center; padding: 7px 16px; border-radius: 99px; font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.kicker:empty { display: none; }
p { margin: 0; color: var(--muted); line-height: 1.45; }

.logo { width: min(200px, 55%); max-height: 130px; object-fit: contain; margin-top: 4vh; }
.welcome-copy { display: grid; gap: 12px; margin: auto 0; }
.actions { display: grid; gap: 12px; width: 100%; margin-top: auto; }
.actions.row { grid-template-columns: 1fr 1fr; }
.actions.row .btn { padding: 0 12px; }

.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 8px; cursor: pointer; }
.link.inline { padding: 0; color: inherit; }

/* Cámara */
.camera-screen { background: #000; padding-left: 0; padding-right: 0; justify-content: center; }
.viewfinder { position: relative; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; background: #111; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; }
.viewfinder video.mirror { transform: scaleX(-1); }
.countdown {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 140px; font-weight: 800; color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.6);
}
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .4s ease-out; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }
.camera-controls { display: flex; align-items: center; justify-content: space-around; width: 100%; padding: 24px 0; }
.shutter {
  width: 84px; height: 84px; border-radius: 50%; border: 6px solid #fff; background: var(--primary);
  box-shadow: 0 0 0 4px rgba(255,255,255,.25); cursor: pointer;
}
.shutter:active { transform: scale(.93); }
.icon-btn {
  width: 56px; height: 56px; border-radius: 50%; border: 0; font-size: 24px;
  background: rgba(255,255,255,.15); color: #fff; cursor: pointer;
}

/* Editor de marco */
.stage { width: 100%; border-radius: 10px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.stage canvas { display: block; width: 100%; aspect-ratio: 3 / 2; touch-action: none; cursor: grab; }
.hint { font-size: 14px; }
.frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.frame-option {
  display: grid; gap: 6px; padding: 6px; border: 0; border-radius: 10px; background: var(--surface);
  color: var(--text); font-family: var(--font-heading); font-size: 20px; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; box-shadow: inset 0 0 0 3px transparent;
}
.frame-option canvas { width: 100%; aspect-ratio: 3 / 2; border-radius: 6px; display: block; }
.frame-option.selected { box-shadow: inset 0 0 0 3px var(--primary); }

.final { width: 100%; border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.final.small { width: 60%; }

/* Formulario */
form { display: grid; gap: 14px; width: 100%; text-align: left; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.field input {
  min-height: 52px; padding: 0 16px; border-radius: var(--radius-btn); border: 2px solid transparent;
  background: var(--surface); color: var(--text); font-size: 17px; outline: none;
}
.field input:focus { border-color: var(--primary); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.consent input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; margin: 0; }
.privacy { font-size: 13px; background: var(--surface); padding: 12px; border-radius: 10px; }
.error { color: var(--danger); min-height: 1.2em; font-weight: 600; }
.progress { height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }

/* Éxito */
.check {
  width: 84px; height: 84px; border-radius: 50%; background: var(--primary); color: var(--primary-text);
  display: grid; place-items: center; font-size: 44px; font-weight: 700; margin-top: 3vh;
  box-shadow: 0 0 40px color-mix(in srgb, var(--primary) 45%, transparent);
}
.your-name { font-family: var(--font-heading); font-size: 38px; text-transform: uppercase; color: var(--primary); }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 10;
  max-width: calc(100% - 40px); padding: 14px 20px; border-radius: 12px;
  background: #222; color: #fff; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
