*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --surface: #f8f9fb;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #0f172a;
  --success: #059669;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --radius: 12px;
  --font:
    "DM Sans",
    system-ui,
    -apple-system,
    sans-serif;
  --header-h: 4rem;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  min-width: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.site-main {
  flex: 1;
  min-width: 0;
  padding: clamp(2rem, 5vw, 3.5rem) 0 4rem;
}

/* Wide column: card + Apple Pay row needs horizontal room to avoid inner horizontal scroll. */
.page-checkout .container {
  max-width: min(100%, 60rem);
}

.page-checkout-split .container {
  max-width: min(100%, 72rem);
}

.page-intro--split {
  margin-bottom: 1.5rem;
}

.checkout-split {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.checkout-split__aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.checkout-split .card p.checkout-split__muted {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.checkout-split__pay {
  min-width: 0;
  width: 100%;
}

.checkout-split__pay .checkout-panel {
  max-width: 100%;
}

@media (min-width: 900px) {
  /* Wider payment column than ~34rem so Stream’s card + Apple Pay row fits without inner horizontal scroll. */
  .checkout-split {
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }

  .checkout-split__pay {
    justify-self: stretch;
    width: 100%;
    max-width: none;
  }
}

.page-intro {
  margin-bottom: 2rem;
}

.page-intro h1,
.page-result h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.page-result h1 {
  margin-bottom: 0.75rem;
}

.page-checkout .lead {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 36ch;
}

.page-result .lead {
  margin: 0 0 2rem;
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 38ch;
}

.checkout-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  /* Height comes from the embed iframe (fluid clamp + stream:resize). */
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
}

#stream-checkout {
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

#stream-checkout .stream-embed-container {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.status svg {
  flex-shrink: 0;
}

.status--success {
  color: var(--success);
  background: var(--success-bg);
}

.status--danger {
  color: var(--danger);
  background: var(--danger-bg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--text);
  border-radius: 8px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  opacity: 0.92;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  margin-top: auto;
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
}

.footer-links a {
  color: var(--muted);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: none;
}
