:root{
  /* CFC Light Theme */

  --bg:#eef3f8;
  --card:#ffffff;
  --ink:#1f2f46;
  --muted:#5f6f86;
  --line:#d6e0ea;

  --btn:#365a96;
  --btn-hover:#2f4f86;
  --btn2:#dbe6f2;
  --btn2-text:#2f4f86;

  --danger:#c94a4a;

  /* Sizing scale (unchanged) */
  --fs-h1:20px;
  --fs-sub:13px;
  --fs-stepTitle:18px;
  --fs-stepHint:13px;
  --fs-label:15px;
  --fs-control:16px;
  --pad-control-y:12px;
  --pad-control-x:12px;
  --radius-control:12px;
}

*{box-sizing:border-box}

.hidden{
  display:none !important;
}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:radial-gradient(circle at 50% 0%, #ffffff 0%, var(--bg) 48%, #e7edf5 100%);
  color:var(--ink);
}

.topbar{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:12px 16px;
  border-bottom:1px solid var(--line);
  background:#ffffff;
  position:sticky;
  top:0;
  z-index:50;
  box-shadow:0 4px 14px rgba(31,47,70,.06);
}

h1{
  margin:0;
  font-size:var(--fs-h1);
  color:var(--btn);
}

.sub{
  color:var(--muted);
  font-size:var(--fs-sub);
  margin-top:2px;
}

.top-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

button{
  border:none;
  border-radius:10px;
  padding:11px 14px;
  font-weight:700;
  cursor:pointer;
  background:var(--btn);
  color:#ffffff;
  transition:.2s ease;
}

button:hover{
  background:var(--btn-hover);
}

button.secondary{
  background:var(--btn2);
  color:var(--btn2-text);
}

button.hidden{
  display:none;
}

button:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.layout{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  padding:14px 12px;
}

@media (max-width: 980px){
  .layout{grid-template-columns:1fr}
  .previewCard{display:none}
}

/* Checkbox/checklist styles (moved from JS preview IIFE) */
:root{ --cfcChk: 22px; }
label.chkRow{ display:flex; gap:10px; align-items:flex-start; }
label.chkRow > input[type="checkbox"]{
  width:var(--cfcChk); height:var(--cfcChk);
  flex:0 0 var(--cfcChk);
  margin-top:2px;
}
label.chkRow > span{ flex:1; min-width:0; line-height:1.25; }
.checklist{ display:flex; flex-direction:column; gap:10px; }
.field .checklist{ margin-top:6px; }
.card label.chkRow{ width:100%; }
@media (max-width: 480px){ :root{ --cfcChk: 24px; } }

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
  box-shadow:0 4px 14px rgba(31,47,70,.08);
}

.stepHeader{margin-bottom:12px}

.stepTitle{
  font-size:var(--fs-stepTitle);
  font-weight:800;
  color:var(--btn);
}

.stepHint{
  color:var(--muted);
  font-size:var(--fs-stepHint);
  margin-top:4px;
}

.stepBody{
  padding:8px 0 6px;
  min-height:240px;
}

.field{
  margin:10px 0;
}

label{
  display:block;
  font-weight:700;
  margin-bottom:6px;
  font-size:var(--fs-label);
  color:var(--ink);
}

input, select, textarea{
  width:100%;
  background:#ffffff;
  border:1px solid var(--line);
  color:var(--ink);
  border-radius:var(--radius-control);
  padding:var(--pad-control-y) var(--pad-control-x);
  outline:none;
  font-size:var(--fs-control);
}


/* Money input with a static $ inside the box */
.moneyWrap{
  position:relative;
}
.moneyPrefix{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  font-weight:800;
  color:var(--muted);
  pointer-events:none;
}
.moneyWrap input{
  padding-left:30px;
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--btn);
  box-shadow:0 0 0 2px rgba(54,90,150,.15);
}

select{min-height:44px}
textarea{min-height:110px; resize:vertical}

.row2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

@media (max-width: 480px){
  .row2{ grid-template-columns:1fr; }
}

.small{
  font-size:13px;
  color:var(--muted);
  margin-top:6px;
}

