/* ============================================================================
   niswosakit · checkout.css — styling for the shared on-page checkout modal
   (the Stripe Payment Element modal + custom keypad built by checkout.js).

   This is the portable companion to checkout.js. The /vote pages carry these
   same rules inside their own styles.css and do NOT load this file; every
   OTHER page gets the modal styling from here (loaded by support.js when it
   wires up Stripe), so the checkout looks identical everywhere.

   The modal renders in its own warm-card theme, scoped to the overlay roots,
   so it reads correctly whether the host page is dark (methodology, sources,
   how) or light. It never inherits — or disturbs — the host page's palette.
   Faithful copy of the approved /vote modal (Website/Pages/vote/styles.css).
   ============================================================================ */

/* lock the page behind any full-screen payment/support overlay */
html.no-scroll { overflow: hidden; }

/* the checkout's own palette, scoped to the overlay roots only, so it never inherits
   or disturbs the host page. It FOLLOWS the theme: a true-black card by default (the
   site default is dark) and a clean cool-neutral card in light mode. No cream.
   Scale/space/ease come from brand.css. */
.co-overlay, .pad-overlay {
  --surface:   #161618;   /* raised card (black) */
  --ink:       #FAF9F7;   /* the modal's text */
  --bg:        #18191A;   /* the modal's own ground (button text, keypad ground) */
  --muted:     #9A968C;
  --line:      rgba(250,249,247,.14);
  --accent:    #FAF9F7;   /* error/emphasis: mono (matches ink), no color in the modal */
  --radius-lg: 26px;
}
/* light mode: a clean neutral card (deliberately NO cream/paper) */
:root[data-theme="light"] .co-overlay,
:root[data-theme="light"] .pad-overlay {
  --surface:   #FFFFFF;   /* raised card (clean white) */
  --ink:       #18181B;   /* near-black text */
  --bg:        #F4F4F5;   /* the modal's own ground */
  --muted:     #71717A;
  --line:      #E4E4E7;
  --accent:    #18181B;   /* error/emphasis: mono (matches ink), no color in the modal */
}

/* --------------------------------------------- custom checkout modal (Stripe Element) */
.co-overlay {
  /* above the support overlay (z-index 120) so the checkout opens in front of
     it, then closing returns to the support view — same as /vote's infooter. */
  position: fixed; inset: 0; z-index: 130;
  display: grid; place-items: center; padding: var(--space-3, 1rem);
  background: color-mix(in srgb, #000 55%, transparent);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: co-fade .18s var(--ease, cubic-bezier(.2,.7,.2,1));
}
@keyframes co-fade { from { opacity: 0; } }
.co-modal {
  position: relative; width: min(30rem, 100%); max-height: 92dvh; overflow-y: auto;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(var(--space-4, 1.5rem), 5vw, var(--space-5, 2.5rem));
  box-shadow: 0 30px 70px color-mix(in srgb, #000 35%, transparent);
}
.co-close {
  position: absolute; top: var(--space-3, 1rem); right: var(--space-3, 1rem);
  width: 2rem; height: 2rem; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1;
}
.co-close:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.co-eyebrow { color: var(--muted); font-size: var(--step--1); text-transform: uppercase; letter-spacing: .06em; }
.co-amount { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.02em; margin: var(--space-1) 0 var(--space-4); }
.co-element { margin-bottom: var(--space-3); min-height: 3rem; }
.co-err { color: var(--accent); font-size: var(--step--1); min-height: 1.2em; margin-bottom: var(--space-2); }
.co-pay {
  width: 100%; font: inherit; font-weight: 700; font-size: var(--step-0);
  background: var(--ink); color: var(--bg); border: 0; border-radius: 999px;
  padding: .95em 1.2em; cursor: pointer; transition: transform .15s var(--ease), opacity .15s;
}
.co-pay:hover { transform: translateY(-1px); }
.co-pay:disabled { opacity: .6; cursor: default; transform: none; }
.co-secure { text-align: center; color: var(--muted); font-size: var(--step--1); margin-top: var(--space-3); }
/* assent line above the Contribute button (held: local preview only, see checkout.js) */
.co-assent { color: var(--muted); font-size: var(--step--1); line-height: 1.45; margin-bottom: var(--space-3); }
.co-assent a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
/* local preview stand-in for Stripe's card fields (localhost only) */
.co-preview {
  display: grid; place-items: center; min-height: 9rem; padding: var(--space-3);
  border: 1px dashed var(--line); border-radius: var(--radius-md, .75rem);
  color: var(--muted); font-size: var(--step--1); text-align: center;
}

/* custom amount keypad (full-screen, Cash App style) -> then the card modal */
.pad-overlay {
  position: fixed; inset: 0; z-index: 140;
  background: var(--bg); color: var(--ink);
  animation: co-fade .18s var(--ease);
}
.pad {
  display: flex; flex-direction: column; height: 100%;
  width: min(28rem, 100%); margin-inline: auto;
  padding: max(var(--space-3), env(safe-area-inset-top)) var(--space-4) max(var(--space-4), env(safe-area-inset-bottom));
}
.pad__top { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; }
.pad__back {
  flex: none; width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  background: transparent; border: 0; color: var(--ink); cursor: pointer; border-radius: 50%;
}
.pad__back:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.pad__label { font-size: var(--step--1); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pad__amount {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  font-weight: 500; letter-spacing: -0.03em; font-size: clamp(3rem, 14vw, 5rem); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pad__keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.pad__key {
  font: inherit; font-size: 1.55rem; font-weight: 500; color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, transparent); border: 0; border-radius: 999px;
  padding: .6em 0; cursor: pointer; display: grid; place-items: center;
  transition: background .12s var(--ease);
}
.pad__key:active { background: color-mix(in srgb, var(--ink) 15%, transparent); }
.pad__err { min-height: 1.2em; text-align: center; color: var(--accent); font-size: var(--step--1); margin: var(--space-2) 0 0; }
.pad__pay {
  margin-top: var(--space-2); width: 100%; font: inherit; font-weight: 700; font-size: var(--step-0);
  background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; padding: .95em 1.2em; cursor: pointer;
  transition: transform .15s var(--ease);
}
.pad__pay:hover { transform: translateY(-1px); }
.pad__hint { text-align: center; color: var(--muted); font-size: var(--step--1); margin: var(--space-3) 0 0; }
