/* Pay in 4 calculator page (/pay-in-4-calculator). Loaded after home.css,
   whose tokens, fonts, header, buttons, badge, footer and Tick it reuses. */

.calc-page .top { border-bottom-color: var(--line); }
.calc-page .btn { display: inline-flex; align-items: center; justify-content: center; font: 700 15px/1 var(--body); padding: 15px 22px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); cursor: pointer; text-decoration: none; white-space: nowrap; }
.calc-page .get.btn { font-size: 14px; padding: 12px 18px; }

.print-only { display: none; }

.pcalc { padding-top: 28px; padding-bottom: 72px; }
.calc__head { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.calc__title { font: 800 clamp(38px, 10vw, 76px)/1 var(--display); letter-spacing: -0.045em; }
.calc__lede { max-width: 32em; color: var(--muted); }

.calc__grid { margin-top: 36px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }

/* ---------- form ---------- */
.calc__form { display: grid; gap: 20px; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label { display: block; padding: 0; margin-bottom: 8px; font: 700 12.5px/1.3 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field__input {
  width: 100%; height: 54px; padding: 0 16px; border: 1px solid #CFC6EA; border-radius: 14px;
  background: var(--bg); color: var(--ink); font: 600 18px/1 var(--body); color-scheme: light;
  -webkit-appearance: none; appearance: none;
}
.field__input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.field__input[aria-invalid="true"] { border-color: #B3261E; }
.field__money { position: relative; }
.field__cur { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font: 600 18px/1 var(--body); color: var(--muted); pointer-events: none; }
.field__money .field__input { padding-left: 34px; }
.field__select { cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field__err { margin-top: 6px; font-size: 14px; font-weight: 600; color: #B3261E; }
.field__err:empty { display: none; }

.seg { display: block; background: none; border-radius: 0; padding: 0; max-width: none; }
.seg__row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--wash); border-radius: 999px; padding: 4px; }
.seg__opt { position: relative; display: block; cursor: pointer; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg__opt span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 10px; border-radius: 999px; text-align: center; font: 600 15px/1.2 var(--body); color: var(--muted); }
.seg__opt input:checked + span { background: var(--ink); color: var(--bg); }
.seg__opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- results ---------- */
.calc__out { padding: 24px 20px 26px; border-radius: 24px; background: var(--wash); min-width: 0; }
.calc__out-h { font: 800 clamp(26px, 6.6vw, 36px)/1.08 var(--display); letter-spacing: -0.03em; scroll-margin-top: 90px; }
.calc__summary { margin-top: 10px; font-size: 15px; color: var(--muted); }

.calc__next { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 16px; border-radius: 18px; background: var(--bg); }
.calc__next[hidden] { display: none; }
.calc__next .tick { --tw: 112px; }
.calc__next .belly.three { font-size: calc(var(--tw) * .12); }
.calc__next-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.calc__next-t b { font: 800 19px/1.2 var(--display); letter-spacing: -0.02em; }
.calc__next-t span { font-size: 15px; color: var(--muted); }
.calc__next-t i { font-style: normal; font-size: 15px; font-weight: 600; color: var(--accent); }

.sched { width: 100%; margin-top: 20px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sched th, .sched td { padding: 14px 0; text-align: left; font-weight: 400; border-bottom: 1px solid #D5CBF0; vertical-align: middle; }
.sched thead th { padding: 0 0 10px; font: 700 11.5px/1 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sched tbody th { font-weight: 600; color: var(--muted); font-size: 14px; white-space: nowrap; padding-right: 10px; }
.sched tbody td { font-size: 15px; font-weight: 600; }
.sched .sched__amt { text-align: right; font-weight: 700; white-space: nowrap; padding-left: 10px; }
.sched tfoot th, .sched tfoot td { border-bottom: 0; padding-top: 18px; font-weight: 800; font-size: 20px; color: var(--ink); }
.sched__hol { display: inline-block; margin-left: 4px; font: 700 10.5px/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.sched[hidden] { display: none; }

.calc__note { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.calc__note--est { color: var(--ink); font-weight: 600; }
.calc__print { margin-top: 22px; width: 100%; }

/* ---------- holiday callout ---------- */
.holiday { margin-top: 64px; padding: 36px 0; border-top: 2px solid var(--ink); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.holiday__title { max-width: 18em; font: 800 clamp(28px, 7.4vw, 48px)/1.05 var(--display); letter-spacing: -0.035em; }
.holiday__body { color: var(--muted); }
.holiday__go { margin-top: 6px; }

/* ---------- Duezo mention ---------- */
.duezo { margin-top: 28px; padding: 36px 22px; border-radius: 28px; background: var(--d-bg); color: var(--d-fg); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.duezo__title { font: 800 clamp(28px, 7.4vw, 48px)/1.05 var(--display); letter-spacing: -0.035em; }
.duezo__body { color: var(--d-muted); }
.duezo .badge { margin-top: 8px; }
.duezo .badge img { height: 52px; width: auto; }

/* ---------- how it works ---------- */
.how { margin-top: 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.how__title { font: 800 clamp(26px, 6.6vw, 36px)/1.08 var(--display); letter-spacing: -0.03em; }
.how__body { max-width: 40em; }
.how__body p { font-size: 16px; line-height: 1.65; color: var(--muted); }
.how__body p + p { margin-top: 14px; }
.how__body strong { color: var(--ink); font-weight: 700; }

@media (min-width: 900px) {
  .pcalc { padding-top: 56px; padding-bottom: 112px; }
  .calc__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; margin-top: 48px; }
  .calc__out { padding: 32px 34px 34px; }
  .calc__next .tick { --tw: 132px; }
  .sched tbody td { font-size: 17px; }
  .sched tbody th { font-size: 15px; }
  .calc__print { width: auto; }
  .holiday { margin-top: 96px; padding: 48px 0; }
  .duezo { padding: 56px 48px; }
  .how { margin-top: 96px; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; }
}
@media (max-width: 400px) {
  .sched tbody th { padding-right: 8px; }
  .sched__hol { display: block; margin: 4px 0 0; }
}

/* ---------- printable tracker ---------- */
@media print {
  @page { size: auto; margin: 16mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body { font-size: 12pt; }
  body::before { display: none; }
  .top, .skip, .no-print, .calc__head, .calc__form { display: none !important; }
  .print-only { display: revert; }
  .pcalc { padding: 0; max-width: none; }
  .calc__grid { display: block; margin: 0; }
  .calc__out { padding: 0; background: none; border-radius: 0; break-inside: avoid; }
  .print-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 2px solid #000; margin-bottom: 18px; }
  .print-head img { width: 90px; height: auto; }
  .print-head__k { font: 600 10pt/1 "Sora", sans-serif; letter-spacing: 0.18em; text-transform: uppercase; }
  .calc__out-h { font-size: 22pt; color: #000; }
  .calc__summary { color: #000; font-size: 11pt; }
  .print-fill { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; font-size: 11pt; }
  .print-fill p { display: flex; gap: 8px; align-items: baseline; }
  .print-fill span { flex: 1; border-bottom: 1px solid #000; }
  .sched { margin-top: 18px; }
  .sched th, .sched td { color: #000 !important; border-bottom: 1px solid #999; padding: 12pt 0; font-size: 12pt; }
  .sched thead th { padding: 0 0 6pt; font-size: 8pt; border-bottom: 2px solid #000; }
  .sched tfoot th, .sched tfoot td { font-size: 13pt; border-bottom: 0; }
  .sched__tick { width: 34pt; }
  .box { display: inline-block; width: 14pt; height: 14pt; border: 1.5pt solid #000; border-radius: 2pt; vertical-align: middle; }
  .sched__hol { color: #000; }
  .calc__note { color: #000 !important; font-size: 10pt; }
  .print-foot { margin-top: 24px; padding-top: 8px; border-top: 1px solid #999; font-size: 9pt; color: #444; }
}
