/* MineIt buyer form — mobile-first, mirrors the prototype's BuyerFormPreview */
:root {
  --bg: #0F172A; --card: #1E293B; --border: #334155; --text: #F1F5F9; --muted: #94A3B8;
  --primary: #22C55E; --accent: #10B981; --warn: #EAB308; --danger: #EF4444;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%; }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.muted { color: var(--muted); }

/* Header */
.header { background: linear-gradient(135deg, var(--primary), var(--accent)); padding: 24px 20px 28px; text-align: center; color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 12px; font-weight: 600; opacity: .9; }
.badge .m { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; }
.header h1 { font-size: 18px; font-weight: 700; margin: 0; }
.header p { font-size: 12px; margin: 4px 0 0; opacity: .8; }

.content { padding: 16px; flex: 1; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.card-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.item:last-of-type { border-bottom: none; }
.item .code { font-weight: 600; }
.total { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 2px solid rgba(34,197,94,.25); }
.total .label { font-size: 14px; font-weight: 700; }
.total .amount { font-size: 18px; font-weight: 800; color: var(--primary); }

.notice { border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; display: flex; gap: 8px; align-items: flex-start; }
.notice.welcome { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.25); }
.notice.deadline { background: rgba(234,179,8,.08); border: 1px solid rgba(234,179,8,.25); }
.notice .icon { font-size: 16px; line-height: 1.3; }
.notice .title { font-size: 13px; font-weight: 700; }
.notice.welcome .title { color: var(--primary); }
.notice.deadline .title { color: var(--warn); }
.notice .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Fields — 16px inputs stop iOS from zooming on focus */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field label .req { color: var(--primary); }
.field input, .field textarea { width: 100%; padding: 12px; font-size: 16px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; outline: none; font-family: inherit; }
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field .error { display: none; font-size: 12px; color: var(--danger); margin-top: 5px; }
.field.invalid .error { display: block; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--card);
  border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-family: inherit; }
.pill[aria-pressed="true"] { background: rgba(34,197,94,.15); border-color: var(--primary); color: var(--primary); }

.submit { width: 100%; padding: 15px 0; border-radius: 11px; font-size: 16px; font-weight: 700; border: none; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 4px 16px rgba(34,197,94,.25); cursor: pointer; font-family: inherit; }
.submit[disabled] { background: var(--border); color: #64748B; box-shadow: none; cursor: not-allowed; }
.send-error { display: none; margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.35); color: #FCA5A5; font-size: 13px; }
.send-error.show { display: block; }
.footer { text-align: center; font-size: 11px; color: var(--muted); margin-top: 18px; padding-bottom: 8px; }

/* Full-page states (invalid / expired / success) — same shell as the form */
.state-card { text-align: center; padding: 24px 18px 20px; }
.state-card .glyph { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; }
.state-card .glyph svg { width: 32px; height: 32px; }
.state-card.ok .glyph { background: rgba(34,197,94,.15); color: var(--primary); }
.state-card.bad .glyph { background: rgba(234,179,8,.15); color: var(--warn); }
.state-card h2 { font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.state-card p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }
.state-card p.small { font-size: 12px; margin-top: 12px; }
.steps { list-style: none; padding: 0; margin: 18px 0 0; text-align: left; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; line-height: 1.5; }
.steps li:last-child { border-bottom: 1px solid var(--border); }
.steps .n { flex: 0 0 24px; height: 24px; border-radius: 50%; background: rgba(34,197,94,.15); color: var(--primary); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 24px; min-height: 60vh; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.noscript { padding: 24px; text-align: center; color: var(--muted); }

/* Payment instructions shown once a method is chosen — display only; MineIt
   never processes payments (Brief 3.5). */
#payment-other { width: 100%; }
.pay-hint { display: none; margin-top: 10px; padding: 10px 12px; border-radius: 9px; background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.25); font-size: 13px; color: var(--text); }
.pay-hint.show { display: block; }
.pay-hint .num { font-weight: 700; color: var(--primary); font-size: 15px; letter-spacing: .3px; }
.pay-hint .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Wider screens: a centred card, short fields side by side. Mobile stays
   single-column and edge-to-edge. */
@media (min-width: 720px) {
  body { padding: 24px 16px; }
  .app { max-width: 760px; min-height: auto; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
  .header { padding: 28px 24px 32px; }
  .header h1 { font-size: 22px; }
  .header p { font-size: 13px; }
  .content { padding: 24px; }
  .fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .fields .field.wide { grid-column: 1 / -1; }
  .state-card { padding: 32px 28px 24px; }
}
.dev-badge { position: fixed; top: 8px; right: 8px; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--warn); color: #0F172A; }
