/* ================= TOKENS (Brand) ================= */
:root{
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 14px 34px rgba(0,0,0,.10);

  --primary: #0b66ff;
  --primaryHover: #0a5ae0;

  --radius: 14px;
}

/* ================= GLOBAL ================= */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  overflow: hidden; /* 1 solo scroll: el wrapper */
}

* { box-sizing: border-box; }

input, select, textarea {
  font-size: 16px;
  outline: none;
  line-height: 1.2;
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-top: 12px;
  padding-bottom: 12px;
}

/* ================= LANG SELECT ================= */
.lang-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 14px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  pointer-events: none; /* evita tap en áreas vacías */
}

.lang-select {
  pointer-events: auto;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,0.10);
}

/* ================= APP CONTAINER ================= */
.app-container {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 72px 14px 18px; /* deja espacio para lang-container fijo */
}

/* ================= FORM WRAPPER ================= */
.form-wrapper {
  width: min(720px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 26px;
  position: relative;

  /* único scroll permitido */
  height: calc(100vh - 90px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ================= PROGRESS BAR ================= */
.progress-bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  margin-bottom: 14px;
  overflow: hidden;
}

.progress {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .45s ease-in-out;
}

/* ================= SCORE BAR ================= */
.score-bar {
  height: 10px;
  background: #eef2f7;
  border-radius: 999px;
  margin: 12px 0 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.score-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width .35s ease-in-out;
  background: var(--primary);
}

/* ================= FORM STEP ================= */
.form-step {
  display: none; /* controlado por JS */
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: 18px;
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.35s ease;
}

.form-step.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

h2 {
  text-align: center;
  margin: 6px 0 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 22px;
}

.step-desc {
  font-size: 13px;
  color: var(--muted);
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 14px;
  line-height: 1.35;
}

/* ================= LABELS & INPUTS ================= */
label {
  display: block;
  margin-top: 14px;
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  padding: 14px 14px;
  margin-top: 8px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
  transition: .2s;
  background: #ffffff;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(11,102,255,.14);
}

textarea {
  resize: vertical;
  min-height: 84px;
}

/* ================= BUTTONS ================= */
.btns {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  gap: 12px;
}

button {
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 10px 18px rgba(0,0,0,0.12);
}

button:hover {
  background: var(--primaryHover);
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 8px 14px rgba(0,0,0,0.12);
}

button.prev {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.prev:hover {
  background: #f9fafb;
}

@media (max-width: 900px){
  .btns { flex-direction: column; }
  button { width: 100%; }
}

/* ================= FOOTER ================= */
.footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.footer span {
  display: block;
  margin-top: 6px;
}

/* ================= CONFETTI MSG ================= */
.confetti-msg {
  display: none;
  text-align: center;
  font-size: 14px;
  color: var(--text);
  margin-top: 16px;
  font-weight: 800;

  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
/* ===== iOS date placeholder (MM/DD/YYYY) ===== */
input[type="date"]{
  position: relative;
}
input[type="date"]::before{
  content: attr(placeholder);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted, #6b7280);
  pointer-events: none;
}
input[type="date"]:focus::before,
input[type="date"]:valid::before{
  content: "";
}
/* ===== Fix barra idioma iPhone (sin barra gigante) ===== */
.lang-container{
  width: auto !important;
  left: 12px !important;
  top: 12px !important;
  padding-top: 0 !important;
  position: fixed !important;
}

.lang-select{
  width: auto !important;
  min-width: 70px !important;
  max-width: 90px !important;
  padding: 8px 12px !important;
}
/* ================= PREMIUM FINISH OVERLAY ================= */
.finish-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.finish-overlay.show{ display: flex; }

#celebrationCanvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.finish-card{
  position: relative;
  width: min(560px, 92vw);
  background: rgba(18,18,18,.92);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0,0,0,.45);
  padding: 22px 18px 18px;
  color: #fff;
  text-align: center;
  backdrop-filter: blur(8px);
}

.finish-badge{
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(11,102,255,.18);
  border: 1px solid rgba(11,102,255,.35);
  font-size: 26px;
}

.finish-card h3{
  margin: 8px 0 8px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .2px;
}

.finish-text{
  margin: 0 auto 14px;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  line-height: 1.35;
  max-width: 46ch;
}

.finish-consent{
  text-align: left;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 12px 12px;
  margin: 12px 0 14px;
}

.finish-check{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.88);
}

.finish-check input{
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #0b66ff;
}

.finish-actions{
  margin-top: 6px;
}

.finish-btn{
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: #0b66ff;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(0,0,0,.35);
}

.finish-btn:disabled{
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}

.finish-foot{
  margin-top: 12px;
  font-size: 11px;
  color: rgba(255,255,255,.55);
}
