/* After-Tax Pay Calculator — page-specific styles. Every rule is scoped to
   .atpc (the calculator <main>) so the rest of the website is unaffected. */
.atpc {
  --a-navy: #102A43;
  --a-deep: #0B1F33;
  --a-white: #FFFFFF;
  --a-bg: #F4F7FA;
  --a-text: #243447;
  --a-muted: #52606D;
  --a-border: #D9E2EC;
  --a-green: #16805D;
  --a-green-bg: #E8F5EF;
  --a-amber-bg: #FFF7E6;
  --a-amber: #8A5A00;
  --a-red: #B42318;
  --a-focus: #2B6CB0;
  --a-radius: 10px;
  display: block;
  background: var(--a-bg);
  color: var(--a-text);
  padding-top: var(--header-height, 76px);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}
.atpc *, .atpc *::before, .atpc *::after { box-sizing: border-box; }
.atpc section { padding: 0; background: transparent; }
.atpc h1, .atpc h2, .atpc h3, .atpc h4 { color: var(--a-navy); font-family: 'Outfit', 'Inter', sans-serif; letter-spacing: -0.01em; line-height: 1.25; }
.atpc a { color: var(--a-navy); text-decoration: underline; text-underline-offset: 2px; }
.atpc a:hover { color: var(--a-deep); }
.atpc :focus-visible { outline: 3px solid var(--a-focus); outline-offset: 2px; }

.atpc-wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* Intro ------------------------------------------------------------- */
.atpc-intro { background: var(--a-white); border-bottom: 1px solid var(--a-border); padding: 28px 0 26px; }
.atpc-crumbs { font-size: 14px; color: var(--a-muted); margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.atpc-crumbs a { color: var(--a-muted); }
.atpc-intro h1 { font-size: clamp(28px, 4.2vw, 40px); margin: 0 0 10px; font-weight: 700; }
.atpc-lede { max-width: 760px; font-size: 17px; margin: 0 0 16px; }
.atpc-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; }
.atpc-facts li { font-size: 13.5px; border: 1px solid var(--a-border); border-radius: 999px; padding: 5px 12px; background: var(--a-bg); }
.atpc-facts strong { color: var(--a-navy); font-weight: 600; }
.atpc-private { font-size: 14px; color: var(--a-muted); margin: 0; }
.atpc-private i { color: var(--a-green); margin-right: 4px; }

/* Layout ------------------------------------------------------------ */
.atpc-tool { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; margin: 28px 0; align-items: start; }
.atpc .atpc-form, .atpc .atpc-results { background: var(--a-white); border: 1px solid var(--a-border); border-radius: var(--a-radius); padding: 22px; }
.atpc-results { position: sticky; top: calc(var(--header-height, 76px) + 16px); }
.atpc-h-card { font-size: 20px; margin: 0 0 16px; font-weight: 600; }
.atpc-h-sub { font-size: 16px; margin: 22px 0 8px; font-weight: 600; }

/* Form -------------------------------------------------------------- */
.atpc-field { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.atpc-field > label, .atpc-field > legend { display: block; font-weight: 600; font-size: 14px; color: var(--a-navy); margin-bottom: 6px; padding: 0; }
.atpc-req { font-weight: 500; font-size: 12px; color: var(--a-muted); margin-left: 4px; }
.atpc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.atpc-row[hidden], .atpc-field[hidden] { display: none; }
.atpc input[type="text"], .atpc select {
  width: 100%; height: 44px; padding: 0 12px; font-size: 16px; color: var(--a-text);
  background: var(--a-white); border: 1px solid #BCCCDC; border-radius: 8px; font-family: inherit;
}
.atpc select { padding-right: 32px; }
.atpc input[type="text"]:focus, .atpc select:focus { border-color: var(--a-navy); outline: 3px solid rgba(43, 108, 176, .35); outline-offset: 0; box-shadow: none; }
.atpc input[aria-invalid="true"], .atpc select[aria-invalid="true"] { border-color: var(--a-red); }
.atpc-money { position: relative; }
.atpc-cur { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--a-muted); font-weight: 600; pointer-events: none; }
.atpc-money input[type="text"] { padding-left: 30px; font-weight: 600; }
.atpc-hint { font-size: 13px; color: var(--a-muted); margin: 6px 0 0; }
.atpc-err { font-size: 13px; color: var(--a-red); margin: 6px 0 0; font-weight: 500; }
.atpc-err:empty { display: none; }
.atpc-check { display: flex; align-items: flex-end; }
.atpc-check label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; height: 44px; cursor: pointer; }
.atpc-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--a-navy); }

