:root {
  --wa: #25d366;
  --wa-dark: #128c7e;
  --bg: #f0f2f5;
  --card: #ffffff;
  --card-2: #f8fafb;
  --line: #e3e9ee;
  --text: #111b21;
  --text-2: #667781;
  --red: #dc3545;
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 20px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- shell & cards ---------- */
.shell { width: 100%; max-width: 420px; position: relative; z-index: 1; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 30px 28px;
  box-shadow: 0 12px 40px rgba(17, 27, 33, .08), 0 2px 6px rgba(17, 27, 33, .04);
}

.stage { display: none; }
.stage.active { display: block; animation: stageIn .45s cubic-bezier(.22, 1, .36, 1); }
@keyframes stageIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.brand-badge {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(140deg, var(--wa), var(--wa-dark));
  display: grid; place-items: center; color: #ffffff;
}
.brand-badge svg { width: 20px; height: 20px; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.brand-tag {
  margin-left: auto; font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--wa-dark);
  border: 1px solid rgba(18, 140, 126, .3); border-radius: 99px; padding: 4px 10px;
  background: rgba(37, 211, 102, .08);
}

h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px; }
h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 8px; text-align: center; }
.lead { font-size: 14.5px; line-height: 1.55; color: var(--text-2); margin-bottom: 22px; }
.lead.center { text-align: center; }
.lead strong { color: var(--wa-dark); font-weight: 600; }

/* ---------- whatsapp strip ---------- */
.wa-strip {
  display: flex; align-items: center; gap: 12px;
  background: rgba(37, 211, 102, .1);
  border: 1px solid rgba(37, 211, 102, .3);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 24px;
}
.wa-logo { width: 30px; height: 30px; color: var(--wa-dark); flex-shrink: 0; }
.wa-strip-title { font-size: 13.5px; font-weight: 600; }
.wa-strip-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ---------- phone input ---------- */
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; letter-spacing: .02em; }

.phone-row {
  display: flex; gap: 8px; border-radius: 14px;
  transition: box-shadow .2s ease;
}
.phone-row:focus-within .phone-wrap {
  border-color: var(--wa);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, .18);
}
.phone-row.shake { animation: shake .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.phone-wrap {
  display: flex; align-items: center; flex: 1; height: 52px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

#phone-input {
  flex: 1; height: 100%; padding: 0 16px; min-width: 0;
  background: transparent; border: 0;
  color: var(--text); font: inherit; font-size: 16.5px; font-weight: 500; letter-spacing: .03em;
  outline: none;
}
#phone-input::placeholder { color: #a7b6bf; font-weight: 400; }

.field-hint { font-size: 11.5px; color: #93a3ad; margin-top: 8px; line-height: 1.5; }

.field-error {
  font-size: 12.5px; color: var(--red); margin-top: 8px;
  opacity: 0; transform: translateY(-3px); transition: all .2s ease;
}
.field-error.show { opacity: 1; transform: translateY(0); }

/* ---------- CTA ---------- */
.cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; margin-top: 20px;
  background: linear-gradient(140deg, var(--wa), #1eb85a);
  border: 0; border-radius: 14px; color: #ffffff;
  font: inherit; font-size: 15.5px; font-weight: 700; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  box-shadow: 0 8px 20px rgba(37, 211, 102, .3);
}
.cta svg { width: 18px; height: 18px; transition: transform .15s ease; }
.cta:hover { filter: brightness(1.05); box-shadow: 0 10px 26px rgba(37, 211, 102, .4); }
.cta:hover svg { transform: translateX(3px); }
.cta:active { transform: scale(.985); }
.cta:disabled { opacity: .55; cursor: wait; }
.cta.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--text);
  box-shadow: none;
}
.cta.ghost:hover { border-color: var(--wa); color: var(--wa-dark); }

.fine-print { font-size: 11.5px; color: #9dabb5; text-align: center; margin-top: 18px; line-height: 1.5; }

/* ---------- verify stage ---------- */
#stage-verify { text-align: center; }

.loader-orbit { position: relative; width: 108px; height: 108px; margin: 4px auto 22px; }
.orbit-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(37, 211, 102, .2);
  border-top-color: var(--wa);
  animation: spin 1.1s linear infinite;
}
.orbit-ring::after {
  content: ''; position: absolute; inset: 8px; border-radius: 50%;
  border: 2px dashed rgba(37, 211, 102, .25);
  animation: spin 6s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.orbit-core {
  position: absolute; inset: 24px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2fe07a, var(--wa-dark));
  display: grid; place-items: center;
  box-shadow: 0 0 30px rgba(37, 211, 102, .4);
  animation: pulse 2.2s ease-in-out infinite;
}
.orbit-core svg { width: 30px; height: 30px; color: #fff; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.mono-phone { font-weight: 700; color: var(--wa-dark); }
.verify-hint { font-size: 13px; color: var(--text-2); margin-bottom: 22px; }

.steps { list-style: none; text-align: left; margin-bottom: 22px; min-height: 132px; }
.steps li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; color: var(--text-2);
  padding: 7px 2px; opacity: 0; transform: translateY(6px);
  animation: stepIn .35s ease forwards;
}
@keyframes stepIn { to { opacity: 1; transform: translateY(0); } }
.steps li .step-ico {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center;
}
.steps li.pending .step-ico {
  border: 2px solid rgba(102, 119, 129, .3);
  border-top-color: var(--text-2);
  animation: spin .9s linear infinite;
}
.steps li.done { color: var(--text); }
.steps li.done .step-ico { background: rgba(37, 211, 102, .18); color: var(--wa-dark); animation: none; }
.steps li.done .step-ico svg { width: 11px; height: 11px; }
.steps li.real { color: var(--text); }
.steps li.real .step-text::after {
  content: 'live'; margin-left: 7px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--wa-dark);
  border: 1px solid rgba(18, 140, 126, .35); border-radius: 99px; padding: 1px 6px;
}

.progress-track {
  height: 5px; border-radius: 99px; background: rgba(17, 27, 33, .08);
  overflow: hidden; margin-bottom: 12px;
}
.progress-fill {
  height: 100%; width: 4%; border-radius: 99px;
  background: linear-gradient(90deg, var(--wa-dark), var(--wa));
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
}
.verify-meta { font-size: 12px; color: #93a3ad; }
.dot-sep { margin: 0 6px; }

/* ---------- success ---------- */
#stage-success, #stage-error { text-align: center; }

.success-mark { width: 96px; height: 96px; margin: 6px auto 20px; }
.success-mark svg { width: 100%; height: 100%; }
.success-circle {
  stroke: var(--wa); stroke-width: 2.5;
  stroke-dasharray: 157; stroke-dashoffset: 157;
  animation: draw .6s cubic-bezier(.65, 0, .45, 1) forwards;
}
.success-check {
  stroke: var(--wa); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
  animation: draw .4s cubic-bezier(.65, 0, .45, 1) .55s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.error-mark { width: 64px; height: 64px; margin: 6px auto 18px; color: var(--red); }
.error-mark svg { width: 100%; height: 100%; }

.foot {
  text-align: center; font-size: 11px; color: #9dabb5; margin-top: 18px;
}

/* ---------- small screens ---------- */
@media (max-width: 460px) {
  body { padding: 12px; align-items: flex-start; padding-top: max(12px, env(safe-area-inset-top)); }
  .card { padding: 26px 20px 22px; }
  h1 { font-size: 23px; }
}