/* Headings inside step content */
.stepBody h2,
.stepBody h3,
.stepBody h4{
  font-size:17px;
  font-weight:900;
  margin:14px 0 8px;
  color:var(--btn);
}

.stepBody p,
.stepBody li{
  font-size:15px;
  line-height:1.4;
  color:var(--ink);
}

/* Checkbox / radio alignment */
input[type="checkbox"],
input[type="radio"]{
  width:18px;
  height:18px;
  accent-color:var(--btn);
}

label input[type="checkbox"],
label input[type="radio"]{
  width:18px;
  height:18px;
  margin:0 10px 0 0;
  vertical-align:middle;
}

/* Common inline option patterns */
.inlineOption,
.choice,
.checkline{
  display:flex;
  align-items:center;
  gap:10px;
}

label.inlineOption,
label.choice,
label.checkline{
  margin:8px 0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f6f9fc;
}

/* Section headings */
.groupTitle,
.sectionTitle,
.miniHeading,
.subheading{
  font-size:16px;
  font-weight:900;
  margin:14px 0 8px;
  color:var(--btn);
}

.nav{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
  flex-wrap:wrap;
}

.error{
  margin-top:10px;
  padding:10px;
  border-radius:10px;
  border:1px solid rgba(201,74,74,.35);
  background:rgba(201,74,74,.08);
  color:#8a2f2f;
}

.previewCard{
  padding:0;
}

.previewHeader{
  padding:14px 14px 10px;
}

.pdfFrame{
  width:100%;
  height:72vh;
  border:none;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  background:#f3f6fa;
}

.previewFooter{
  padding:10px 14px;
  color:var(--muted);
  font-size:12px;
}


/* ===== Intro Overlay ===== */

.introOverlay{
  position:fixed;
  inset:0;
  background:#ffffff;
  display:flex;
  justify-content:center;
  align-items:flex-start;   /* changed from center */
  padding-top:14vh;         /* pushes content higher */
  z-index:9999;
  opacity:1;
  transition:opacity .6s ease;
}

.introOverlay.fadeOut{
  opacity:0;
  pointer-events:none;
}

.introContent{
  text-align:center;
  animation:introFade 1.2s ease;
  transform:translateY(-32px);
}

.introLogo{
  width:320px;
  max-width:70vw;
  margin-bottom:24px;
}

.introText{
  font-size:26px;
  font-weight:700;
  color:#365a96;
  letter-spacing:.6px;
}

.langPicker{
  margin-top:32px;
}

.langPrompt{
  font-size:15px;
  color:#555;
  margin-bottom:20px;
}

.langBtns{
  display:flex;
  gap:16px;
  justify-content:center;
}

.langBtn{
  padding:14px 36px;
  font-size:17px;
  font-weight:600;
  border:2px solid #365a96;
  border-radius:8px;
  background:#fff;
  color:#365a96;
  cursor:pointer;
  transition:background .15s, color .15s;
}

.langBtn:hover{
  background:#365a96;
  color:#fff;
}

.langBtn--es{
  background:#365a96;
  color:#fff;
}

.langBtn--es:hover{
  background:#253f6e;
  border-color:#253f6e;
}

@keyframes introFade{
  from{opacity:0}
  to{opacity:1}
}

@keyframes logoPop{
  0%{opacity:0; transform:scale(.9)}
  100%{opacity:1; transform:scale(1)}
}

@keyframes textFade{
  from{opacity:0; transform:translateY(8px)}
  to{opacity:1; transform:translateY(0)}
}





/* ===== Persistent Brand Header ===== */
.brandHeader{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  text-align:center;
}

.topLogo{
  width:220px;
  max-width:72vw;
  height:auto;
}

.topTitle{
  font-size:18px;
  font-weight:800;
  color:var(--btn);
  letter-spacing:.4px;
}

/* ===== Dev Tools (corner trigger + modal + floating panel) ===== */

/* Tiny invisible gear — fixed bottom-right corner */
#devTrigger{
  position:fixed;
  bottom:6px;
  right:6px;
  width:22px;
  height:22px;
  background:transparent;
  border:none;
  cursor:pointer;
  opacity:0.12;
  font-size:11px;
  line-height:22px;
  text-align:center;
  z-index:9995;
  padding:0;
  color:#555;
}
#devTrigger:hover{ opacity:0.45; }

