/*
 * Lakelaw Chapter 7 Means Test Calculator
 * Version: 2.3.0
 *
 * All rules scoped under .llmt-wrap to prevent WordPress theme bleed.
 * Matches the 2026-03-14 standalone delivery — update both files in sync.
 */

/* ── Variables (scoped to prevent :root bleed) ───────────────────────────── */
.llmt-wrap {
  --red:        #990000;
  --red-hover:  #7a0000;
  --red-dark:   #7a0000;
  --red-pale:   rgba(153, 0, 0, 0.10);
  --red-glow:   rgba(153, 0, 0, .15);
  --black:      #1c1c1c;
  --gray-900:   #333333;
  --gray-700:   #4a4a4a;
  --gray-600:   #666666;
  --gray-500:   #888888;
  --gray-400:   #999999;       /* slightly stronger so progress labels read on parchment */
  --gray-300:   #c5beae;       /* parchment-tinted, visible borders */
  --gray-200:   #d8d2c3;       /* hairlines */
  --gray-100:   #ece6d6;       /* very soft fill (still visible against bg-wrap) */
  --white:      #ffffff;
  --offwhite:   #fafafa;
  --font:       'Open Sans', -apple-system, 'Segoe UI', Arial, Helvetica, sans-serif;
  --radius:     4px;
  --radius-lg:  8px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 4px 24px rgba(0,0,0,.1);

  /* Wrapper surface — flips in dark mode */
  --bg-wrap:        #f4efe8;
  --border-wrap:    rgba(28, 28, 28, 0.12);

  box-sizing: border-box;
  font-family: var(--font);
  color: var(--gray-700);
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-wrap);
  border: 1px solid var(--border-wrap);
  border-radius: 12px;
  padding: clamp(20px, 4vw, 36px);
  color-scheme: light;
}
.llmt-wrap *, .llmt-wrap *::before, .llmt-wrap *::after {
  box-sizing: border-box;
}

/* ── Progress bar ────────────────────────────────────────────────────────── */
.llmt-wrap .progress-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.llmt-wrap .progress-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  text-align: center;
  flex: 1;
  transition: color .4s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.llmt-wrap .progress-label.active { color: var(--red); }
.llmt-wrap .progress-track {
  height: 3px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 28px;
}
.llmt-wrap .progress-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
  border-radius: 3px;
  transition: width .6s cubic-bezier(.22,1,.36,1);
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.llmt-wrap .card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}
.llmt-wrap .step-content {
  opacity: 1;
  transform: translateY(0);
  transition: all .3s ease;
}
.llmt-wrap .step-content.fade-out {
  opacity: 0;
  transform: translateY(10px);
}
.llmt-wrap .step         { display: none; }
.llmt-wrap .step.active  { display: block; }
.llmt-wrap .text-center  { text-align: center; }

/* ── Typography ──────────────────────────────────────────────────────────── */
.llmt-wrap h1 { font-size: 28px; font-weight: 800; color: var(--black); margin-bottom: 10px; line-height: 1.25; }
.llmt-wrap h2 { font-size: 22px; font-weight: 700; color: var(--black); margin-bottom: 8px;  line-height: 1.3; }
.llmt-wrap h3 { font-size: 15px; font-weight: 700; color: var(--black); margin-bottom: 14px; }
.llmt-wrap .subtitle     { font-size: 14px; color: var(--gray-600); line-height: 1.8; max-width: 440px; margin: 0 auto 24px; font-weight: 400; }
.llmt-wrap .section-desc { font-size: 13px; color: var(--gray-600); margin-bottom: 24px; line-height: 1.7; }
.llmt-wrap .hint         { font-size: 12px; color: var(--gray-600); margin-top: 6px;  font-weight: 400; line-height: 1.5; }
.llmt-wrap .hint-small   { font-size: 11px; color: var(--gray-600); margin-top: 4px; }

/* ── Accent elements ─────────────────────────────────────────────────────── */
.llmt-wrap .accent-line       { width: 50px; height: 3px; background: var(--red); margin: 12px auto 20px; border-radius: 0; }
.llmt-wrap .accent-line.left  { margin-left: 0; }
.llmt-wrap .icon-circle {
  width: 70px; height: 70px; border-radius: 50%;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}
