/* hosting/public/pay/pay.css
 *
 * The pay page's own layout: under the shopfront awning (/shared/base.css),
 * the band with Balad's word, the store and the amount on the plaster wall,
 * then one plain page, no cards. On a wide screen the band becomes the start
 * half. Needs
 * /shared/base.css and /shared/card-sheet.css.
 */

/* ── Shell: the band, then the page ──────────────────────────────────── */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.band {
  color: var(--ink);
  padding: calc(env(safe-area-inset-top) + 12px) max(16px, env(safe-area-inset-right)) 30px max(16px, env(safe-area-inset-left));
}
.band-in { max-width: 480px; margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.word { display: block; height: 24px; width: auto; }

.langs {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px;
  background: rgba(127, 127, 127, 0.12);
}
.langs button {
  border: 0; background: transparent; color: var(--muted);
  font: 600 13px/1 "Nunito Sans", system-ui, sans-serif;
  min-width: 40px; min-height: 34px; padding: 0 10px; border-radius: 9px; cursor: pointer;
}
.langs button[lang="ar"] { font-family: "Alexandria", system-ui, sans-serif; }
.langs button[lang="he"] { font-family: "Rubik", system-ui, sans-serif; }
.langs button[aria-pressed="true"] { background: var(--surface); color: var(--clay-text); }

#hero { margin-top: 26px; }
#hero:empty { display: none; }
.store { display: flex; align-items: center; gap: 14px; }
.logo {
  flex: none; width: 56px; height: 56px; border-radius: 16px; object-fit: cover;
  background: #FFFFFF; box-shadow: 0 0 0 2px var(--surface), 0 6px 16px rgba(70, 26, 8, 0.18);
  display: grid; place-items: center; color: var(--clay-cta);
  font: 800 24px/1 "Nunito Sans", system-ui, sans-serif;
}
h1 {
  margin: 0; font-weight: 700; text-wrap: balance;
  font-size: clamp(25px, 6.6vw, 32px); line-height: 1.2; letter-spacing: -0.01em;
}
html[lang="en"] h1 { font-weight: 800; letter-spacing: -0.02em; }
.status {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  font-weight: 600; font-size: 16px; line-height: 1.35;
}
.status svg { flex: none; width: 20px; height: 20px; }
.price { display: flex; align-items: flex-end; gap: 12px; margin-top: 18px; }
.amount {
  font: 800 46px/0.95 var(--amount); letter-spacing: -0.03em;
  direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums;
}
.per { font-size: 14px; line-height: 1.35; color: var(--muted); padding-bottom: 3px; }

/* ── The page under the band ─────────────────────────────────────────── */
main {
  flex: 1; width: 100%; max-width: 512px; margin: 0 auto;
  padding: 28px max(16px, env(safe-area-inset-right)) calc(36px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.part + .part { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 30px; }

/* Segmented control: which way to pay. */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; margin: 0 0 22px; border-radius: 13px; background: var(--tint);
}
.seg button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  min-height: 42px; border-radius: 10px; font-weight: 600; font-size: 15px;
  transition: background-color .15s ease, color .15s ease;
}
.seg button[aria-checked="true"] {
  background: var(--seg-on); color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10), 0 0 0 0.5px rgba(16, 24, 40, 0.06);
}

/* Monthly or yearly: each option carries its price under its name. */
.seg.interval button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 54px; }
.interval-pick { margin: 0 0 22px; }
.interval-pick h2 { font-size: 16px; margin: 0 0 10px; }
.interval-pick .seg { margin-bottom: 8px; }
.seg.interval small { font-size: 13px; font-weight: 500; direction: ltr; unicode-bidi: isolate; }

/* "I agree to the terms": before any payment or saved card. */
.terms-row { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; font-size: 14.5px; line-height: 1.5; cursor: pointer; }
.terms-row input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--clay-cta); }
.terms-row a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* A chain member's plan, paid from the payer's page. */
.group-store + .group-store { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }

/* The renewal switch. */
.switch-row { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 22px; cursor: pointer; }
.switch-row b { display: block; font-weight: 600; font-size: 16px; line-height: 1.4; }
.switch-row small { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--muted); }
input.switch {
  -webkit-appearance: none; appearance: none; flex: none; margin: 1px 0 0;
  position: relative; width: 48px; height: 28px; border-radius: 14px;
  background: var(--switch-off); cursor: pointer; transition: background-color .2s ease;
}
input.switch::before {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform .2s cubic-bezier(.3, .7, .4, 1);
}
input.switch:checked { background: var(--clay-cta); }
input.switch:checked::before { transform: translateX(20px); }
html[dir="rtl"] input.switch:checked::before { transform: translateX(-20px); }

