:root {
  --bg: #070b14;
  --bg2: #0d1321;
  --card: #121a2b;
  --border: #1e2a40;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
}

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

html { scroll-behavior:smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59,130,246,.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(16,185,129,.08), transparent);
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(59,130,246,.3);
}

.brand .name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand .name span {
  color: var(--primary);
}

.badge {
  background: rgba(59,130,246,.15);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid rgba(59,130,246,.25);
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}

.stat b {
  display: block;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
}

.stat {
  font-size: 0.7rem;
  color: var(--muted);
}

/* Alert */
.alert {
  display: none;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  align-items: center;
  gap: 10px;
  animation: slideIn .25s ease;
}

.alert.show { display: flex; }

.alert.success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #34d399; }
.alert.error   { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #f87171; }
.alert.info    { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.3); color: #60a5fa; }
.alert.warning { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.3); color: #fbbf24; }

.alert .msg { flex: 1; }
.fix-btn {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: none;
}

.card.active { display: block; animation: fadeUp .3s ease; }

.step-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 16px;
}

.field { display: block; margin-bottom: 16px; }

.lbl {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.phone-row {
  display: flex;
  gap: 10px;
}

.select-wrap {
  position: relative;
  flex: 0 0 140px;
}

.select-wrap select {
  width: 100%;
  appearance: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 28px 12px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: border .2s;
}

.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-size: 0.8rem;
}

.select-wrap select:focus {
  border-color: var(--primary);
}

#phone {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
  transition: border .2s;
}

#phone:focus { border-color: var(--primary); }

/* Buttons */
.btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59,130,246,.4);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  width: auto;
  padding: 8px 14px;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn-sm:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: none;
  transform: none;
}

/* OTP */
.otp-wrap {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}

.otp-input {
  width: 46px;
  height: 54px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  outline: none;
  transition: all .2s;
  caret-color: var(--primary);
}

.otp-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}

.resend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.timer {
  font-size: 0.85rem;
  color: var(--muted);
}

.timer.warning { color: var(--warning); }

/* Result */
.result-box {
  text-align: center;
  padding: 10px 0;
}

.result-box .icon {
  width: 64px;
  height: 64px;
  background: rgba(16,185,129,.15);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
  animation: pop .4s ease;
}

.result-box h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--success);
}

.result-box p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Demo code box */
.demo-box {
  background: rgba(59,130,246,.08);
  border: 1px dashed rgba(59,130,246,.35);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  text-align: center;
  display: none;
}

.demo-box.show { display: block; }

.demo-box .label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.demo-box .code {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--primary);
  font-family: monospace;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

footer a { color: var(--primary); text-decoration: none; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Mobile tweaks */
@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .otp-input { width: 42px; height: 50px; font-size: 1.25rem; }
  .select-wrap { flex: 0 0 120px; }
  .phone-row { flex-direction: column; }
  .select-wrap { flex: 1; }
}
