/* ============================================================
   Vocal Go - Onboarding wizard
   ============================================================ */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --success: #10b981;
  --danger: #ef4444;

  --bg: #faf9ff;
  --bg-soft: #f4f3fb;
  --bg-card: #ffffff;

  --text-dark: #0f172a;
  --text-main: #1e293b;
  --text-light: #64748b;
  --text-muted: #94a3b8;

  --border: #e9e7f5;
  --border-strong: #d8d4ee;

  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-md: 0 4px 12px -2px rgba(15,23,42,0.08);
  --shadow-lg: 0 16px 40px -8px rgba(99,102,241,0.18);
  --shadow-xl: 0 24px 60px -12px rgba(99,102,241,0.25);

  --radius-sm: 0.4rem;
  --radius-md: 0.65rem;
  --radius-lg: 1rem;
  --radius-xl: 1.4rem;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 700px 400px at 80% 0%, rgba(99,102,241,0.10), transparent 60%),
    radial-gradient(ellipse 500px 300px at 0% 100%, rgba(236,72,153,0.07), transparent 65%);
  background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===================== TOPBAR ===================== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 0.5rem;
  background: var(--gradient);
  box-shadow: 0 2px 6px rgba(99,102,241,0.4);
}
.brand-go {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}
.topbar-right { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--text-light); }
.topbar-right .badge-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
  box-shadow: var(--shadow-sm);
}
.topbar-right .badge-pill strong { color: var(--text-dark); }

/* ===================== STEPPER ===================== */
.stepper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem auto 2rem;
  flex-wrap: wrap;
  padding: 0 1rem;
}
.step {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-light);
  transition: all 0.2s;
}
.step .dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-light);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem;
}
.step.active {
  border-color: transparent;
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 12px -2px rgba(99,102,241,0.4);
}
.step.active .dot { background: rgba(255,255,255,0.25); color: white; }
.step.done { color: var(--success); border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.08); }
.step.done .dot { background: var(--success); color: white; }

/* ===================== MAIN ===================== */
.main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 3rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  animation: cardIn 0.35s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}
.card .sub {
  color: var(--text-light);
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 2rem;
}
.card .muted { color: var(--text-light); font-size: 0.9rem; line-height: 1.5; margin-top: 0.5rem; }
.card .muted-xs { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.4rem; }

/* ===================== FORM ===================== */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field > span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}
.field input, .field textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-dark);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.field textarea { resize: vertical; min-height: 80px; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 6px 20px -6px rgba(99,102,241,0.6);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -8px rgba(99,102,241,0.65); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: white;
  color: var(--text-dark);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-lg { padding: 0.95rem 1.6rem; font-size: 1rem; width: 100%; }
.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.82rem; }

.link-btn {
  background: none; border: none; padding: 0;
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  font-size: inherit;
  cursor: pointer;
}

/* ===================== AUTH CARD ===================== */
.auth-card { text-align: center; padding-top: 3rem; padding-bottom: 3rem; }
.auth-card h1 { text-align: center; }
.auth-card .sub { text-align: center; max-width: 440px; margin-left: auto; margin-right: auto; }
.auth-card .form { max-width: 380px; margin: 0 auto; }
.auth-icon {
  width: 64px; height: 64px;
  border-radius: 1rem;
  background: var(--gradient);
  color: white;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 10px 30px -8px rgba(99,102,241,0.5);
}
.auth-icon svg { width: 32px; height: 32px; }
.info-line {
  font-size: 0.88rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 0.5rem;
}
.auth-error {
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: left;
}
.trust-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem;
  margin-top: 1.75rem;
  font-size: 0.78rem;
  color: var(--text-light);
}
.trust-row span { display: inline-flex; align-items: center; gap: 0.35rem; }
.trust-row svg { width: 14px; height: 14px; color: var(--success); }

/* ===================== STEP 1 - GIFT ===================== */
.gift-card { text-align: center; padding-top: 3rem; padding-bottom: 3rem; }
.gift-burst {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 16px 40px -8px rgba(16,185,129,0.5);
  animation: pulse 2s infinite;
}
.gift-burst .burst-emoji { font-size: 3rem; line-height: 1; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.gift-amount {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0.5rem 0 1rem;
}
.gift-card .btn-primary { max-width: 320px; margin: 1.25rem auto 0; }

/* ===================== STEP 2 - NUMBERS ===================== */
.region-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.region-tab {
  flex: 1 1 auto;
  min-width: 110px;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  gap: 0.15rem;
}
.region-tab:hover { color: var(--text-dark); background: white; }
.region-tab .code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
}
.region-tab .name {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}
.region-tab.active {
  background: white;
  border-color: var(--primary);
  color: var(--text-dark);
  box-shadow: 0 2px 6px rgba(99,102,241,0.15);
}
.region-tab.active .code { color: var(--primary); }
.region-tab.active .name { color: var(--text-light); }

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.number-tile {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1rem 1.15rem;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  text-align: left;
}
.number-tile:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.number-tile.selected {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(236,72,153,0.05));
  box-shadow: 0 0 0 2px var(--primary), var(--shadow-md);
}
.number-tile .num {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.02em;
}
.number-tile .meta {
  font-size: 0.78rem;
  color: var(--text-light);
}
.number-tile .check {
  position: absolute;
  top: 0.6rem; right: 0.7rem;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gradient);
  color: white;
  display: none;
  align-items: center; justify-content: center;
}
.number-tile .check svg { width: 12px; height: 12px; }
.number-tile.selected .check { display: inline-flex; }

