:root {
  /* Core palette */
  --bg: #f4f7fb;
  --bg-soft: #eef3ff;

  --card: rgba(255, 255, 255, 0.75);
  --card-border: rgba(15, 23, 42, 0.08);

  --text: #0f172a;        /* slate-900 */
  --muted: #475569;       /* slate-600 */
  --faint: #64748b;       /* slate-500 */

  --accent: #2563eb;      /* blue-600 */
  --accent-2: #60a5fa;    /* blue-400 */

  --shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
  --radius: 22px;

  --maxw: 1100px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  line-height: 1.4;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
small { color: var(--faint); }

/* ---------- Background ---------- */

.bg-page {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  overflow: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(96,165,250,0.35), transparent 55%),
    radial-gradient(700px 500px at 85% 15%, rgba(37,99,235,0.25), transparent 50%),
    linear-gradient(180deg, #f8faff 0%, #eef3ff 65%, #f8faff 100%);
}

/* ---------- Top bar ---------- */
.topbar{
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  max-width: 1100px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 16px;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(37,99,235,0.15);
}

.brand-name {
  font-weight: 700;
}

.topnav{
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.topnav-link {
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--muted);
}
.topnav-link:hover {
  background: rgba(37,99,235,0.08);
  color: var(--text);
}

/* ---------- Hero ---------- */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 18px;
  display: grid;
  place-items: center;
}

.hero-card {
  width: min(720px, 100%);
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-footnote {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  max-width: 420px;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37,99,235,0.10);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(32px, 4.5vw, 50px);
  letter-spacing: -0.6px;
  line-height: 1.05;
}

.hero-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 18px);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-minimal {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-minimal .hero-card {
  background: none;
  box-shadow: none;
  border: none;
  padding: 0;
}

/* Center button visually */
.hero-cta {
  padding: 20px 36px;
  font-size: 18px;
  border-radius: 999px;
  box-shadow: none !important;

}

.hero-cta:hover,
.hero-cta:active {
  box-shadow: none !important;
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: 16px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}
.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(37,99,235,0.08);
  color: var(--accent);
}
.btn-ghost:hover {
  background: rgba(37,99,235,0.14);
}

/* ---------- Form ---------- */

.form-shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 32px 18px 48px;
  display: flex;
  justify-content: center;
  min-height: auto;
  align-items: center;
}


.form-card {
  width: 100%;
  max-width: 800px;
  min-height: clamp(520px, 65vh, 760px);
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.form-card.is-success {
  min-height: auto !important;
  height: auto !important;
  display: flex;
  flex-direction: column;
  padding-top: clamp(28px, 5vh, 64px);
  padding-bottom: clamp(28px, 5vh, 64px);
}

.form-card.is-success .success-layout {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.form-body {
  flex: 1;
  display: flex;
  align-items: center;  
}

.step-content {
  width: 100%;
  max-width: 720px;
}

.form-title {
  font-size: clamp(28px, 3.6vw, 40px);
  margin-bottom: 10px;
}

.form-subtitle {
  color: var(--muted);
  margin-bottom: 16px;
}

.form-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.fineprint {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--faint);
}

/* Progress bar */

.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(37,99,235,0.12);
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease;
}

/* Steps */

.step {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--card-border);
}

.field-label {
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
}

.field-input {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.15);
  background: white;
  font-size: 16px;
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.2);
}

.field-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--faint);
}

/* Controls */

.controls {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.controls-left {
  display: flex;
  align-items: center;
}

.controls-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}


.kbd-hint {
  font-size: 13px;
  color: var(--faint);
}

kbd {
  background: #f1f5f9;
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 6px;
  padding: 2px 6px;
}

/* Footer */

.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px;
  color: var(--faint);
  font-size: 13px;
}

/* Mobile */

@media (max-width: 640px) {
  .btn {
    width: 100%;
    justify-content: center;
  }
  .kbd-hint {
    display: none;
  }
}


.success-layout {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(18px, 2.4vw, 24px);
}

.success-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.18);
  margin-bottom: 10px;
}

.success-title {
  margin: 0 0 10px;
  font-size: clamp(34px, 4.2vw, 46px);
  letter-spacing: -0.5px;
  line-height: 1.05;
}

.success-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 18px;
  max-width: 60ch;
}

.success-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.success-meta {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 13px;
}

.success-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.85);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.14);
}

@media (max-width: 640px) {
  .success-subtitle { font-size: 16px; }
  .success-actions .btn { width: 100%; }
}

#nextBtn {
  box-shadow: none !important;
  background: #2563eb; 
}

#submitBtn, #backHomeButton {
  background: #2563eb;
  font-weight: 600;
}
#nextBtn,
#submitBtn, #backHomeButton {
  box-shadow: none !important;
}

#nextBtn:hover,
#submitBtn:hover,
#backHomeButton:hover,
#nextBtn:active,
#submitBtn:active,
#backHomeButton:active{
  box-shadow: none !important;
}

.status {
  margin-top: 10px;
  min-height: 20px;
  font-size: 14px;
  margin-left: 4px;
}

.status.error {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 10px;
  font-size: 13px;
  border-radius: 999px; /* pill */

  color: #991b1b; /* red-800 */
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
}

.status.error::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.field-input.is-error {
  border-color: rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10);
}


@media (max-height: 700px) {
  .form-body {
    align-items: flex-start;
  }
}