/* Password modal overlay */
.dev-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
}
.dev-modal.hidden{ display:none; }

.dev-modal-box{
  background:#fff;
  padding:28px 24px 20px;
  border-radius:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:260px;
  box-shadow:0 8px 32px rgba(0,0,0,.35);
}
.dev-modal-box h3{ margin:0 0 4px; font-size:15px; color:#333; }
.dev-modal-box input[type="password"]{
  padding:8px 10px;
  border:1px solid #ccc;
  border-radius:6px;
  font-size:14px;
  width:100%;
  box-sizing:border-box;
}
.dev-modal-box button{
  padding:8px 12px;
  border-radius:6px;
  border:none;
  cursor:pointer;
  font-size:13px;
  background:#eee;
}
.dev-error-msg{ color:#c0392b; font-size:12px; margin:0; }
.dev-error-msg.hidden{ display:none; }

/* Floating dev panel */
.dev-panel{
  position:fixed;
  bottom:36px;
  right:10px;
  background:#1e1e2e;
  color:#cdd6f4;
  border-radius:10px;
  padding:12px;
  width:240px;
  z-index:9997;
  box-shadow:0 4px 20px rgba(0,0,0,.5);
  font-size:12px;
  font-family:inherit;
}
.dev-panel.hidden{ display:none; }

.dev-panel-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  font-weight:700;
  font-size:13px;
}
.dev-panel-header button{
  background:transparent;
  border:none;
  color:#cdd6f4;
  cursor:pointer;
  font-size:14px;
  padding:0;
}
.dev-panel label{
  color:#a6adc8;
  font-size:11px;
  display:block;
  margin-top:6px;
  margin-bottom:2px;
}
.dev-panel select{
  width:100%;
  padding:5px 7px;
  border-radius:6px;
  border:1px solid #45475a;
  background:#313244;
  color:#cdd6f4;
  font-size:12px;
  margin-bottom:2px;
}
.dev-btn-row{
  display:flex;
  gap:4px;
  flex-wrap:wrap;
  margin-top:6px;
}
.dev-panel button{
  padding:5px 8px;
  border-radius:6px;
  border:none;
  cursor:pointer;
  font-size:11px;
  background:#45475a;
  color:#cdd6f4;
}
.dev-panel button:disabled{ opacity:0.4; cursor:default; }
.dev-panel button:not(:disabled):hover{ background:#585b70; }

.devRunStatus{
  margin-top:8px;
  font-size:11px;
  opacity:.85;
  line-height:1.3;
  user-select:text;
  white-space:pre-wrap;
  max-height:130px;
  overflow-y:auto;
  color:#a6e3a1;
}

/* ===== Progress Bar ===== */
.progressWrap{
  height:4px;
  background:var(--line);
  border-radius:4px;
  margin-bottom:14px;
  overflow:hidden;
}
.progressBar{
  height:100%;
  background:var(--btn);
  border-radius:4px;
  transition:width .35s ease;
}

/* ===== Offline Banner ===== */
.offlineBanner{
  position:fixed;
  top:0;
  left:0;
  right:0;
  background:#c0392b;
  color:#fff;
  text-align:center;
  padding:10px 16px;
  font-size:14px;
  font-weight:600;
  z-index:9000;
  box-shadow:0 2px 8px rgba(0,0,0,.3);
}
.offlineBanner.hidden{ display:none; }

/* ===== Success Screen ===== */
.successScreen{
  text-align:center;
  padding:60px 24px 80px;
  max-width:480px;
  margin:0 auto;
}
.successIcon{
  font-size:72px;
  color:#2ecc71;
  line-height:1;
  margin-bottom:16px;
}
.successScreen h2{
  font-size:26px;
  font-weight:800;
  color:var(--text, #1f2f46);
  margin:0 0 10px;
}
.successScreen p{
  font-size:16px;
  color:#444;
  margin:0 0 8px;
  line-height:1.5;
}
.successNote{
  font-size:14px;
  color:#666;
}
.successDivider{
  border:none;
  border-top:1px solid #ddd;
  margin:24px auto;
  max-width:320px;
}