* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --snap-yellow: #FFFC00;
  --snap-yellow-glow: rgba(255, 252, 0, 0.25);
  --bg-dark: #07090E;
  --card-bg: #11141D;
  --card-inner: #171B26;
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #FFFFFF;
  --text-secondary: #94A0B8;
  --text-muted: #5B657A;
  --danger: #FF3B30;
  --success: #30D158;
}

body {
  background-color: var(--bg-dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  color: var(--text-main);
}

.app-wrapper { width: 100%; max-width: 420px; margin: auto; }

.app-card {
  background: var(--card-bg);
  border-radius: 28px;
  padding: 24px 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-color);
  position: relative;
  overflow: hidden;
}

.app-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--snap-yellow), transparent);
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.step-item.active { color: var(--snap-yellow); }
.step-item.completed { color: var(--text-main); }

.step-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--card-inner);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.step-item.active .step-dot {
  background: var(--snap-yellow);
  color: #000;
  border-color: var(--snap-yellow);
  font-weight: 800;
}

.step-item.completed .step-dot {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

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

.brand-icon {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
}

.brand-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

.brand-title { font-size: 17px; font-weight: 800; letter-spacing: -0.4px; }
.brand-title span { color: var(--snap-yellow); }

.status-pill {
  background: rgba(255, 252, 0, 0.08);
  border: 1px solid rgba(255, 252, 0, 0.25);
  color: var(--snap-yellow);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.page { display: none; flex-direction: column; animation: fadeIn 0.3s ease forwards; }
.page.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.feature-card {
  background: linear-gradient(145deg, #181D29 0%, #12151F 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 18px;
}

.feature-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.feature-sub { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }

.field-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-options { display: grid; gap: 8px; margin-bottom: 14px; }
.country-grid { grid-template-columns: 1fr 1fr; }
.operator-grid { grid-template-columns: repeat(2, 1fr); }

.custom-option-btn {
  background: var(--card-inner);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  width: 100%;
}

.custom-option-btn:hover { border-color: rgba(255, 255, 255, 0.2); color: #fff; }

.custom-option-btn.selected {
  background: rgba(255, 252, 0, 0.06);
  border-color: var(--snap-yellow);
  color: #fff;
  box-shadow: 0 0 14px var(--snap-yellow-glow);
}

.custom-option-btn img {
  width: 18px; height: 13px;
  border-radius: 2px;
  object-fit: cover;
}

.username-box, .phone-box {
  background: var(--card-inner);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  height: 48px;
  transition: all 0.2s;
}

.username-box:focus-within, .phone-box:focus-within {
  border-color: var(--snap-yellow);
  box-shadow: 0 0 12px var(--snap-yellow-glow);
}

.username-box i { color: var(--text-muted); margin-right: 10px; font-size: 16px; }

.username-box input, .phone-box input {
  background: transparent;
  border: none;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  outline: none;
}

.username-box input::placeholder, .phone-box input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.country-code-pill {
  font-weight: 800;
  color: var(--snap-yellow);
  font-size: 14px;
  padding-right: 10px;
  margin-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.hint-msg {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.error-msg {
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
  min-height: 16px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-action-btn {
  background: var(--snap-yellow);
  border: none;
  border-radius: 14px;
  width: 100%;
  height: 50px;
  font-size: 14px;
  font-weight: 800;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  transition: all 0.2s;
}

.main-action-btn:hover { background: #ECE900; transform: translateY(-1px); }
.main-action-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.ghost-btn {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 14px;
  height: 44px;
  width: 100%;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  transition: 0.2s;
}

.ghost-btn:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }

.otp-grid {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0;
}

.otp-digit {
  width: 48px;
  height: 54px;
  background: var(--card-inner);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--snap-yellow);
  outline: none;
  transition: all 0.2s;
}

.otp-digit:focus {
  border-color: var(--snap-yellow);
  box-shadow: 0 0 10px var(--snap-yellow-glow);
}

.timer-wrap {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 6px;
}

.timer-wrap span { color: var(--snap-yellow); font-weight: 700; }

.receipt-card {
  background: var(--card-inner);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border-color);
  margin: 14px 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.receipt-row:last-child { border-bottom: none; }
.receipt-row .label { color: var(--text-secondary); }
.receipt-row .value { font-weight: 700; color: #fff; }

.footer-credits {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#loadingOverlay {
  display: none !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  min-height: 280px;
}

#loadingOverlay.active { display: flex !important; }

.loader {
  border: 4px solid rgba(255, 255, 255, 0.05);
  border-top: 4px solid var(--snap-yellow);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 0.9s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.loading-text { font-size: 14px; font-weight: 700; color: var(--text-main); }
.loading-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  text-align: center;
  line-height: 1.4;
}

.session-id {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 12px;
  padding: 6px 14px;
  background: var(--card-inner);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: rgba(48, 209, 88, 0.12);
  border: 1.5px solid rgba(48, 209, 88, 0.3);
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-box {
  background: linear-gradient(160deg, #171B26 0%, #11141D 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 28px 22px 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
  transform: scale(0.9) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.modal-overlay.active .modal-box { transform: scale(1) translateY(0); }

.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--snap-yellow), transparent);
}

.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 59, 48, 0.12);
  border: 2px solid rgba(255, 59, 48, 0.35);
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
  animation: pulseIcon 1.8s ease-in-out infinite;
}

.modal-icon.success {
  background: rgba(48, 209, 88, 0.12);
  border-color: rgba(48, 209, 88, 0.35);
  color: var(--success);
}

.modal-icon.info {
  background: rgba(255, 252, 0, 0.12);
  border-color: rgba(255, 252, 0, 0.35);
  color: var(--snap-yellow);
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.modal-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 22px;
  padding: 0 4px;
}

.modal-btn {
  background: var(--snap-yellow);
  border: none;
  border-radius: 12px;
  width: 100%;
  height: 46px;
  font-size: 13px;
  font-weight: 800;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: inherit;
}

.modal-btn:hover { background: #ECE900; transform: translateY(-1px); }
.modal-btn:active { transform: translateY(0); }