:root {
  --bg: #070b14;
  --card: #0e1626;
  --border: rgba(255, 255, 255, 0.10);
  --text: #eef3f8;
  --text-muted: #93a1b7;
  --text-faint: #6b7688;
  --primary: #2ebbd6;
  --primary-dark: #1f8fa3;
  --primary-bright: #7ee8f5;
  --primary-light: rgba(46, 187, 214, 0.14);
  --danger: #ff6b81;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 40px rgba(46, 187, 214, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Decorative dot fields */
.bg-dots {
  position: fixed;
  width: 420px;
  height: 420px;
  background-image: radial-gradient(circle, rgba(46,187,214,0.30) 1.4px, transparent 1.4px);
  background-size: 18px 18px;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle, #000 0%, transparent 72%);
}
.bg-dots-tr { top: -80px; right: -80px; }
.bg-dots-bl { bottom: -80px; left: -80px; }

.page {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 40px 64px;
}

/* Brand */
.brand { display: flex; align-items: center; margin-bottom: 34px; }
.brand-logo-img { height: 36px; width: auto; display: block; filter: drop-shadow(0 0 12px rgba(46,187,214,.30)); }
/* The brand row ships a dark-on-light logo, but this page is a near-black
   surface — rendered as-is it is effectively invisible. Knocking it out to
   solid white reproduces the intent of the design's own
   "twiching-logo-white" asset. Drop this rule if a real light-on-dark
   logo file is uploaded to the brand. */
.brand-logo-img.is-knockout { filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(46,187,214,.30)); }

/* Title */
.page-title { text-align: center; font-size: 34px; font-weight: 800; margin: 0 0 34px; color: var(--text); }
.page-title span { color: var(--primary-bright); }

/* Stepper */
.stepper {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
  width: 110px;
}
.step-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.15s;
}
.step-circle svg { width: 22px; height: 22px; }
.step-label { font-size: 13px; font-weight: 600; color: var(--text-faint); }

.step.active .step-circle {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-bright));
  border-color: transparent;
  color: #04222a;
  box-shadow: 0 0 0 8px rgba(46,187,214,0.18), 0 10px 24px rgba(46,187,214,0.35);
}
.step.active .step-label { color: var(--primary-bright); font-weight: 700; }

.step.completed .step-circle { background: linear-gradient(135deg, var(--primary), var(--primary-bright)); border-color: transparent; color: #04222a; }
.step.completed .step-label { color: var(--text); }

.step-line {
  flex: 1;
  height: 0;
  border-top: 2px dashed var(--border);
  margin-top: 26px;
  min-width: 10px;
}

/* Horizontal progress */
.hprogress { display: flex; align-items: center; gap: 14px; max-width: 900px; margin: 0 auto 30px; }
.hprogress-track { flex: 1; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.hprogress-fill { height: 100%; width: 14%; background: linear-gradient(90deg, var(--primary-dark), var(--primary)); border-radius: 999px; transition: width 0.5s ease; }
.hprogress-label { font-size: 13px; font-weight: 700; color: var(--primary-dark); white-space: nowrap; }

/* Card */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 36px;
  max-width: 1180px;
  margin: 0 auto;
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.card-header-left { display: flex; align-items: center; gap: 16px; }
.card-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-header h2 { margin: 0 0 3px; font-size: 20px; font-weight: 800; }
.card-header p { margin: 0; font-size: 13.5px; color: var(--text-muted); }
.card-illustration { width: 150px; height: auto; flex-shrink: 0; }

.card-divider { border: none; border-top: 1px solid var(--border); margin: 22px 0 26px; }

/* Server-side validation banner */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(255,107,129,0.12); border: 1px solid rgba(255,107,129,0.35);
  color: #ffb3bf; border-radius: 12px; padding: 14px 18px; margin: 0 auto 24px;
  max-width: 1180px; font-size: 14px; font-weight: 600;
}

/* Panels (wizard steps) */
.panel { display: none; }
.panel.active { display: block; animation: rise 0.28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 26px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field.hide { display: none; }
.field .lbl { font-size: 13.5px; font-weight: 700; color: var(--text); }
.field .lbl .req { color: var(--danger); margin-left: 2px; }

.ctl {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select.ctl { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a1b7' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
textarea.ctl { resize: vertical; }
.ctl::placeholder { color: var(--text-faint); }
.ctl:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 187, 214, 0.16); }
.ctl.error { border-color: var(--danger); }
.ctl:disabled { opacity: 0.5; cursor: not-allowed; }

/* Server-side field errors */
.field-error { margin: -2px 0 0; font-size: 12.5px; color: var(--danger); font-weight: 700; }
.field.has-error .ctl,
.field.has-error .filebox { border-color: var(--danger); }
.check-line.has-error { border-color: var(--danger); }
.sigwrap.has-error .sigpad { border-color: var(--danger); }

/* Subhead divider */
.subhead {
  grid-column: 1 / -1;
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--primary-bright); margin: 6px 0 -4px; padding-top: 16px; border-top: 1px dashed var(--border);
}
.subhead:first-child { border-top: 0; padding-top: 0; }

/* Checkbox grid (Business Description / Certification) */
.checkboxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.check-line { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.check-line input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--primary); flex: 0 0 auto; }
.field-checkbox { border: 1px solid var(--border); border-radius: 11px; padding: 11px 13px; background: rgba(255,255,255,0.03); }
.certs.grid { grid-template-columns: 1fr; gap: 10px; }
.certs .field-checkbox { background: var(--primary-light); }

