/* Crypto payment page — standalone stylesheet using the
   Buy 7OH Canada design system palette. */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #0a0f0e;
  --ink-2: #131b19;
  --paper: #ffffff;
  --paper-2: #f5f8f7;
  --paper-3: #eef3f1;
  --line: #e4eae7;
  --line-strong: #cfd9d5;
  --muted: #52605b;
  --muted-2: #86938d;
  --brand: #0f766e;
  --brand-600: #0d9488;
  --brand-800: #115e59;
  --brand-900: #0b3f3b;
  --brand-ink: #063b36;
  --brand-soft: #d8efea;
  --brand-soft-2: #eef7f4;
  --brand-line: #bfe0d9;
  --danger: #b3261e;
  --ok: #0f9d6b;
  --warn: #b45309;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(10, 15, 14, 0.05), 0 2px 8px rgba(10, 15, 14, 0.04);
  --shadow: 0 12px 34px rgba(10, 15, 14, 0.08);
  --ring: 0 0 0 3px var(--brand-soft);
}

* { box-sizing: border-box; }

/* `hidden` must always beat class display rules. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--paper-2);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }

/* ---------- header ---------- */
.top {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.top__logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); font-weight: 800; }
.top__logo img { height: 30px; width: auto; }
.top__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--brand-ink);
  background: var(--brand-soft-2);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  letter-spacing: 0.04em;
}
.top__spacer { flex: 1; }

.badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--brand-soft);
  color: var(--brand-ink);
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

/* ---------- layout ---------- */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 4rem;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 1.8rem);
  align-items: start;
}
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; margin: 0 0 0.35rem; }
.sub { color: var(--muted); margin: 0 0 1.6rem; max-width: 46rem; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.1rem, 3vw, 1.6rem);
}
.card + .card { margin-top: 1.2rem; }
.card h2 { font-size: 1.05rem; margin: 0 0 0.9rem; }

/* ---------- banners ---------- */
.banner {
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  margin-bottom: 1.2rem;
  border: 1px solid;
}
.banner--setup { background: #fdf3e7; border-color: #f0d9bb; color: var(--warn); }
.banner code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
}

/* ---------- form ---------- */
.field { margin-bottom: 1.05rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pill {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill:hover { border-color: var(--brand-600); }
.pill--on {
  background: var(--brand-800);
  border-color: var(--brand-800);
  color: #fff;
}
.hint { font-size: 0.8rem; color: var(--muted-2); margin-top: 0.35rem; min-height: 1.1em; }

select, input[type='text'], input[type='number'], input[inputmode='decimal'] {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  outline: none;
}
select:focus, input:focus { border-color: var(--brand-600); box-shadow: var(--ring); }

.amount-row { display: flex; align-items: stretch; }
.amount-row input { border-radius: var(--radius) 0 0 var(--radius); border-right: 0; flex: 1; }
.amount-suffix {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--brand-ink);
  background: var(--brand-soft-2);
  border: 1px solid var(--line-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0 0.9rem;
}

.note { font-size: 0.85rem; color: var(--warn); margin: -0.4rem 0 0.9rem; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: var(--brand-800);
  color: #fff;
}
.btn--primary:hover { background: var(--brand-900); }
.btn--primary:disabled { background: var(--muted-2); cursor: not-allowed; }
.btn--ghost {
  padding: 0.45rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  font-size: 0.88rem;
}
.btn--ghost:hover { border-color: var(--brand-600); color: var(--brand-ink); }
.btn--mini { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* ---------- wallet picker ---------- */
.wallet-picker {
  margin-top: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.wallet-choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.wallet-choice:hover { background: var(--brand-soft-2); }
.wallet-choice img { width: 22px; height: 22px; border-radius: 5px; }

/* ---------- status ---------- */
.status {
  margin-top: 1rem;
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
  border: 1px solid;
  word-break: break-word;
  scroll-margin: 90px;
  animation: status-in 0.25s ease-out;
}
@keyframes status-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.status--info { background: var(--brand-soft-2); border-color: var(--brand-line); color: var(--brand-ink); }
.status--ok { background: #e9f8f1; border-color: #bfe8d4; color: #0b6b48; }
.status--warn { background: #fdf3e7; border-color: #f0d9bb; color: var(--warn); }
.status--error { background: #fdecea; border-color: #f2c4c0; color: var(--danger); }

/* ---------- manual pay / address ---------- */
.addr {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  word-break: break-all;
  margin: 0.5rem 0 0.7rem;
}
.chains-note { font-size: 0.82rem; color: var(--muted); }

/* ---------- steps ---------- */
.steps { margin: 0; padding: 0 0 0 1.1rem; font-size: 0.9rem; color: var(--muted); }
.steps li { margin-bottom: 0.45rem; }
.steps b { color: var(--ink-2); }

/* ---------- history ---------- */
#historyList { list-style: none; margin: 0; padding: 0; }
#historyList li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
#historyList li:last-child { border-bottom: 0; }
.h-when { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-2); }
.h-what { font-weight: 600; flex: 1; }
.h-link { font-size: 0.82rem; text-decoration: none; font-weight: 600; }
.h-confirmed { color: var(--ok); }
.h-pending { color: var(--warn); }
.h-failed { color: var(--danger); }

/* ---------- footer ---------- */
.foot {
  margin-top: 2.5rem;
  font-size: 0.8rem;
  color: var(--muted-2);
  text-align: center;
}

/* ---------- spinner ---------- */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 0.55rem;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- wallet app deep links (mobile) ---------- */
.wallet-apps-label { display: block; margin-top: 0.5rem; font-weight: 700; }
.wallet-apps { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.55rem; }
.wallet-app {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}
.wallet-app:active { background: var(--brand-soft-2); }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .top { padding: 0.7rem 1rem; }
  .top__tag { display: none; }

  /* room for the fixed pay bar */
  .wrap { padding-bottom: 7.5rem; }

  /* thumb-friendly targets */
  .pill { padding: 0.6rem 1.1rem; font-size: 0.92rem; }
  select, input[type='text'], input[inputmode='decimal'] { padding: 0.8rem 0.9rem; }
  .btn--ghost { min-height: 44px; }
  .amount-row input { font-size: 1.15rem; }

  /* the pay button lives in a fixed bottom bar, always in the thumb zone */
  .pay-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .pay-cta .btn--primary { padding: 0.95rem 1.2rem; font-size: 1.05rem; }
}