/* Segmented controls */
.atpc-seg { display: grid; gap: 6px; }
.atpc-seg-4 { grid-template-columns: repeat(4, 1fr); }
.atpc-seg-2 { grid-template-columns: repeat(2, 1fr); }
.atpc-seg label { position: relative; margin: 0; cursor: pointer; }
.atpc-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.atpc-seg span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 6px 8px;
  border: 1px solid #BCCCDC; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--a-text); background: var(--a-white); line-height: 1.2;
}
.atpc-seg label:hover span { border-color: var(--a-navy); }
.atpc-seg input:checked + span { background: var(--a-navy); border-color: var(--a-navy); color: var(--a-white); font-weight: 600; }
.atpc-seg input:focus-visible + span { outline: 3px solid var(--a-focus); outline-offset: 2px; }

.atpc-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.atpc-btn-reset {
  height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--a-navy); background: var(--a-white);
  color: var(--a-navy); font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit;
}
.atpc-btn-reset:hover { background: var(--a-bg); }
.atpc-auto { font-size: 13px; color: var(--a-muted); }

/* Results ----------------------------------------------------------- */
.atpc-empty { color: var(--a-muted); padding: 28px 0; text-align: center; border: 1px dashed var(--a-border); border-radius: 8px; }
.atpc-empty p { margin: 0; }
.atpc-context { font-size: 13.5px; color: var(--a-muted); margin: -8px 0 14px; }
.atpc-hero-num { background: var(--a-green-bg); border: 1px solid #B7E1CD; border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.atpc-hero-label { font-size: 13px; font-weight: 600; color: var(--a-green); text-transform: uppercase; letter-spacing: .04em; }
.atpc-hero-value { font-family: 'Outfit', 'Inter', sans-serif; font-size: clamp(30px, 4.5vw, 40px); font-weight: 700; color: var(--a-green); line-height: 1.1; font-variant-numeric: tabular-nums; }
.atpc-hero-sub { font-size: 15px; color: var(--a-text); }
.atpc-hero-sub span { font-weight: 700; color: var(--a-green); }
.atpc-warn { background: var(--a-amber-bg); border: 1px solid #F3D9A4; color: var(--a-amber); padding: 10px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px; }
.atpc-warn p { margin: 0 0 4px; } .atpc-warn p:last-child { margin: 0; }

.atpc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.atpc-cards > div { border: 1px solid var(--a-border); border-radius: 8px; padding: 10px 12px; background: var(--a-white); }
.atpc-cards dt { font-size: 12.5px; color: var(--a-muted); font-weight: 500; line-height: 1.3; }
.atpc-cards dd { margin: 4px 0 0; font-size: 18px; font-weight: 700; color: var(--a-navy); font-variant-numeric: tabular-nums; }

.atpc-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin: 16px 0 6px; background: var(--a-border); }
.atpc-bar span { display: block; height: 100%; }
.atpc-bar-net, .atpc-legend .k-net { background: var(--a-green); }
.atpc-bar-tax, .atpc-legend .k-tax { background: var(--a-navy); }
.atpc-bar-con, .atpc-legend .k-con { background: #829AB1; }
.atpc-legend { list-style: none; display: flex; gap: 14px; flex-wrap: wrap; margin: 0; padding: 0; font-size: 12.5px; color: var(--a-muted); }
.atpc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.atpc-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.atpc-table th, .atpc-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--a-border); vertical-align: top; }
.atpc-table thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--a-muted); font-weight: 600; }
.atpc-table tbody th { font-weight: 500; color: var(--a-text); }
.atpc-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.atpc-table tr.is-total th, .atpc-table tr.is-total td { font-weight: 700; color: var(--a-navy); border-bottom: 0; }
.atpc-table tr.is-net td.num { color: var(--a-green); }
.atpc-table tr.is-excluded td, .atpc-table tr.is-excluded th { color: var(--a-amber); }
.atpc-tag { font-size: 11.5px; color: var(--a-muted); font-weight: 500; white-space: nowrap; }
.atpc-small { font-size: 13px; color: var(--a-muted); margin: 8px 0 0; }