/* Yes/No radio pills */
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); padding: 9px 18px; border-radius: 999px;
  cursor: pointer; font-size: 13.5px; background: rgba(255,255,255,0.03); color: var(--text);
}
.pill input { accent-color: var(--primary); }
.pill.checked { border-color: var(--primary); background: rgba(46,187,214,0.14); color: var(--primary-bright); font-weight: 700; }

/* Billing dimmed state */
.field[data-billing] { transition: opacity 0.15s; }

/* File inputs */
.doc-hint { margin: -6px 0 18px; font-size: 13px; color: var(--text-muted); }
.filebox {
  width: 100%; padding: 12px; border: 1.5px dashed var(--border); border-radius: 12px;
  font-size: 13px; background: rgba(255,255,255,0.02); color: var(--text-muted);
}
.filebox:hover { border-color: var(--primary); }
.field:has(.filebox) { grid-column: 1 / -1; }

/* FUSF download prompt — only rendered when this brand has a form attached */
.dl-note {
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap; background: var(--primary-light);
  border: 1px solid rgba(46,187,214,0.30); border-radius: 12px;
  padding: 14px 18px; font-size: 13.5px; color: var(--primary-bright);
}
.dl-note a {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff;
  text-decoration: none; padding: 10px 20px; border-radius: 999px;
  font-weight: 700; white-space: nowrap; font-size: 13px;
}
.dl-note a:hover { filter: brightness(1.08); }

/* Signature pad */
.sigwrap { grid-column: 1 / -1; }
.sigpad {
  border: 1.5px dashed var(--border); border-radius: 14px; background: rgba(255,255,255,0.02);
  width: 100%; height: 180px; touch-action: none; cursor: crosshair; display: block;
}
.sigbar { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.sig-help { color: var(--text-faint); font-size: 12.5px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 15px; font-size: 13px; cursor: pointer; color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); border-color: var(--primary); }

/* Info banner */
.info-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--primary-light);
  border-radius: 14px;
  padding: 18px 22px;
  margin-top: 28px;
}
.info-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.info-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.info-text strong { font-size: 14.5px; font-weight: 700; color: var(--text); }
.info-text span { font-size: 13px; color: var(--text-muted); }
.info-illustration { width: 60px; height: 44px; flex-shrink: 0; }

/* CTA row */
.cta-row { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 30px; }
.cta-row[hidden] { display: none; }
.cta-buttons { display: flex; align-items: center; gap: 16px; }
.saved-msg { color: var(--primary-bright); font-size: 12.5px; font-weight: 700; opacity: 0; transition: opacity 0.3s; white-space: nowrap; }
.saved-msg.show { opacity: 1; }
.dots { width: 130px; height: 20px; flex-shrink: 0; }
.dots-left { background: radial-gradient(circle, rgba(46,187,214,0.40) 2px, transparent 2px); background-size: 14px 14px; mask-image: linear-gradient(to left, #000, transparent); -webkit-mask-image: linear-gradient(to left, #000, transparent); }
.dots-right { background: radial-gradient(circle, rgba(46,187,214,0.40) 2px, transparent 2px); background-size: 14px 14px; mask-image: linear-gradient(to right, #000, transparent); -webkit-mask-image: linear-gradient(to right, #000, transparent); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700;
  padding: 14px 30px; border-radius: 999px;
  cursor: pointer; border: 1px solid transparent; font-family: inherit;
}
.btn svg { width: 18px; height: 18px; }
.btn-outline { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 10px 24px rgba(46, 187, 214, 0.35);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn[hidden] { display: none; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #050a12; color: #fff; padding: 12px 22px; border-radius: 9px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 960px) {
  .stepper { flex-wrap: wrap; row-gap: 18px; }
  .step-line { display: none; }
  .card-illustration { display: none; }
}
@media (max-width: 640px) {
  .page { padding: 24px 18px 48px; }
  .grid { grid-template-columns: 1fr; }
  .checkboxes { grid-template-columns: 1fr 1fr; }
  .card { padding: 22px 20px; }
  .page-title { font-size: 26px; }
  .step { width: 76px; }
  .step-label { font-size: 11.5px; }
  .cta-row { flex-direction: column; }
  .dots { display: none; }
}
