/* Styles for the self-preparation wizard (file-bankruptcy-yourself.html) */

:root {
  /* wizard aliases for the site palette (css/site.css) */
  --brand: var(--primary);
  --brand-2: var(--primary);
  --card: var(--surface);
  --ok-bg: #e8f6ed;
  --warn-bg: #fff4e0;
  --stop: #b42318; --stop-bg: #fdecea;
  --info: #1d4ed8; --info-bg: #eaf1ff;
  --todo: #6b21a8; --todo-bg: #f4ecfb;
}

.prepare-page button { font: inherit; }
.prep-hero { padding: 52px 0 56px; }
.prep-hero .lead { margin-bottom: 0; }

.prep-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  margin-top: 40px;
  margin-bottom: 64px;
  align-items: start;
}

/* ---- sidebar */
.prep-side { position: sticky; top: 88px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 12px; }
#progress-bar { height: 100%; width: 0; background: var(--brand-2); transition: width .3s; }
.steps-nav { list-style: none; margin: 0; padding: 0; }
.steps-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; padding: 8px 6px; border-radius: 6px; cursor: pointer; color: var(--ink);
}
.steps-nav button:hover:not(:disabled) { background: #e7edf7; }
.steps-nav button:disabled { color: #9aa4b2; cursor: not-allowed; }
.steps-nav .n {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: .8rem; background: var(--line); color: var(--ink);
}
.steps-nav .done .n { background: var(--ok); color: #fff; }
.steps-nav .current button { background: #e7edf7; font-weight: bold; }
.steps-nav .current .n { background: var(--brand); color: #fff; }
.toolbar { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.save-status { font-size: .85rem; color: var(--muted); margin: 0 0 4px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; text-decoration: underline; font-size: .95rem; }
.link-btn.danger { color: var(--stop); }

/* ---- main card */
.wizard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 36px; box-shadow: var(--shadow); min-height: 300px;
}
.wizard > h2 { margin-top: 0; outline: none; }
.intro { margin-bottom: 8px; }
.privacy { background: var(--ok-bg); border-left: 4px solid var(--ok); padding: 10px 14px; border-radius: 4px; }
.disclaimer { background: var(--warn-bg); border-left: 4px solid var(--warn); padding: 12px 14px; border-radius: 4px; }

.fields { display: flex; flex-wrap: wrap; gap: 0 20px; }
.field { flex: 1 1 100%; margin: 10px 0; min-width: 0; }
.field.half { flex: 1 1 calc(50% - 20px); }
.field.third { flex: 1 1 calc(33.33% - 20px); }
.field[hidden] { display: none; }
.field-heading h3 { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 1.1rem; color: var(--navy); }
.fields > .field-heading:first-child h3 { border-top: 0; padding-top: 0; }
.field label, .field legend { display: block; font-weight: bold; margin-bottom: 6px; font-size: .95rem; }
.field fieldset { border: 0; padding: 0; margin: 0; }
.field input[type=text], .field input[type=number], .field input[type=date], .field select, .field textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font: inherit; font-size: 1rem;
  border: 1px solid #b8c1cc; border-radius: 8px; background: #fff; color: var(--ink); min-width: 0; box-shadow: none;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(0,136,255,.3); border-color: var(--brand-2); }
.money-wrap { position: relative; display: block; }
.money-wrap .cur { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money-wrap input { padding-left: 26px !important; }
.yesno { display: flex; gap: 10px; }
.yesno label { font-weight: normal; display: flex; align-items: center; gap: 6px; border: 1px solid #b8c1cc; border-radius: 8px; padding: 8px 18px; cursor: pointer; margin: 0; }
.yesno label:has(input:checked) { border-color: var(--brand); background: #e7edf7; font-weight: bold; }
label.check { font-weight: normal; display: flex; gap: 10px; align-items: flex-start; font-size: 1rem; }
label.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.help { color: var(--muted); font-size: .88rem; margin: 6px 0 0; }

.list-item { flex: 1 1 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 10px 0; background: #fafbfc; }
.list-item-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.add-btn { border: 2px dashed #b8c1cc; background: none; border-radius: 10px; padding: 10px 16px; width: 100%; cursor: pointer; color: var(--brand); font-weight: bold; margin-top: 6px; }
.add-btn:hover { border-color: var(--brand); background: #f3f6fb; }

.live { margin-top: 16px; }
.live:empty { display: none; }
.totals { background: #f3f6fb; border-radius: 8px; padding: 12px 16px; }
.neg { color: var(--stop); }
.means { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; background: #f3f6fb; border-radius: 8px; padding: 14px 16px; margin: 0 0 12px; }
.means dt { color: var(--muted); }
.means dd { margin: 0; font-weight: bold; text-align: right; }

.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 12px; padding: 10px 14px; border-radius: 8px; border-left: 4px solid; align-items: baseline; }
.alert-label { flex: none; font-size: .75rem; font-weight: bold; text-transform: uppercase; letter-spacing: .04em; min-width: 72px; }
.alert-ok   { background: var(--ok-bg);   border-color: var(--ok); }   .alert-ok .alert-label { color: var(--ok); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn); } .alert-warn .alert-label { color: var(--warn); }
.alert-stop { background: var(--stop-bg); border-color: var(--stop); } .alert-stop .alert-label { color: var(--stop); }
.alert-info { background: var(--info-bg); border-color: var(--info); } .alert-info .alert-label { color: var(--info); }
.alert-todo { background: var(--todo-bg); border-color: var(--todo); } .alert-todo .alert-label { color: var(--todo); }

.step-error { color: var(--stop); font-weight: bold; margin-top: 12px; }
.step-error:empty { display: none; }
.step-buttons { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.step-buttons .btn:only-child { margin-left: auto; }
.step-buttons .btn, .step-buttons .btn-secondary { padding: 12px 22px; font-size: 1rem; }

/* ---- review */
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.stat { background: #f3f6fb; border-radius: 10px; padding: 12px 14px; }
.stat span { display: block; font-size: .8rem; color: var(--muted); }
.stat strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.lawyer-cta { margin: 20px 0; padding: 18px 20px; border-radius: 10px; background: #fff8db; border: 1px solid #f0d77a; }
.lawyer-cta h3 { margin-top: 0; }
.forms-table, .worksheet table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 6px 0 12px; }
.forms-table th, .forms-table td, .worksheet th, .worksheet td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.forms-table td:first-child { white-space: nowrap; font-weight: bold; width: 80px; }
.checklist { list-style: none; padding: 0; }
.checklist li { margin: 6px 0; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; }
.checklist input { margin-top: 4px; }
.next-steps li { margin: 8px 0; }
.worksheet { border: 1px solid var(--line); border-radius: 10px; padding: 8px 18px; background: #fff; }
.worksheet section { border-bottom: 1px solid var(--line); padding: 8px 0; }
.worksheet section:last-of-type { border-bottom: 0; }
.worksheet h4 { margin: 10px 0 4px; color: var(--brand); }
.worksheet h5 { margin: 10px 0 2px; font-size: .9rem; }
.worksheet table.kv th { width: 45%; font-weight: normal; color: var(--muted); }
.worksheet thead th { font-size: .8rem; color: var(--muted); }
.ws-total { font-weight: bold; }
.muted { color: var(--muted); }


@media (max-width: 860px) {
  .prep-layout { grid-template-columns: minmax(0, 1fr); }
  .prep-side { position: static; min-width: 0; }
  .steps-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 6px; }
  .steps-nav button { white-space: nowrap; }
  .toolbar { flex-direction: row; flex-wrap: wrap; gap: 14px; }
  .toolbar .save-status { flex-basis: 100%; }
  .wizard { padding: 20px 16px; }
  .field.half, .field.third { flex-basis: 100%; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  .site-header, .site-footer, .skip-link, .prep-hero, .prep-side, .faq, .section-alt, .step-buttons, .lawyer-cta, .checklist input { display: none !important; }
  body { background: #fff; }
  .prep-layout { display: block; width: 100%; margin: 0; }
  .wizard { border: 0; box-shadow: none; padding: 0; }
  .worksheet { border: 0; padding: 0; }
  .worksheet section { break-inside: avoid-page; }
  a { color: inherit; }
}

/* ---- filled-in forms */
.forms-dl { margin: 12px 0 8px; display: flex; flex-direction: column; gap: 14px; }
.forms-dl > .btn, .forms-dl > .btn-secondary { align-self: flex-start; }
.forms-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.forms-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; margin: 0; border-bottom: 1px solid var(--line); }
.forms-list li:last-child { border-bottom: 0; }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.forms-dl h4 { margin: 8px 0 0; }
.worksheet section { overflow-x: auto; }
@media print { .worksheet section { overflow: visible; } }

/* ---- exemptions step */
.exemptions .alert { margin: 10px 0; }
.ex-system { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 14px 0; }
.ex-system legend { font-weight: 600; padding: 0 6px; }
.ex-system label { display: flex; gap: 10px; align-items: center; margin: 6px 0; cursor: pointer; }
.ex-guide { background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; margin: 14px 0; }
.ex-guide summary { font-weight: 600; cursor: pointer; color: var(--navy); }
.ex-guide ol { margin: 12px 0 4px; padding-left: 1.3em; }
.ex-guide li { margin: 8px 0; }
.ex-guide ul { margin: 6px 0; }
.ex-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 10px 0; background: #fff; }
.ex-item.on { border-color: #b9cdf3; background: #fafcff; }
.ex-head { font-weight: normal; }
.ex-head .muted { font-size: .9rem; }
.ex-entry { margin: 12px 0 4px 28px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ex-entry label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.ex-entry select, .ex-entry input[type=text] { width: 100%; box-sizing: border-box; padding: 9px 11px; font: inherit; border: 1px solid #b8c1cc; border-radius: 8px; margin-top: 4px; background: #fff; }
.ex-entry input:disabled { background: #eef1f5; color: var(--muted); }
.ex-amount { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 12px; align-items: end; margin-top: 8px; }
.ex-amount label.check { font-weight: normal; margin-bottom: 10px; }
.ex-item .link-btn { margin: 8px 0 0 28px; font-size: .9rem; }
.ex-gap { color: var(--stop); font-size: .9rem; margin: 8px 0 0 28px; }
.ex-usage { width: 100%; border-collapse: collapse; margin: 0 0 10px; font-size: .92rem; background: #fff; }
.ex-usage th, .ex-usage td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) {
  .ex-entry, .ex-item .link-btn, .ex-gap { margin-left: 0; }
  .ex-amount { grid-template-columns: minmax(0, 1fr); }
}
