:root {
  --navy: #0b1f6b;
  --blue: #1f4ed8;
  --blue-2: #3b82f6;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e9f2;
  --bg: #f4f6fb;
  --card: #ffffff;
  --green: #16a34a;
  --green-bg: #ecfdf3;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 31, 107, 0.08);
  --shadow-sm: 0 2px 8px rgba(11, 31, 107, 0.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 100% -50px, rgba(59, 130, 246, 0.10), transparent 60%),
    var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo { height: 38px; width: auto; display: block; }
.header-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.2px;
  background: #eef2ff;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Views ---------- */
main.container { flex: 1 0 auto; padding-top: 34px; padding-bottom: 48px; }
.view { display: none; animation: fade 0.35s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px;
}
.hero-card { text-align: center; padding: 48px 34px; }
.hero-title { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: 0.2px; }
.hero-sub { color: var(--muted); margin-top: 10px; font-size: 15px; }
.hero-sub.muted { font-size: 13.5px; }
.strong-ink { color: var(--ink); font-weight: 700; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

/* ---------- Form fields ---------- */
.field-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 22px;
  flex-wrap: wrap;
}
.input {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 15px;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 78, 216, 0.12); }
.input::placeholder { color: #9aa3b2; }

.phone-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  font-weight: 600;
  color: var(--ink);
}

.phone-label { display: block; margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 13px 24px;
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  box-shadow: 0 6px 16px rgba(31, 78, 216, 0.28);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(31, 78, 216, 0.36); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-pay { flex: 0 0 auto; }

/* ---------- Messages ---------- */
.form-msg { margin-top: 12px; font-size: 14px; min-height: 20px; }
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: var(--green); }

/* ---------- Offer view ---------- */
.badge-congrats {
  display: inline-block;
  font-weight: 800;
  color: var(--navy);
  background: #eef2ff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 16px;
}
.congrats-copy { margin-top: 16px; font-size: 15.5px; color: #2b2f38; }

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 26px 0 6px;
}
.detail {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fbfcfe;
}
.detail-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 700;
}
.detail-value { display: block; margin-top: 4px; font-size: 16px; font-weight: 700; color: var(--ink); word-break: break-word; }

/* ---------- Pay box ---------- */
.pay-box {
  margin-top: 24px;
  border: 1.5px solid #dbe4ff;
  background: linear-gradient(180deg, #f7f9ff, #ffffff);
  border-radius: var(--radius);
  padding: 22px;
}
.pay-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.pay-amount { font-size: 34px; font-weight: 800; color: var(--navy); line-height: 1.1; margin-top: 2px; }
.pay-note { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Fee explainer ---------- */
.fee-explainer {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}
.fee-heading { font-size: 17px; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.fee-explainer p { font-size: 14px; color: #3a3f4a; margin: 10px 0; text-align: justify; }
.fee-explainer strong { color: var(--ink); }

/* ---------- Confirmation ---------- */
.confirm-card { text-align: center; padding: 48px 34px; }
.confirm-check {
  width: 72px; height: 72px; margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--green-bg); color: var(--green);
  font-size: 38px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #bbf7d0;
}

/* ---------- Toast popup ---------- */
.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  background: var(--green-bg);
  color: #14532d;
  border: 1px solid #bbf7d0;
  box-shadow: 0 12px 30px rgba(22, 163, 74, 0.22);
  border-radius: 12px;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-check {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
}

/* ---------- Loader ---------- */
.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 70;
}
.spinner {
  width: 46px; height: 46px;
  border: 4px solid #dbe4ff;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 18px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.site-footer a { color: var(--blue); text-decoration: none; }
.site-footer .dot { margin: 0 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .card, .hero-card, .confirm-card { padding: 24px 18px; }
  .details-grid { grid-template-columns: 1fr; }
  .btn-pay { width: 100%; }
  .hero-title { font-size: 22px; }
  .pay-amount { font-size: 30px; }
  .header-tag { display: none; }
}
