/* ===========================
   CSS Variables
   =========================== */
:root {
  --green-primary: #2563eb;
  --green-dark: #1d4ed8;
  --green-light: #eff6ff;
  --green-icon-bg: #dbeafe;
  --navy: #1e3a8a;
  --text-dark: #0f1f3d;
  --text-muted: #8a94a6;
  --text-body: #4a5568;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  --bg-page: #f0f4f8;
  --bg-card: #ffffff;
  --radius-card: 16px;
  --radius-btn: 10px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.07);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--navy);
  text-decoration: underline;
}

a:hover {
  color: var(--green-primary);
}

/* ===========================
   Header
   =========================== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 14px 20px;
}

.site-header-inner {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--green-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.3px;
}

.logo-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--green-primary);
  letter-spacing: 1.5px;
}

.header-secure {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-body);
  letter-spacing: 0.5px;
}

/* ===========================
   Progress Bar
   =========================== */
.progress-bar-container {
  background: #fff;
  padding: 10px 24px 12px;
  border-bottom: 1px solid var(--border-color);
}

.progress-bar-inner {
  max-width: 520px;
  margin: 0 auto;
}

.progress-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-label {
  font-size: 13px;
  color: var(--text-muted);
}

.progress-percent {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-primary);
}

.progress-track {
  width: 100%;
  height: 5px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green-primary);
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ===========================
   Main Content
   =========================== */
.main-content {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px 60px;
}

/* ===========================
   Steps (show/hide)
   =========================== */
.step {
  display: none;
  width: 100%;
  max-width: 520px;
}

.step.active {
  display: block;
}

/* ===========================
   Card
   =========================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 40px 48px 36px;
}

.card-centered {
  text-align: center;
}

.card-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.card-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  margin-top: -18px;
  margin-bottom: 24px;
}

/* ===========================
   Option Grid (button cards)
   =========================== */
.option-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

.option-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.option-card {
  background: #fff;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 28px 20px 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  font-family: var(--font);
}

.option-card:hover {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(26, 158, 80, 0.1);
}

.option-card.selected {
  border-color: var(--green-primary);
  background: var(--green-light);
  box-shadow: 0 0 0 3px rgba(26, 158, 80, 0.12);
}

.option-icon-wrap {
  width: 60px;
  height: 60px;
  background: var(--green-icon-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}

/* ===========================
   Inputs
   =========================== */
.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.text-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 17px;
  font-family: var(--font);
  color: var(--text-dark);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  background: #fff;
}

.text-input::placeholder {
  color: #b0bac8;
}

.text-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 158, 80, 0.12);
}

.text-input.error {
  border-color: #e53e3e;
}

/* Remove number input arrows */
.text-input[type="number"]::-webkit-inner-spin-button,
.text-input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.text-input[type="number"] {
  -moz-appearance: textfield;
  text-align: center;
  font-size: 22px;
  letter-spacing: 2px;
}

.input-error {
  font-size: 13px;
  color: #e53e3e;
  margin-top: 6px;
}

/* ===========================
   Phone Input
   =========================== */
.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.phone-input-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 158, 80, 0.12);
}

.phone-prefix {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 14px 14px 16px;
  flex-shrink: 0;
}

.flag-emoji {
  font-size: 20px;
  line-height: 1;
}

.country-code {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.phone-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
  flex-shrink: 0;
}

.phone-input {
  flex: 1;
  padding: 14px 16px;
  font-size: 17px;
  font-family: var(--font);
  color: var(--text-dark);
  border: none;
  outline: none;
  background: transparent;
}

.phone-input::placeholder {
  color: #b0bac8;
}

/* ===========================
   Buttons
   =========================== */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--green-primary);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.18s, transform 0.1s;
  margin-bottom: 24px;
}

.btn-primary:hover {
  background: var(--green-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

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

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ===========================
   Consent Text (Phone step)
   =========================== */
.consent-text {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-bottom: 20px;
}

.consent-text p {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 12px;
  text-align: justify;
}

.consent-text p:last-child {
  margin-bottom: 0;
}

/* ===========================
   Secure Badge
   =========================== */
.secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===========================
   Loading / Analyzing Step
   =========================== */
.spinner-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid var(--green-icon-bg);
  border-top-color: var(--green-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

/* ===========================
   OTP Step
   =========================== */
.otp-shield-icon {
  width: 68px;
  height: 68px;
  background: var(--green-primary);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 16px;
}

.otp-box {
  width: 64px;
  height: 72px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  outline: none;
  font-family: var(--font);
  color: var(--text-dark);
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
  caret-color: var(--green-primary);
}

.otp-box:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(26, 158, 80, 0.12);
}

.otp-box.filled {
  border-color: var(--green-primary);
}

.otp-resend {
  margin: 8px 0 20px;
}

.otp-resend p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

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

.btn-link:hover {
  color: var(--green-dark);
}

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0 0 16px;
}

.btn-back {
  background: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  cursor: pointer;
  font-family: var(--font);
  padding: 0;
  margin-bottom: 24px;
  transition: color 0.15s;
}

.btn-back:hover {
  color: var(--green-primary);
}

/* ===========================
   Success Step
   =========================== */
.success-icon {
  width: 80px;
  height: 80px;
  background: var(--green-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-details {
  background: var(--green-light);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0 24px;
  text-align: left;
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.8;
}

/* ===========================
   Utility
   =========================== */
.hidden {
  display: none !important;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border-color);
  padding: 24px 20px 32px;
  text-align: center;
}

.footer-copy {
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 20px;
}

.footer-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0 auto 20px;
  max-width: 560px;
}

.footer-legal {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.footer-legal p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.footer-legal p:last-child {
  margin-bottom: 0;
}

.footer-legal a {
  color: var(--text-muted);
}

.footer-legal a:hover {
  color: var(--green-primary);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 600px) {
  .card {
    padding: 28px 20px 24px;
  }

  .card-title {
    font-size: 22px;
  }

  .option-card {
    padding: 20px 12px 16px;
  }

  .option-icon-wrap {
    width: 50px;
    height: 50px;
  }

  .option-label {
    font-size: 15px;
  }

  .otp-box {
    width: 52px;
    height: 60px;
    font-size: 22px;
  }

  .site-footer {
    padding: 20px 16px 24px;
  }

  .header-logo .logo-name {
    font-size: 15px;
  }
}
