@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Source+Sans+3:wght@400;600&display=swap');

:root{
  --ink:#0f172a;
  --muted:#475569;
  --brand:#0ea5e9;
  --brandDark:#0369a1;
  --paper:#0f1f2f;
  --card:#ffffff;
  --border:#cbd5e1;
  --accent:#f97316;
  --radius:14px;
  --shadow:0 30px 80px rgba(15, 23, 42, 0.22);
  --demoBannerH:34px;
}

* { box-sizing: border-box; }
html, body { width: 100%; }
body {
  margin: 0; padding: 0;
  font-family: "Source Sans 3", Arial, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(1100px 500px at 20% -10%, rgba(56, 189, 248, 0.18) 0%, transparent 56%),
    radial-gradient(900px 420px at 100% 0%, rgba(14, 165, 233, 0.16) 0%, transparent 52%),
    linear-gradient(180deg, #15283b 0%, #0f1f2f 48%, #0b1724 100%);
}
body.theme-dark {
  --ink:#e2e8f0;
  --muted:#94a3b8;
  --brand:#38bdf8;
  --brandDark:#0ea5e9;
  --paper:#08111d;
  --card:#111b29;
  --border:#24364d;
  --accent:#fb923c;
  --shadow:0 32px 80px rgba(2, 6, 23, 0.58);
  background:
    radial-gradient(1100px 500px at 12% -10%, rgba(56, 189, 248, 0.12) 0%, transparent 56%),
    radial-gradient(900px 420px at 100% 0%, rgba(15, 23, 42, 0.42) 0%, transparent 54%),
    linear-gradient(180deg, #0d1724 0%, #08111d 52%, #050b14 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.18;
  z-index: -1;
}

body.theme-dark::before {
  opacity: 0.12;
}

body.font-large {
  font-size: 18px;
}

body.font-large .titleBlock h1 { font-size: 32px; }
body.font-large .titleBlock p { font-size: 17px; }
body.font-large h3 { font-size: 20px; }
body.font-large h4 { font-size: 16px; }
body.font-large .contextTitle { font-size: 18px; }
body.font-large .contextBody { font-size: 16px; }
body.font-large .progressLabel { font-size: 14px; }
body.font-large .stepDot { font-size: 14px; }
body.font-large label { font-size: 15px; }
body.font-large .hint { font-size: 14px; }
body.font-large input,
body.font-large select,
body.font-large textarea { font-size: 16px; }
body.font-large .check { font-size: 14px; }

.check a {
  color: var(--brandDark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.theme-dark .check a {
  color: var(--brand);
}

.demo-banner {
  display: none;
}

body.is-demo .demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--demoBannerH) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
  user-select: none;
}

body.is-demo .wrap {
  padding-top: calc(24px + var(--demoBannerH) + env(safe-area-inset-top));
}

.wrap {
  width: min(1120px, calc(100vw - 24px));
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 0 44px;
}
.hero {
  display:flex; justify-content:space-between; align-items:center; gap:18px;
  margin-bottom: 24px;
  padding: 20px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(21, 36, 52, 0.94), rgba(14, 27, 40, 0.94));
  border: 1px solid rgba(191, 210, 227, 0.12);
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.22);
  color: #f8fbff;
}
.widget-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.brandRow {
  display:flex;
  align-items:center;
  gap:14px;
}
.titleBlock h1 {
  margin: 0 0 6px; font-size: 30px;
  font-family: "Space Grotesk", Arial, sans-serif;
  letter-spacing: -0.02em;
  color: #f8fbff;
}
.titleBlock p { margin:0; color:rgba(226, 237, 248, 0.78); font-size: 15px; }

.themeToggle {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(191, 210, 227, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fbff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.14);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.themeToggle:hover,
.themeToggle:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(191, 210, 227, 0.28);
  transform: translateY(-1px);
}
body.theme-dark .themeToggle {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.995), rgba(249, 252, 255, 0.995));
  border: 1px solid #d9e5f0;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--accent), #5fd2a1);
}

body.theme-dark .card {
  background: linear-gradient(180deg, rgba(17, 27, 41, 0.98), rgba(12, 21, 33, 0.98));
  border-color:#24364d;
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.5);
}

