/* ============================================================
   Utilities Bunker — Income Tax Calculator v2.1
   File: /assets/css/modules/calculators/financialcalculators/income-tax-calculator.v2.1.css
   Purpose:
   - Tool-only layout and presentation for Income Tax Calculator
   - No changes to ub-toolkit.v2.1.css
   - Mobile-first, responsive, accessible, 44x44 touch targets
   ============================================================ */

:root{
  --itx-radius: 16px;
  --itx-gap: 14px;
  --itx-soft: rgba(0,0,0,.06);
  --itx-soft-strong: rgba(0,0,0,.10);
  --itx-accent: rgba(249,58,19,.12);
  --itx-accent-border: rgba(249,58,19,.30);
}

html.ub-theme-dark:root{
  --itx-soft: rgba(255,255,255,.05);
  --itx-soft-strong: rgba(255,255,255,.10);
  --itx-accent: rgba(249,58,19,.16);
  --itx-accent-border: rgba(249,58,19,.38);
}

/* Header card top row */
.itx-head{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
}

.itx-title{
  margin:0;
  font-size:var(--ub-fs-5);
}

/* How-to steps */
.itx-steps{
  margin:0;
  padding-left:18px;
}

.itx-steps li + li{
  margin-top:6px;
}

/* Main hero layout */
.itx-hero{
  display:grid;
  grid-template-columns:1.06fr .94fr;
  gap:var(--itx-gap);
  align-items:start;
}

@media (max-width: 980px){
  .itx-hero{
    grid-template-columns:1fr;
  }
}

/* Panel blocks */
.itx-panel{
  background:var(--ub-surface-2);
  border:1px solid var(--ub-border);
  border-radius:var(--itx-radius);
  padding:12px;
}

.itx-panel--summary{
  position:relative;
  overflow:hidden;
}

.itx-panel--summary::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:4px;
  background:linear-gradient(92deg,var(--ub-btn-grad-a),var(--ub-btn-grad-b));
  opacity:.95;
}

.itx-panel-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
}

.itx-eyebrow{
  font-size:12px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--ub-muted);
}

.itx-panel-title{
  font-size:clamp(18px,1rem + .5vw,22px);
  font-weight:950;
  line-height:1.15;
  margin-top:4px;
}

.itx-panel-sub{
  font-size:12px;
  color:var(--ub-muted);
  margin-top:4px;
}

/* Badge KPIs */
.itx-badges{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

.itx-badge{
  min-width:118px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background:var(--ub-card-bg);
}

.itx-badge .k{
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--ub-muted);
}

.itx-badge .v{
  font-family:var(--ub-mono);
  font-weight:950;
  font-size:14px;
  margin-top:2px;
}

/* Hero tax result */
.itx-highlight{
  margin-top:12px;
  padding:14px;
  border-radius:16px;
  background:
    linear-gradient(180deg, var(--itx-accent), transparent 120%),
    var(--ub-card-bg);
  border:1px solid var(--itx-accent-border);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
}

.itx-highlight-k{
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:var(--ub-muted);
}

.itx-highlight-v{
  margin-top:6px;
  font-family:var(--ub-mono);
  font-size:clamp(28px,1.5rem + 1.2vw,42px);
  line-height:1.05;
  font-weight:950;
  letter-spacing:-.02em;
  overflow-wrap:anywhere;
}

.itx-highlight-note{
  margin-top:8px;
  font-size:13px;
  color:var(--ub-muted);
}

/* Summary metric grid */
.itx-summary-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}

@media (max-width: 560px){
  .itx-summary-grid{
    grid-template-columns:1fr;
  }
}

.itx-metric{
  min-height:76px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background:var(--ub-card-bg);
}

.itx-metric .k{
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--ub-muted);
}

.itx-metric .v{
  margin-top:4px;
  font-family:var(--ub-mono);
  font-size:clamp(15px,.88rem + .2vw,17px);
  font-weight:950;
  line-height:1.25;
  overflow-wrap:anywhere;
}

/* Status pill */
.itx-status{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  margin-top:12px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--ub-border);
  background:var(--ub-card-bg);
  font-size:12px;
  font-weight:900;
}

.itx-status-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--ub-muted);
  flex:0 0 auto;
}

/* Divider */
.itx-sep{
  border:none;
  border-top:1px solid var(--ub-border);
  margin:14px 0;
}

/* Preset chips row */
.itx-chiprow{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.itx-chiprow .ub-chip{
  min-height:44px;
  padding:10px 12px;
}

/* Action row */
.itx-actions{
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

/* Work output */
.itx-work{
  font-family:var(--ub-mono);
  font-size:13px;
  line-height:1.58;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

/* Formula list */
.itx-formula-list{
  margin:0;
  padding-left:18px;
}

.itx-formula-list li + li{
  margin-top:6px;
}

/* FAQ spacing */
.itx-faq-q{
  margin:12px 0 6px;
  font-size:var(--ub-fs-2);
  line-height:1.25;
}

.itx-faq-a{
  margin:0 0 10px;
}

.itx-faq-a:last-child{
  margin-bottom:0;
}

/* Tighten inputs visually for this tool without touching toolkit */
.itx-panel .ub-card{
  margin-bottom:0;
  background:transparent;
  box-shadow:none;
  border:none;
  padding:0;
}

/* Slight enhancement to live output */
#liveOut{
  margin-top:12px;
}

#liveOut .ub-v{
  overflow-wrap:anywhere;
}

/* Accessible button block helper */
.ub-btn--block{
  width:100%;
}

/* Improve long values on narrow devices */
#taxTotalHero,
#sumGross,
#sumTaxable,
#sumDeduction,
#sumCredits,
#sumBeforeCredits,
#sumAfterTax,
#outEstimatedTax,
#outTaxableIncome{
  word-break:break-word;
}

/* Small-screen refinements */
@media (max-width: 640px){
  .itx-panel-top{
    align-items:stretch;
  }

  .itx-badges{
    width:100%;
    justify-content:flex-start;
  }

  .itx-badge{
    flex:1 1 140px;
  }

  .itx-highlight{
    padding:12px;
  }

  .itx-highlight-v{
    font-size:clamp(24px,1.2rem + 1.5vw,34px);
  }
}

/* Focus polish for chips and summary blocks */
.itx-chiprow .ub-chip:focus-visible,
.itx-status:focus-visible,
.itx-metric:focus-within{
  outline:none;
  box-shadow:0 0 0 4px var(--ub-focus);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .itx-panel--summary::before{
    transition:none !important;
  }
}