*,*::before,*::after{ box-sizing:border-box; }
:root{ --sb-primary:#6e4aa6; --sb-ink:#1f2937; --sb-muted:#6b7280; --sb-border:#e5e7eb; --sb-radius:12px; --sb-font: ui-sans-serif,-apple-system,Segoe UI,Roboto,Helvetica,Arial; }
body{font-family:var(--sb-font); color:var(--sb-ink); margin:0; background:#fff;}
.wrap{max-width:980px; margin:40px auto; padding:0 16px;}
h1{font-size:clamp(24px,3vw,34px); margin:.25rem 0 1rem;}
.grid{ display:flex; flex-wrap:wrap;justify-content: space-between; }
.grid section.card {
  flex: 0 0 38%;
}

.grid section.card:first-child {
  flex: 0 0 58%;
}

.card{border:1px solid var(--sb-border); border-radius:var(--sb-radius); padding:18px; overflow:visible;}

.field{display:grid; gap:6px; margin-bottom:12px; min-width:0;}
.field label{font-weight:600;}
.input,.select{width:100%; max-width:100%; border:1px solid var(--sb-border); border-radius:0px; padding:.65rem .75rem; font-size:1rem;}
.input:focus,.select:focus{outline:2px solid #111827; outline-offset:2px;}
small.help{color:var(--sb-muted);}

.metrics{display:grid; gap:10px;}
.badget-content {
  text-align: center;
}
.metric{border-top:1px solid var(--sb-border); border-radius:0px; padding:.7rem .9rem; display:flex; justify-content:space-between; align-items:center; position:relative;}
.metric .k{font-weight:700;}
.metric .v{font-variant-numeric: tabular-nums; position:relative; z-index:0; color:#e11d48; }
.unlock{margin-top:12px; display:flex; gap:8px; align-items:center; flex-wrap:wrap;}
.btn{appearance:none; border:0; background:#e11d48; color:#fff; border-radius:999px; margin:0; padding:10px 40px;font-size:16px; font-weight:600; cursor:pointer;}
.btn.secondary{background:#374151;}
.btn:focus{outline:2px solid #111827; outline-offset:2px;}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.prev-button-wrap {
  display: flex;
  flex: 0 0 100% !important;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* Locking (blur) only for the last 4 metrics */
.metric.locked .v{ color:transparent !important; opacity:.6 !important; }
.metric.locked .v::after{
  content:''; position:absolute; inset:-2px; background:rgba(255,255,255,.35);
  backdrop-filter: blur(4px) saturate(1.05); -webkit-backdrop-filter: blur(4px) saturate(1.05);
  border-radius:10px; z-index:2; pointer-events:none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .metric.locked .v{ text-shadow:0 0 8px rgba(0,0,0,.35); }
}

/* Modal */
.modal{position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,.5); z-index:9999;}
.modal[open]{display:flex;}
.sheet{max-width:720px; max-height:90vh; overflow:auto; width:100%; background:#fff; border-radius:12px; position: relative; padding: 24px 24px 32px; border:1px solid var(--sb-border);}
.sheet h2{margin:.25rem 0 1rem; font-size:1.25rem;}
.sheet p{margin-bottom:1rem; line-height:1.45;}
.sheet .x:hover {background: #e5e7eb;}
.sheet .x:focus {outline: 2px solid #111827; outline-offset: 2px;}
.x{background:#f3f4f6; color: #111827; font-size: 18px; border-radius: 999px;display: flex;align-items: center;justify-content: center; font-weight: 700; border:none; font-size:1.25rem; cursor:pointer;position: absolute; top:16px;right:16px;width:36px;height:36px;}
.row{display:flex; justify-content:space-between; align-items:center;}
.stack{display:grid; gap:10px;}
.subgrid{display:grid; gap:10px; grid-template-columns:1fr;}
@media(min-width:560px){ .subgrid{ grid-template-columns:1fr 1fr; } }

/* PDF DOM */
#pdf-root{ display:none; font-family:var(--sb-font); color:#111827; }
#pdf-root h2{ margin:0 0 8px; }
#pdf-root .pdf-head{ display:flex; gap:12px; align-items:center; margin-bottom:12px; }
#pdf-root img{ max-height:40px; }
#pdf-root table{ width:100%; border-collapse:collapse; margin:10px 0 18px; }
#pdf-root th,#pdf-root td{ border:1px solid #e5e7eb; padding:8px 10px; font-size:12px; vertical-align:top; }
#pdf-root th{ background:#f8fafc; text-align:left; }
#pdf-root .disclaimer{ font-size:11px; color:#6b7280; margin-top:12px; }

.step {
  display: none;
}

.step.active {
  display: flex;
  flex-wrap:wrap;
  justify-content: space-between;
}
.step.active > div { flex:0 0 48%; }

.step .field {
  margin-bottom: 1rem;
}

.steps-nav {
  margin-bottom: 1rem;
}

.stepper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-radius: 14px;
  background: #f8fafc;
  margin:0 0 30px;
}

.stepper-track {
  position: absolute;
  left: 32px;
  right: 32px;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}
.step.active .actions {
  flex: 0 0 100%;    display: flex;
  justify-content: space-between;
}
.step-btn {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: #e5e7eb;
  color: #374151;
  font-weight: 600;
  cursor: pointer;justify-content: center;
  margin: 0;padding:0;
}

.step-btn.active {
  background: #e11d48; /* red */
  color: #ffffff;
}

.step-btn:disabled {
  cursor: default;
  opacity: 0.6;
}



@media(max-width:767px){
  .step.active > div { flex:0 0 100%; }
  .grid section.card {
    flex: 0 0 100%;
  }
  .grid{ gap:40px; }
  .grid section.card:first-child {
    flex: 0 0 100%;
  }

}

.roi-summary {
  text-align: center;
  padding: 32px 24px;
}

/* Label above number */
.roi-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #111827;
  margin-bottom: 16px;
  text-transform: uppercase;
}

/* Main ROI number */
.roi-value {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #000;
  line-height: 1;
  margin-bottom: 12px;
}

/* Placeholder dashes */
.roi-value.placeholder {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.roi-value.placeholder span {
  display: inline-block;
  width: 24px;
  height: 6px;
  background-color: #000;
  border-radius: 3px;
}

/* Supporting text */
.roi-subtext {
  font-size: 14px;
  color: #6b7280;
}

/* =========================
PREVIEW STATE
========================= */
.preview .roi-value {
  color: #000;
}

.preview .metric .k,
.preview .metric .v {
  color: #9ca3af;
}


/* =========================
SUBMITTED STATE
========================= */

/* First 3 metrics → visible + red */
.submitted .metric:nth-child(-n+3) .k,
.submitted .metric:nth-child(-n+3) .v {
  color: #e11d48;
  filter: none;
}

/* Metrics 4+ → blur label + value */
.submitted .metric:nth-child(n+4) {
  filter: blur(4px);
  pointer-events: none;
}


/* =========================
UNLOCKED STATE
========================= */

/* Remove all blur */
.unlocked .metric {
  filter: none !important;
  pointer-events: auto;
}

/* All text black */
.unlocked .metric .k,
.unlocked .metric .v {
  color: #111;
}

#unlockAll {
  margin: 16px auto 0;
  text-align: center;
}

#unlockAll[hidden] {
  display: none !important;
}