.intro {
  background: #e0f2fe;
  border:1px solid #7dd3fc;
  padding: 14px 16px;
  border-radius: 12px;
  color: #0c4a6e;
  margin-bottom: 16px;
  font-weight: 600;
}
body.theme-dark .intro {
  background: #0ea5e91a;
  border:1px solid #1d4ed8;
  color: #e2e8f0;
}

.contextBox {
  border:1px solid #b7d2c5;
  background:linear-gradient(180deg, #effaf4 0%, #e6f4ec 100%);
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 16px;
  color:#173329;
  box-shadow: 0 12px 28px rgba(31, 58, 54, 0.08);
}
.contextTitle {
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  font-size:16px;
  margin-bottom:4px;
}
.contextTitle::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5e8f78, #0ea5e9);
  box-shadow: 0 0 0 4px rgba(94, 143, 120, 0.14);
  flex: 0 0 auto;
}
.contextBody {
  color:#365548;
  font-size:14px;
  font-weight:600;
}
body.theme-dark .contextBox {
  background:linear-gradient(180deg, #23433d 0%, #1a302d 100%);
  border-color:#3f5d57;
  color:#e6f3ee;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.28);
}
body.theme-dark .contextBody {
  color:#cfe7de;
}

body.widget-fullscreen .contextBox {
  position: sticky;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 20;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.progressWrap {
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid #d9e5f0;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(239, 246, 252, 0.98));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}
body.theme-dark .progressWrap {
  border-color:#1f2937;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(11, 18, 32, 0.88));
}
.progressLabel { display:flex; justify-content:space-between; font-size:13px; color:var(--muted); font-weight:600; }
.progressBar {
  height:10px; background:#cbd5e1; border-radius:999px; overflow:hidden; margin-top:6px;
}
body.theme-dark .progressBar { background:#1f2937; }
.progressFill { height:100%; width:0%; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width 0.3s ease; }

.steps { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.stepDot {
  border:1px solid #bfd3e5; border-radius:999px; padding:6px 11px; font-size:12px;
  color:var(--muted);
  background:linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}
.stepDot.active { background:linear-gradient(180deg, #e0f2fe 0%, #dbeafe 100%); border-color:#38bdf8; color:#075985; font-weight:700; box-shadow: 0 10px 22px rgba(14, 165, 233, 0.18); }
.stepDot.done {
  background: linear-gradient(180deg, #effaf4 0%, #e6f4ec 100%);
  border-color: #93c5aa;
  color: #21523f;
}
body.theme-dark .stepDot {
  color:#94a3b8;
  background:linear-gradient(180deg, #162233 0%, #0f172a 100%);
  border-color:#334155;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.24);
}
body.theme-dark .stepDot.active {
  color:#e2e8f0;
  background:linear-gradient(180deg, rgba(14, 165, 233, 0.28) 0%, rgba(14, 165, 233, 0.14) 100%);
  border-color:#38bdf8;
}
body.theme-dark .stepDot.done {
  background: linear-gradient(180deg, rgba(94, 143, 120, 0.26) 0%, rgba(31, 58, 54, 0.6) 100%);
  border-color: #5e8f78;
  color: #d9f2e7;
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--ink);
  font-family: "Space Grotesk", Arial, sans-serif;
  letter-spacing: -0.02em;
}

.panel h4 {
  margin: 18px 0 8px;
  color: #1e293b;
  font-size: 1rem;
  font-weight: 700;
}

.grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
label { display:block; font-weight:700; margin-top:10px; color:#1e293b; }
.hint { font-size:12px; color:#475569; margin-top:6px; }
body.theme-dark label,
body.theme-dark .panel h4 {
  color:#e2e8f0;
}

input, select, textarea {
  width:100%; padding:10px 12px; margin-top:6px;
  border-radius: 12px; border:1px solid #94a3b8;
  font-size:14px; background:#ffffff;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 0 rgba(255,255,255,0.7);
}
input::placeholder,
textarea::placeholder {
  color:#64748b;
}
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background:#0b1220;
  color: var(--ink);
  border-color:#334155;
  box-shadow: inset 0 1px 2px rgba(2, 6, 23, 0.28);
}
body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
  color:#94a3b8;
}
textarea { min-height:90px; resize: vertical; }
input:hover,
select:hover,
textarea:hover {
  border-color:#64748b;
}
input:focus,
select:focus,
textarea:focus {
  border-color:#0284c7;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14), inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
body.theme-dark input:hover,
body.theme-dark select:hover,
body.theme-dark textarea:hover {
  border-color:#475569;
}
body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
  border-color:#38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18), inset 0 1px 2px rgba(2, 6, 23, 0.28);
}
input:focus, select:focus, textarea:focus, button:focus {
  outline: 3px solid rgba(14, 165, 233, 0.35);
  outline-offset: 2px;
}

.checks { display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; }
.check {
  display:flex; align-items:center; gap:8px; padding:8px 12px;
  border:1px solid var(--border); border-radius:999px; font-size:13px;
  background:#eef2f7;
  color:#1e293b;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.check:hover {
  border-color:#94a3b8;
  background:#f8fbff;
  transform: translateY(-1px);
}
.check:has(input:checked) {
  background: linear-gradient(180deg, #e0f2fe 0%, #dbeafe 100%);
  border-color:#38bdf8;
  color:#075985;
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.14);
}
body.theme-dark .check {
  background:#111827;
  border-color:#334155;
  color:#e2e8f0;
}
body.theme-dark .check:hover {
  border-color:#475569;
  background:#162233;
}
body.theme-dark .check:has(input:checked) {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.28) 0%, rgba(14, 165, 233, 0.14) 100%);
  border-color:#38bdf8;
  color:#e2e8f0;
}
.check input { width:auto; margin:0; }
.hidden { display:none; }
input[type="checkbox"],
input[type="radio"] { accent-color: var(--brand); }

.disclosure {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #eef2f7;
}
.disclosureSummary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:14px;
  font-weight:700;
  color: var(--ink);
  cursor: pointer;
}
.disclosureSummary::-webkit-details-marker { display:none; }
.disclosureSummary::after {
  content: "+";
  font-size: 12px;
  color: var(--muted);
}
details[open] > .disclosureSummary::after { content: "-"; }
.disclosure > .checks { margin-top: 8px; }
body.theme-dark .disclosure {
  background:#0b1220;
  border-color:#1e293b;
}
body.theme-dark .disclosureSummary { color:#e2e8f0; }

.navRow { display:flex; justify-content:space-between; gap:10px; margin-top: 18px; }
button {
  padding: 12px 16px; border:0; border-radius: 14px; cursor:pointer;
  background: linear-gradient(135deg, #0ea5e9, #0284c7); color:#fff; font-weight:700; font-size:14px;
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.22);
  transition: transform 0.15s ease, box-shadow 0.18s ease, background 0.18s ease;
}
button:hover:not(:disabled) {
  transform: translateY(-1px);
}
button.secondary {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22);
}
button.ghost { background:#e2e8f0; color:#0f172a; box-shadow:none; }
body.theme-dark button {
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.3);
}
body.theme-dark button.secondary {
  background: linear-gradient(135deg, #334155, #1e293b);
}
body.theme-dark button.ghost {
  background:#24364d;
  color:#e2e8f0;
}
button:disabled { opacity:0.6; cursor:not-allowed; }

.panel { display:none; }
.panel.active { display:block; }

.divider { height:1px; background:var(--border); margin: 16px 0; }
.error { color:#b91c1c; font-weight:700; margin-top:10px; display:none; }

.quoteModal[hidden] { display:none !important; }
.quoteModal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 20px;
}
.quoteModalBackdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 23, 0.62);
  cursor: pointer;
}
.quoteModalDialog {
  position: relative;
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  z-index: 1;
}
.quoteModalDialog .quoteCard {
  margin-top: 0;
}
.quoteModalClose {
  position: sticky;
  top: 10px;
  float: right;
  z-index: 2;
  margin: 10px 10px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
}
body.quote-modal-open {
  overflow: hidden;
}
.quoteCard { margin-top:18px; display:none; }
#quoteCard #payloadWrap { display: none !important; }
.quoteTop { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.quotePrice { font-size:28px; font-weight:800; }
.quotePkg { font-size:16px; font-weight:700; margin:0; }
.quoteMeta { margin:6px 0 0; color:var(--muted); font-size:13px; }
.quoteActions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:12px; }
.quoteCta {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 12px 16px;
  border-radius: 12px;
  cursor:pointer;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color:#fff;
  font-weight:800;
  font-size:14px;
  text-decoration:none;
  border:0;
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.22);
}
.quoteCta.secondary {
  background:linear-gradient(135deg, #1e293b, #0f172a);
  color:#fff;
  font-weight:700;
  border:0;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22);
}
.quoteBreakdown {
  margin-top:12px;
  border:1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  background:#ffffff;
}
.quoteBreakdown ul {
  margin:0;
  padding-left:18px;
  display:grid;
  gap:4px;
}
.pill { display:inline-block; padding:6px 10px; border-radius:999px; background:#e2e8f0; color:#0f172a; margin-top:10px; font-size:12px; }
.pill:empty { display:none !important; }
.pill.warning {
  background:#fff7ed;
  color:#9a3412;
  border:1px solid #fdba74;
}
.quoteBreakdown:empty { display:none !important; }
.payloadTable {
  width:100%;
  border-collapse: collapse;
  margin-top:10px;
  font-size:13px;
}
.payloadTable th, .payloadTable td {
  border:1px solid var(--border);
  padding:8px 10px;
  vertical-align: top;
}
.payloadTable th {
  text-align:left;
  background:#e2e8f0;
  font-weight:700;
}
.payloadTable tr:nth-child(even) td { background:#f8fafc; }
body.theme-dark .payloadTable th {
  background:#0b1220;
  color:#e2e8f0;
}
body.theme-dark .payloadTable td {
  background:#0f172a;
  color:#e2e8f0;
}
body.theme-dark .payloadTable tr:nth-child(even) td {
  background:#111827;
}
body.theme-dark .quoteModalBackdrop {
  background: rgba(2, 6, 23, 0.78);
}
body.theme-dark .quoteModalClose {
  background:#334155;
}

@media (min-width: 721px) {
  details.disclosure:not([open]) > *:not(summary) { display: block; }
  .disclosure {
    padding: 0;
    border: 0;
    background: transparent;
  }
  .disclosureSummary { display: none; }
}

@media (max-width: 720px) {
  body { padding: 0; }
  .wrap { width: min(1120px, calc(100vw - 20px)); padding: 18px 0 28px; }
  .card {
    padding: 16px;
    border: 1px solid #d9e5f0;
    border-radius: 22px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  }
  .hero {
    padding: 16px;
    border-radius: 20px;
  }
  .titleBlock h1 { font-size: 22px; }
  .titleBlock p { font-size: 14px; }
  .progressLabel { flex-direction: column; gap: 4px; }
  .progressWrap { padding: 14px; border-radius: 18px; }
  .steps { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .stepDot { white-space: nowrap; }
  .contextBox { padding: 14px; border: 1px solid #b7d2c5; background: linear-gradient(180deg, #effaf4 0%, #e6f4ec 100%); color:#173329; }
  body.theme-dark .contextBox { background: linear-gradient(180deg, #23433d 0%, #1a302d 100%); border-color:#3f5d57; color:#e6f3ee; }
  body.theme-dark .contextBody { color:#cfe7de; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  label { margin-top: 6px; }
  input, select, textarea { font-size: 16px; padding: 12px; border-radius: 12px; }
  .checks { display: grid; grid-template-columns: 1fr; gap: 0; }
  .check { border: 0; border-radius: 0; background: transparent; padding: 10px 4px; box-shadow: inset 0 -1px 0 var(--border); color: var(--ink); }
  .checks .check:last-child { box-shadow: none; }
  .disclosure { padding: 8px 10px; }
  .disclosureSummary { font-size: 13px; }
  .quoteTop { flex-direction: column; align-items: flex-start; }
  .quotePrice { font-size: 24px; }
  .payloadTable { display: block; overflow-x: auto; white-space: nowrap; }
  .quoteModal { padding: 8px; }
  .quoteModalDialog {
    width: min(980px, calc(100vw - 10px));
    max-height: calc(100vh - 10px);
  }
  .quoteModalClose {
    top: 6px;
    margin: 6px 6px 0 0;
  }
}

@media (max-width: 520px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .brandRow {
    width: 100%;
  }
  .widget-controls {
    width: 100%;
    justify-content: flex-start;
  }
  .widget-controls .themeToggle {
    flex: 1 1 150px;
  }
  .navRow {
    flex-direction: column;
  }
  .navRow button {
    width: 100%;
  }
}