/* Bank transfer details. */
dl { margin: 0 0 22px; }
.row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.row:first-child { padding-top: 0; }
.row dt { color: var(--muted); }
.row dd { margin: 0; font-weight: 600; text-align: end; word-break: break-word; }
.row dd.num { font-family: var(--amount); direction: ltr; unicode-bidi: isolate; }
.ref-label { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.ref { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 22px; }
.ref code {
  font: 800 28px/1.1 var(--amount); letter-spacing: 0.08em; direction: ltr;
  font-variant-numeric: tabular-nums; word-break: break-all;
}

/* When the month starts: pay, go live, the month starts. Dots on one line. */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 18px; padding: 0; }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 10px; inset-inline-start: calc(50% + 15px); width: calc(100% - 30px);
  height: 2px; border-radius: 1px; background: var(--line);
}
.steps li.done:not(:last-child)::after { background: var(--clay-cta); }
.dot {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--field); background: var(--canvas);
  color: #FFFFFF;
}
.dot svg { width: 14px; height: 14px; stroke-width: 3; }
.done .dot { background: var(--clay-cta); border-color: var(--clay-cta); }
.now .dot { border-color: var(--clay-cta); box-shadow: 0 0 0 4px rgba(185, 89, 38, 0.16); }
.goal .dot { border-color: var(--clay-cta); }
.goal .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--clay-cta); }
.steps .label { margin-top: 10px; padding: 0 4px; font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.steps .now .label, .steps .done .label { color: var(--ink); font-weight: 600; }
.steps .goal .label { color: var(--clay-text); font-weight: 700; }
.steps-say { margin: 0 0 26px; font-size: 17px; font-weight: 600; text-wrap: pretty; }

/* What the plan includes. */
.includes { list-style: none; margin: 0; padding: 0; }
.includes li { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; font-size: 16px; }
.includes svg { flex: none; width: 20px; height: 20px; margin-top: 3px; color: var(--clay-text); }

/* A fact about the plan with its own mark: the card it renews from, free
   months from a coupon. */
/* A coupon code: typed in capitals, letters a little apart so it reads like
   the code in the ad. */
.field input.coupon-code { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.fact { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 16px; }
.fact > svg { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--muted); }
.fact.gift > svg { color: var(--clay-text); }
.fact b { display: block; font-weight: 600; font-size: 16px; line-height: 1.4; }
.fact small { display: block; margin-top: 2px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.fact small.warn { color: var(--warn); font-weight: 600; }
.fact .num { font-family: var(--amount); direction: ltr; unicode-bidi: isolate; }

/* Payments made: one line each, the amount at the end, the receipt under it. */
.payments { list-style: none; margin: 0; padding: 0; }
.payments li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: baseline;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.payments li:first-child { padding-top: 0; }
.payments .what { font-weight: 600; font-size: 15.5px; line-height: 1.4; }
.payments .how { grid-column: 1; font-size: 14px; color: var(--muted); line-height: 1.45; }
.payments .sum { font: 700 16px/1.3 var(--amount); direction: ltr; unicode-bidi: isolate; text-align: end; font-variant-numeric: tabular-nums; }
.payments .doc { grid-column: 2; justify-self: end; min-height: 32px; font-size: 14px; }
.payments .doc svg { width: 16px; height: 16px; }
.payments .num { font-family: var(--amount); direction: ltr; unicode-bidi: isolate; }
.payments .refund { grid-column: 1 / -1; color: var(--ok); font-weight: 600; }
.payments li.refunded .sum { text-decoration: line-through; opacity: 0.7; }

footer { margin-top: 44px; display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* Wide screens: the band is the start half, the page the other. */
@media (min-width: 960px) {
  .shell { flex-direction: row; }
  .band {
    position: sticky; top: 0; flex: 0 0 44%; height: calc(100vh - var(--awning-h)); height: calc(100dvh - var(--awning-h));
    padding: 36px 56px; display: flex;
  }
  .band-in { width: 100%; max-width: 420px; margin: 0; margin-inline-start: auto; display: flex; flex-direction: column; }
  #hero { margin-top: 16vh; }
  .word { height: 28px; }
  .logo { width: 64px; height: 64px; border-radius: 18px; }
  h1 { font-size: 38px; }
  .amount { font-size: 56px; }
  main { flex: 1; max-width: none; margin: 0; padding: calc(36px + 44px + 16vh) 64px 64px; }
  main > * { max-width: 440px; }
}
