/* Tip Platform — donation page stylesheet.
   No frameworks. No build step. Dark theme with a subtle gridded backdrop,
   matching the visual language of the KickBot page the operator screenshotted
   as reference, but lighter-weight.

   COLOR / SURFACE / GEOMETRY TOKENS LIVE IN brand.css (loaded BEFORE this
   file by tip.html and thanks.html). Do not redefine :root tokens here —
   per-brand accent comes from `body.brand-<id>` blocks in brand.css. See
   AGENTS.md PINNED RULE #3 ("Central brand tokens are non-negotiable").
*/

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px;
  background-position: -1px -1px;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* ---- Test-mode banner ---- */
.test-banner {
  background: #3b2e12;
  color: #ffd27a;
  border-bottom: 1px solid #5a4818;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.test-banner code {
  background: rgba(255, 210, 122, 0.14);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- Layout ---- */
.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .summary-col { position: static !important; }
}

.form-col > * + * { margin-top: 18px; }

/* ---- Stream header ---- */
.stream-head {
  display: flex;
  gap: 14px;
  padding: 6px 4px 14px;
  border-bottom: 1px solid var(--panel-stroke);
  margin-bottom: 8px;
}
.stream-head__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f2a36 0%, #111821 100%);
  border: 1px solid var(--panel-stroke-strong);
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stream-head h1 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.stream-head__desc { margin: 0; color: var(--text-muted); font-size: 14px; }
.stream-head__handle { margin: 4px 0 0; color: var(--accent); font-size: 13px; }

/* ---- Cards / fieldsets ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  margin: 0;
}
fieldset.card { min-width: 0; }  /* prevents overflow inside the flex column */
legend {
  padding: 0 4px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 15px;
  color: var(--text);
}
.muted { color: var(--text-muted); font-weight: 400; font-size: 13px; }

/* ---- Amount ---- */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.amount-pill {
  display: block;
  text-align: center;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-stroke);
  background: var(--panel-2);
  cursor: pointer;
  transition: all 120ms ease;
  user-select: none;
}
.amount-pill:hover { background: var(--panel-hover); }
.amount-pill input { position: absolute; opacity: 0; pointer-events: none; }
.amount-pill span { font-weight: 600; font-size: 15px; color: var(--text); }
.amount-pill.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.amount-pill.is-active span { color: var(--accent); }

.field { display: block; }
.field__label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field__input-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  padding: 0 12px;
}
.field__prefix { color: var(--text-muted); margin-right: 6px; }
.field__input-row input {
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 15px;
  flex: 1;
  padding: 10px 0;
  outline: none;
  font-family: inherit;
}

/* ---- Text inputs & textareas ---- */
.card input[type="text"],
.card textarea {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  margin-top: 10px;
  outline: none;
  resize: vertical;
}
.card input[type="text"]:focus,
.card textarea:focus,
.field__input-row:focus-within {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--panel-stroke));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.char-counter {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ---- Model picker (multi-agent shows) ---- */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.model-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.model-card:hover { background: var(--panel-hover); }
.model-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.model-card__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.model-card__label {
  font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 0.5em;
}
.model-card__desc {
  font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.model-card__check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--panel-stroke-strong);
  flex-shrink: 0;
  position: relative;
  transition: all 120ms ease;
}
.model-card.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.model-card.is-active .model-card__check {
  background: var(--accent);
  border-color: var(--accent);
}
.model-card.is-active .model-card__check::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='none' stroke='%230b0f14' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6.5l2.5 2.5 4.5-5'/></svg>") center / 70% no-repeat;
}

/* ---- Voice grid ---- */
.voice-legend { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.disable-tts {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 13px; font-weight: 400;
  cursor: pointer;
}
.disable-tts input { accent-color: var(--accent); }

.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.voice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 10px;
  background: var(--panel-2);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.voice-card:hover { background: var(--panel-hover); }
.voice-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.voice-card__preview {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 50%;
  background: #0c141d;
  border: 1px solid var(--panel-stroke-strong);
  color: var(--text);
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background 120ms ease, border-color 120ms ease;
}
.voice-card__preview:hover {
  background: #0f1a25;
  border-color: var(--accent);
}
.voice-card__preview-icon { font-size: 12px; line-height: 1; }
.voice-card__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.voice-card__label { font-size: 14px; font-weight: 600; color: var(--text); }
.voice-card__desc {
  font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.voice-card__check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 1px solid var(--panel-stroke-strong);
  flex-shrink: 0;
  position: relative;
  transition: all 120ms ease;
}
.voice-card.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-2));
}
.voice-card.is-active .voice-card__check {
  background: var(--accent);
  border-color: var(--accent);
}
.voice-card.is-active .voice-card__check::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='none' stroke='%230b0f14' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6.5l2.5 2.5 4.5-5'/></svg>") center / 70% no-repeat;
}

/* ---- Right column ---- */
.summary-col {
  position: sticky; top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.summary h2, .checkout h2 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.summary dl { margin: 0; }
.summary dl > div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--panel-stroke);
  font-size: 14px;
}
.summary dl > div:first-child { border-top: 0; padding-top: 0; }
.summary dt { color: var(--text-muted); }
.summary dd { margin: 0; color: var(--text); font-weight: 600; }

.disclaimer {
  display: flex; gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  cursor: pointer;
}
.disclaimer input { accent-color: var(--accent); margin-top: 2px; }
.disclaimer strong, .disclaimer em { color: var(--text); }

.checkout-btn {
  width: 100%;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: filter 120ms ease, transform 120ms ease;
}
.checkout-btn:hover:not(:disabled) { filter: brightness(1.08); }
.checkout-btn:active:not(:disabled) { transform: translateY(1px); }
.checkout-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.checkout-error {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 60%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.pay-logos {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-stroke);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.pay-logos__stripe {
  text-transform: uppercase;
  font-weight: 700;
  color: #8f7fff;
  letter-spacing: 0.18em;
}
.pay-logos__cards { letter-spacing: 0.02em; }

/* ---- Thanks page ---- */
.thanks-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.thanks-panel {
  max-width: 480px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  border-radius: var(--radius);
  padding: 36px 28px;
}
.thanks-check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  margin: 0 auto 18px;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 700;
}
.thanks-panel h1 { margin: 0 0 8px; font-size: 22px; }
.thanks-panel p { margin: 6px 0; color: var(--text-muted); }
.thanks-panel a { color: var(--accent); }
