/* Zakat Calculator: the parts only this page has, on top of frame.css (#329). From the approved prototype
   (zakat/page.css), rules unchanged. The sums are the site's own zakat.js; this file only places and colours them. */

/* ---------- Stage: the answer ---------- */
h1.stage-kicker { font-weight: 600; }
.zakat-label { margin: 10px 0 4px; font-size: 1rem; font-weight: 400; color: var(--date); }
.now-name { display: block; font-variant-numeric: tabular-nums; }
.verdict { margin: 10px 0 0; min-height: 1.45em; }
.verdict.below { color: var(--blue); }
.verdict.check { color: var(--gold); }

.zakat-lines { margin-top: 22px; font-variant-numeric: tabular-nums; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 1.05rem; }
.line span { color: var(--date); }
.line.total { border-top: 1px solid var(--track); margin-top: 6px; padding-top: 14px; font-weight: 700; }
.line.total span { color: var(--white); }

.pay {
  width: 100%; min-height: 52px; margin-top: 20px; border: 0; border-radius: 999px;
  background: var(--gold); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
}
/* The pay button is a link to the chosen charity's page (#329): it keeps the button's look. */
a.pay { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.pay-note { margin: 10px 0 0; text-align: center; font-size: 0.82rem; color: var(--date); }

/* ---------- Sheet: the form ---------- */
.stage-intro { margin: 18px 0 0; max-width: 62ch; }
#zakat-form .block:first-child { border-top: 0; }
.field { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.field:first-of-type { border-top: 0; }
.field small { display: block; margin-top: 2px; font-size: 0.82rem; color: var(--muted); }
.money { position: relative; }
.money span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 0.95rem; color: var(--muted); pointer-events: none; }
.money input, .field select {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--white);
  font: inherit; font-variant-numeric: tabular-nums; color: var(--ink); padding: 10px 14px 10px 52px; text-align: right;
}
.field select { padding-left: 14px; text-align: left; cursor: pointer; }
/* The site's error red, as on the live calculator. */
.money input[aria-invalid="true"] { border-color: #b3261e; }
.err { grid-column: 2; margin: -6px 0 0; font-size: 0.82rem; color: #b3261e; }
.err:empty { display: none; }

.seg-set { border: 0; padding: 0; margin: 0 0 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--gold); border-radius: 8px; overflow: hidden; }
.seg label { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 8px; background: var(--white); color: var(--muted); text-align: center; cursor: pointer; }
.seg label + label { border-left: 2px solid var(--gold); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { font-weight: 700; color: var(--ink); }
.seg label:has(input:checked) { background: var(--gold); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--purple); outline-offset: -4px; }

.reset { min-height: var(--tap); margin-top: 8px; padding: 10px 0; border: 0; background: none; color: var(--purple); font: inherit; font-size: 0.9rem; font-weight: 600; text-decoration: underline; cursor: pointer; }
.notes { margin: 0; padding-left: 18px; font-size: 0.9rem; line-height: 1.6; color: var(--muted); }
.notes li + li { margin-top: 6px; }

/* ---------- Phones: the answer stays above the bottom bar ---------- */
.owed-bar {
  position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px var(--gutter); background: var(--ink); color: var(--white);
}
.owed-bar output { margin-left: 6px; font-size: 1.3rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.owed-bar a { display: inline-flex; align-items: center; min-height: var(--tap); font-size: 0.9rem; font-weight: 600; }
.sheet { padding-bottom: 96px; }

@media (max-width: 640px) {
  .field { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .err { grid-column: 1; }
}
@media (min-width: 900px) {
  /* The sky side stays in view, so the bar is not needed. */
  .stage-in { position: sticky; top: 0; }
  .owed-bar { display: none; }
  .sheet { padding-bottom: 40px; }
}