.llmt-wrap .icon-circle.brand      { background: var(--red);   color: var(--white); box-shadow: 0 6px 20px var(--red-glow); }
.llmt-wrap .icon-circle.green      { background: #27ae60; color: #fff; font-size: 34px; box-shadow: 0 6px 20px rgba(39,174,96,.2); }
.llmt-wrap .icon-circle.red-result { background: var(--red);   color: #fff; font-size: 34px; box-shadow: 0 6px 20px var(--red-glow); }
.llmt-wrap .result-icon            { width: 76px; height: 76px; margin: 0 auto 16px; }

/* ── Info boxes ──────────────────────────────────────────────────────────── */
.llmt-wrap .info-box {
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 16px;
  font-weight: 400;
}
.llmt-wrap .info-box strong { font-weight: 700; }
.llmt-wrap .info-box.info    { background: #ebf5fb; border-left: 4px solid #3498db; color: #1a5276; }
.llmt-wrap .info-box.warning { background: #fef9e7; border-left: 4px solid #f1c40f; color: #7d6608; }
.llmt-wrap .info-box.success { background: #eafaf1; border-left: 4px solid #27ae60; color: #1e8449; }
.llmt-wrap .info-box .icon   { margin-right: 6px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.llmt-wrap .form-group { margin-bottom: 22px; }
.llmt-wrap .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.llmt-wrap select,
.llmt-wrap .text-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  font-size: 14px;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.llmt-wrap select:focus,
.llmt-wrap .text-input:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.llmt-wrap select { cursor: pointer; }
.llmt-wrap .input-wrapper  { position: relative; }
.llmt-wrap .input-prefix   { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gray-500); font-size: 14px; font-weight: 700; pointer-events: none; }
.llmt-wrap .input-wrapper .text-input { padding-left: 32px; }

/* ── Toggle group ────────────────────────────────────────────────────────── */
.llmt-wrap .toggle-group { display: flex; gap: 10px; }
.llmt-wrap .toggle-btn {
  flex: 1; padding: 11px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background: var(--white);
  cursor: pointer;
  font-size: 13px; font-weight: 700; font-family: var(--font);
  color: var(--gray-600);
  transition: all .2s;
  text-transform: uppercase; letter-spacing: .3px;
}
.llmt-wrap .toggle-btn.active          { border-color: var(--red); background: var(--red-pale); color: var(--red); }
.llmt-wrap .toggle-btn:hover:not(.active) { border-color: var(--gray-400); background: var(--offwhite); }

/* ── Filing cards ────────────────────────────────────────────────────────── */
.llmt-wrap .filing-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.llmt-wrap .filing-card {
  flex: 1; min-width: 140px;
  padding: 16px 12px;
  border-radius: var(--radius);
  border: 2px solid var(--gray-300);
  background: var(--white);
  cursor: pointer; text-align: center;
  transition: all .25s ease; position: relative;
}
.llmt-wrap .filing-card:hover:not(.active) { border-color: var(--gray-400); background: var(--offwhite); transform: translateY(-1px); }
.llmt-wrap .filing-card.active { border-color: #2e7d32; background: #e8f5e9; box-shadow: 0 4px 14px rgba(46,125,50,.15); }
.llmt-wrap .filing-card .fc-icon {
  width: 42px; height: 42px; border-radius: 50%;
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: var(--gray-200); color: var(--gray-500);
  transition: all .25s;
}
.llmt-wrap .filing-card.active .fc-icon { background: #2e7d32; color: #fff; box-shadow: 0 3px 10px rgba(46,125,50,.25); }
.llmt-wrap .filing-card .fc-label { font-size: 13px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: .3px; transition: color .25s; }
.llmt-wrap .filing-card.active .fc-label { color: #1b5e20; }
.llmt-wrap .filing-card .fc-desc { font-size: 11px; color: var(--gray-500); margin-top: 4px; line-height: 1.4; }
.llmt-wrap .filing-card.active .fc-desc { color: #2e7d32; }
.llmt-wrap .filing-card .fc-check {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #2e7d32; color: #fff;
  display: none; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.llmt-wrap .filing-card.active .fc-check { display: flex; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.llmt-wrap .btn {
  padding: 13px 28px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 700; font-family: var(--font);
  cursor: pointer; border: none;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: .8px;
  text-decoration: none;
}
.llmt-wrap .btn:hover:not(:disabled)  { transform: translateY(-1px); }
.llmt-wrap .btn:active:not(:disabled) { transform: translateY(0); }
.llmt-wrap .btn:disabled              { opacity: .35; cursor: not-allowed; }
.llmt-wrap .btn-primary               { background: var(--red); color: var(--white); }
.llmt-wrap .btn-primary:hover:not(:disabled) { background: var(--red-hover); box-shadow: 0 4px 14px var(--red-glow); }
.llmt-wrap .btn-secondary             { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.llmt-wrap .btn-secondary:hover:not(:disabled) { background: var(--gray-200); }
.llmt-wrap .btn-black                 { background: var(--black); color: var(--white); }
.llmt-wrap .btn-black:hover:not(:disabled) { background: var(--gray-900); }
.llmt-wrap .btn-row    { display: flex; justify-content: space-between; margin-top: 30px; flex-wrap: wrap; gap: 10px; }
.llmt-wrap .btn-center { display: flex; justify-content: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

/* ── Income comparison ───────────────────────────────────────────────────── */
.llmt-wrap .stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.llmt-wrap .stat-box  { background: var(--offwhite); border-radius: var(--radius-lg); padding: 20px; text-align: center; border: 1px solid var(--gray-200); }
.llmt-wrap .stat-label { font-size: 9px; color: var(--gray-500); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.llmt-wrap .stat-value { font-size: 22px; font-weight: 800; color: var(--black); }
.llmt-wrap .stat-value.accent { color: var(--red); }

/* ── Median panel ────────────────────────────────────────────────────────── */
.llmt-wrap .median-panel { background: var(--offwhite); border-radius: var(--radius-lg); padding: 16px 18px; border: 1px solid var(--gray-200); margin-bottom: 22px; }
.llmt-wrap .median-panel .label { font-size: 11px; color: var(--gray-500); margin-bottom: 3px; font-weight: 500; }
.llmt-wrap .median-panel .value { font-size: 20px; font-weight: 800; color: var(--red); }
.llmt-wrap .median-panel .sub   { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ── Summary card ────────────────────────────────────────────────────────── */
.llmt-wrap .summary-card { background: var(--offwhite); border-radius: var(--radius-lg); padding: 22px; border: 1px solid var(--gray-200); margin-bottom: 18px; }
.llmt-wrap .summary-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.llmt-wrap .summary-item { padding: 8px 0; border-bottom: 1px solid var(--gray-200); }
.llmt-wrap .summary-item .label { font-size: 9px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.llmt-wrap .summary-item .value { font-size: 15px; font-weight: 700; color: var(--black); }

/* ── Allowance breakdown ─────────────────────────────────────────────────── */
.llmt-wrap .allowance-breakdown { background: var(--offwhite); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 20px; }
.llmt-wrap .allowance-breakdown .title { font-size: 11px; font-weight: 700; color: var(--black); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .6px; }
.llmt-wrap .allowance-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; border-bottom: 1px solid var(--gray-200); }
.llmt-wrap .allowance-row:last-child { border-bottom: none; font-weight: 700; padding-top: 8px; border-top: 2px solid var(--gray-300); }
.llmt-wrap .allowance-row .name { color: var(--gray-600); }
.llmt-wrap .allowance-row .amt  { color: var(--red); font-weight: 700; }

/* ── Expense total ───────────────────────────────────────────────────────── */
.llmt-wrap .expense-total { background: var(--offwhite); border-radius: var(--radius-lg); padding: 16px 18px; border: 1px solid var(--gray-200); margin-top: 22px; }
.llmt-wrap .expense-total .label { font-size: 11px; color: var(--gray-500); font-weight: 500; }
.llmt-wrap .expense-total .value { font-size: 22px; font-weight: 800; color: var(--red); }
.llmt-wrap .expense-total .sub   { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.llmt-wrap .separator { border-top: 1px solid var(--gray-200); padding-top: 22px; margin-top: 10px; }

/* ── Data source / CTA ───────────────────────────────────────────────────── */
.llmt-wrap .data-source { background: var(--offwhite); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 12px 16px; margin-top: 16px; font-size: 11px; color: var(--gray-600); line-height: 1.7; }
.llmt-wrap .data-source a        { color: var(--red); text-decoration: none; font-weight: 600; }
.llmt-wrap .data-source a:hover  { text-decoration: underline; }
.llmt-wrap .data-source strong   { color: var(--black); }
.llmt-wrap .cta-link             { color: var(--red); font-weight: 700; text-decoration: none; }
.llmt-wrap .cta-link:hover       { text-decoration: underline; }

/* ── Result typography ───────────────────────────────────────────────────── */
.llmt-wrap .result-pass { color: #27ae60; }
.llmt-wrap .result-fail { color: var(--red); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .llmt-wrap .card          { padding: 28px 20px; }
  .llmt-wrap h1             { font-size: 23px; }
  .llmt-wrap h2             { font-size: 19px; }
  .llmt-wrap .stat-grid,
  .llmt-wrap .summary-row   { grid-template-columns: 1fr; }
  .llmt-wrap .btn           { padding: 12px 20px; font-size: 12px; }
  .llmt-wrap .btn-row       { flex-direction: column; }
  .llmt-wrap .btn-center    { flex-direction: column; align-items: stretch; }
}

/* ── Bottom disclaimer ───────────────────────────────────────────────────── */
.llmt-wrap .llmt-disclaimer {
  font-size: 11px;
  color: var(--gray-600);
  text-align: center;
  line-height: 1.6;
  margin: 22px 0 0;
}
.llmt-wrap .llmt-disclaimer-link {
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
}
.llmt-wrap .llmt-disclaimer-link:hover { text-decoration: underline; }

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  .llmt-wrap .card           { box-shadow: none; border: 1px solid #ddd; }
  .llmt-wrap .btn,
  .llmt-wrap .progress-labels,
  .llmt-wrap .progress-track { display: none !important; }
}

/* ── Dark mode (html.darkmode-active) ────────────────────────────────────── */
html.darkmode-active .llmt-wrap {
  --bg-wrap:        #1c1c1c;
  --border-wrap:    rgba(255, 255, 255, 0.16);

  color-scheme: dark;

  /* Surfaces — card lifted further for clearer hierarchy */
  --white:          #2a2925;       /* card surface */
  --offwhite:       #302e2a;       /* alt surfaces (stat boxes, panels) */

  /* Borders / fills — bumped for visibility */
  --gray-100:       #34322e;       /* secondary button fill */
  --gray-200:       rgba(255, 255, 255, 0.20);
  --gray-300:       rgba(255, 255, 255, 0.28);
  --gray-400:       #b8b0a3;       /* progress label inactive */

  /* Text */
  --gray-500:       #c8c0b3;       /* muted */
  --gray-600:       #d4ccbf;       /* secondary */
  --gray-700:       #ebe5dc;       /* body */
  --gray-900:       #f4efe8;       /* form labels */
  --black:          #f8f3ea;       /* heading text */

  /* Brand red — boost for dark contrast */
  --red:            #ff5454;
  --red-hover:      #ff7a7a;
  --red-pale:       rgba(255, 84, 84, 0.16);
  --red-glow:       rgba(255, 84, 84, 0.25);

  --shadow:         0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:      0 4px 24px rgba(0, 0, 0, 0.5);
}

/* Dark mode tweaks for areas where flipping the var alone is wrong */
html.darkmode-active .llmt-wrap .btn-black {
  background: var(--red);
  color: #ffffff;
}
html.darkmode-active .llmt-wrap .btn-black:hover:not(:disabled) {
  background: var(--red-hover);
}
html.darkmode-active .llmt-wrap .icon-circle.brand,
html.darkmode-active .llmt-wrap .icon-circle.red-result {
  color: #ffffff;
}
html.darkmode-active .llmt-wrap .info-box.info    { background: rgba(52, 152, 219, 0.12); color: #d6ecf9; }
html.darkmode-active .llmt-wrap .info-box.warning { background: rgba(241, 196, 15, 0.12); color: #f0e4ad; }
html.darkmode-active .llmt-wrap .info-box.success { background: rgba(39, 174, 96, 0.14);  color: #c8edd6; }
html.darkmode-active .llmt-wrap .filing-card.active        { background: rgba(46, 125, 50, 0.22); border-color: #4caf50; }
html.darkmode-active .llmt-wrap .filing-card.active .fc-label { color: #c8edd6; }
html.darkmode-active .llmt-wrap .filing-card.active .fc-desc  { color: #a8d8b8; }
html.darkmode-active .llmt-wrap select,
html.darkmode-active .llmt-wrap .text-input {
  background: var(--white);
  color: var(--gray-900);
  border-color: var(--gray-300);
}
html.darkmode-active .llmt-wrap select:focus,
html.darkmode-active .llmt-wrap .text-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}