.atpc-details { margin-top: 20px; border: 1px solid var(--a-border); border-radius: 8px; background: var(--a-bg); }
.atpc-details summary { cursor: pointer; padding: 12px 14px; font-weight: 600; color: var(--a-navy); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.atpc-details summary::-webkit-details-marker { display: none; }
.atpc-details summary::after { content: '+'; font-size: 20px; line-height: 1; }
.atpc-details[open] summary::after { content: '−'; }
.atpc-details > div, .atpc-details > h4, .atpc-details > ul { margin-left: 14px; margin-right: 14px; }
.atpc-details h4 { font-size: 14.5px; margin-top: 14px; margin-bottom: 6px; }
.atpc-details ul, .atpc-details ol { padding-left: 18px; margin-top: 0; margin-bottom: 12px; font-size: 13.5px; }
.atpc-details li { margin-bottom: 4px; overflow-wrap: anywhere; }
.atpc-step { margin-bottom: 8px; }
.atpc-step h4 { margin: 10px 0 6px; }

/* Ads --------------------------------------------------------------- */
.atpc-ad { margin: 8px auto 28px; max-width: 970px; text-align: center; min-height: 0; }
.atpc-ad::before { content: 'Advertisement'; display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--a-muted); margin-bottom: 4px; }
.atpc-ad[hidden] { display: none; }

/* Content ----------------------------------------------------------- */
.atpc-content { background: var(--a-white); border: 1px solid var(--a-border); border-radius: var(--a-radius); padding: 8px 28px 24px; margin-bottom: 28px; }
.atpc-content section { border-bottom: 1px solid var(--a-border); padding: 20px 0; }
.atpc-content section:last-child { border-bottom: 0; }
.atpc-content h2 { font-size: 22px; margin: 0 0 10px; font-weight: 600; }
.atpc-content h3 { font-size: 16.5px; margin: 16px 0 4px; font-weight: 600; }
.atpc-content p { margin: 0 0 10px; max-width: 820px; }
.atpc-content ul, .atpc-content ol { padding-left: 22px; margin: 0 0 10px; max-width: 860px; }
.atpc-content li { margin-bottom: 6px; }
.atpc-table-wrap { overflow-x: auto; }
.atpc-compare { font-size: 14px; min-width: 620px; }
.atpc-compare tbody th { font-weight: 600; color: var(--a-navy); width: 20%; }
.atpc-sources li { overflow-wrap: anywhere; }
.atpc-cta { background: transparent; }
.atpc-alert { background: var(--a-amber-bg); color: var(--a-amber); padding: 12px; border-radius: 8px; margin-top: 16px; }

/* Responsive -------------------------------------------------------- */
@media (max-width: 960px) {
  .atpc-tool { grid-template-columns: 1fr; }
  .atpc-results { position: static; }
}
@media (max-width: 560px) {
  .atpc .atpc-form, .atpc .atpc-results { padding: 16px; }
  .atpc-content { padding: 4px 16px 16px; }
  .atpc-seg-4 { grid-template-columns: repeat(2, 1fr); }
  .atpc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atpc-row { grid-template-columns: 1fr; gap: 0; }
  .atpc-table { font-size: 14px; }
  .atpc-tag { display: block; }
}
@media (prefers-reduced-motion: reduce) { .atpc * { transition: none !important; scroll-behavior: auto !important; } }
