:root {
  --magenta: #D01A63;
  --magenta-dark: #A8114F;
  --magenta-light: #FBE3EE;
  --orange: #F5A623;
  --gray: #8C8279;
  --gray-light: #F4F2F0;
  --text: #4A4441;
  --white: #FFFFFF;
  --error: #D32F2F;
  --success: #2E9E5B;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0,0,0,.08);
  --font: "Trebuchet MS", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--magenta);
  color: var(--text);
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.phone {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--gray-light);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Barra superior */
.topbar {
  background: var(--magenta);
  color: var(--white);
  padding: calc(env(safe-area-inset-top) + 14px) 16px 14px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.topbar h1 { font-size: 20px; text-align: center; font-weight: 700; }
.back {
  background: none; border: 0; color: var(--white);
  font-size: 34px; line-height: 1; cursor: pointer; padding: 0 6px;
  visibility: hidden;
}
.back.visible { visibility: visible; }
.logo-slot { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.logo-slot img { max-width: 40px; max-height: 40px; }

/* Progreso */
.progress {
  display: flex; gap: 8px; justify-content: center;
  padding: 14px 0 4px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #D9D2CC; transition: .3s; }
.dot.active { background: var(--magenta); width: 22px; border-radius: 6px; }
.dot.done { background: var(--orange); }

/* Contenido */
.content { flex: 1; padding: 12px 18px 28px; overflow-y: auto; }
.step { display: none; animation: fade .3s ease; }
.step.active { display: flex; flex-direction: column; gap: 16px; }
@keyframes fade { from { opacity: 0; transform: translateX(16px);} to { opacity: 1; transform: none;} }

h2 { font-size: 24px; line-height: 1.2; color: var(--text); font-weight: 800; }
.hl { color: var(--magenta); }
.hl-orange { color: var(--orange); }
.muted { color: var(--gray); font-size: 15px; line-height: 1.45; }

.hero { text-align: center; padding: 10px 0 4px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.hero-icon { color: var(--magenta); background: var(--magenta-light); border-radius: 50%; padding: 18px; }
.hero-icon.success { color: var(--success); background: #E4F5EA; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.card.center { align-items: center; }

.checklist { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.checklist li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.checklist span {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--magenta); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}

/* Campos */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 700; color: var(--gray); }
select, input[type="tel"], input[type="text"] {
  font: inherit; font-size: 17px; color: var(--text);
  border: 1.5px solid #D9D2CC; border-radius: 10px; padding: 12px;
  background: var(--white); width: 100%; outline: none;
}
select:focus, input:focus, .phone-input:focus-within { border-color: var(--magenta); }
.phone-input {
  display: flex; align-items: center;
  border: 1.5px solid #D9D2CC; border-radius: 10px; overflow: hidden; background: var(--white);
}
.phone-input span { padding: 12px; background: var(--gray-light); color: var(--gray); font-weight: 700; }
.phone-input input { border: 0; border-radius: 0; }
.error { color: var(--error); font-size: 13px; min-height: 16px; }

/* Botones */
.btn {
  font: inherit; font-size: 17px; font-weight: 700;
  border: 0; border-radius: 30px; padding: 15px; cursor: pointer;
  transition: .2s; width: 100%;
}
.btn.primary { background: var(--magenta); color: var(--white); box-shadow: 0 4px 14px rgba(208,26,99,.35); }
.btn.primary:active { background: var(--magenta-dark); transform: scale(.98); }
.btn.primary:disabled { background: #E8B9CB; box-shadow: none; cursor: not-allowed; }
.btn.outline { background: transparent; color: var(--magenta); border: 2px solid var(--magenta); }
.link { background: none; border: 0; color: var(--magenta); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; align-self: center; }
.link:disabled { color: var(--gray); text-decoration: none; cursor: default; }

/* OTP */
.code-boxes { display: flex; gap: 8px; justify-content: center; }
.code-boxes input {
  width: 46px; height: 56px; text-align: center; font-size: 24px; font-weight: 700; padding: 0;
}
.code-boxes input.filled { border-color: var(--magenta); background: var(--magenta-light); }

/* PIN */
.pin-dots { display: flex; gap: 18px; padding: 10px 0; }
.pin-dots span {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--magenta); transition: .15s;
}
.pin-dots span.filled { background: var(--magenta); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 10px; }
.keypad button {
  font: inherit; font-size: 26px; font-weight: 700; color: var(--text);
  background: var(--white); border: 0; border-radius: 50%;
  aspect-ratio: 1; max-width: 76px; margin: 0 auto; width: 100%;
  box-shadow: var(--shadow); cursor: pointer; transition: .1s;
}
.keypad button:active { background: var(--magenta-light); transform: scale(.94); }
.keypad button.ghost { background: transparent; box-shadow: none; }
.keypad button.del { font-size: 22px; color: var(--magenta); }

/* Resumen */
.row { display: flex; justify-content: space-between; font-size: 15px; }
.row span { color: var(--gray); }
.ok { color: var(--success); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #333; color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .3s; max-width: 90%;
  z-index: 9;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast strong { color: var(--orange); letter-spacing: 3px; }