.numbers-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.numbers-actions .btn-primary { min-width: 220px; }

.loading-block {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center;
  gap: 0.6rem;
  padding: 2.5rem 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

@media (max-width: 600px) {
  .numbers-grid { grid-template-columns: 1fr; }
}

/* ===================== STEP 3 - CONFIG ===================== */
.config-card .block {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.block-head { margin-bottom: 0.85rem; }
.block-head h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex; align-items: center; gap: 0.5rem;
}
.block-head .opt {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: white;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.block-head p {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 0.2rem;
}

.welcome-tabs {
  display: flex; gap: 0.4rem;
  background: white;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.welcome-tab {
  flex: 1;
  min-width: 90px;
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  transition: all 0.15s;
}
.welcome-tab:hover { color: var(--text-dark); }
.welcome-tab.active {
  background: var(--gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  background: white;
  transition: all 0.15s;
}
.dropzone svg { width: 36px; height: 36px; color: var(--text-muted); margin-bottom: 0.5rem; }
.dropzone .drop-text { font-size: 0.9rem; color: var(--text-main); }
.dropzone .drop-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; }
.dropzone.over { border-color: var(--primary); background: rgba(99,102,241,0.04); }
.drop-status {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.25);
  color: var(--success);
  font-weight: 600;
}

.mode-options { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.mode {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}
.mode:has(input:checked) {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.04));
  box-shadow: 0 0 0 2px var(--primary);
}
.mode input { margin-top: 0.25rem; accent-color: var(--primary); }
.mode-title { font-weight: 600; color: var(--text-dark); font-size: 0.92rem; }
.mode-desc { font-size: 0.8rem; color: var(--text-light); margin-top: 0.15rem; }

.forward-numbers .field { margin-bottom: 0.6rem; }
.fwd-extras { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.6rem; }

.checkbox-row {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}
.checkbox-row input { margin-top: 0.2rem; accent-color: var(--primary); transform: scale(1.15); }
.checkbox-row:has(input:checked) {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.04));
  box-shadow: 0 0 0 2px var(--primary);
}
.check-title { font-weight: 600; color: var(--text-dark); font-size: 0.92rem; }
.check-desc { font-size: 0.8rem; color: var(--text-light); margin-top: 0.15rem; }

.config-actions { margin-top: 0.5rem; }

/* ===================== STEP 4 - READY ===================== */
.ready-card { text-align: center; padding-top: 3.5rem; padding-bottom: 3.5rem; }
.ready-stage { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.ready-stage[hidden] { display: none; }
.ready-stage h2 { color: var(--text-dark); font-weight: 800; letter-spacing: -0.02em; font-size: 1.6rem; }
.ready-spinner {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 4px solid rgba(99,102,241,0.15);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ready-check {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 40px -8px rgba(16,185,129,0.5);
  animation: bounceIn 0.5s ease both;
}
.ready-check svg { width: 44px; height: 44px; }
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.5); }
  60% { opacity: 1; transform: scale(1.1); }
  100% { transform: scale(1); }
}
.ready-phone {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  padding: 0.5rem 1.25rem;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* ===================== SPINNER (inline button) ===================== */
.spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.btn-ghost .spinner { border-color: rgba(99,102,241,0.25); border-top-color: var(--primary); }

/* ===================== TOASTS ===================== */
.toasts {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 0.5rem;
  max-width: 360px;
}
.toast {
  background: white;
  border: 1px solid var(--border-strong);
  border-left-width: 4px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  animation: toastIn 0.3s ease both;
}
.toast.error { border-left-color: var(--danger); color: var(--danger); }
.toast.info { border-left-color: var(--primary); color: var(--text-dark); }
.toast.success { border-left-color: var(--success); color: var(--success); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===================== FOOTER ===================== */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer a { color: var(--text-light); }

@media (max-width: 600px) {
  .card { padding: 1.5rem; }
  .topbar { padding: 1rem; }
  .footer { padding: 1rem; flex-direction: column; align-items: flex-start; }
  .stepper .step .label { display: none; }
}
