:root {
  --bg:       #FBF7F0;  /* soft warm white            */
  --surface:  #FFFFFF;  /* card                       */
  --ink:      #1C1A17;  /* warm near-black text        */
  --muted:    #7A736A;  /* secondary text             */
  --hair:     #ECE5DA;  /* hairline borders           */
  --foam:     #F5E6C8;  /* pale beer cream            */
  --amber:    #E0A015;  /* beer accent                */
  --amber-deep:#C77F0A; /* pressed / gradient bottom  */
  --green:    #2E7D52;  /* success                    */
  --radius:   18px;
  --shadow:   0 1px 2px rgba(28,26,23,.04), 0 12px 32px -12px rgba(28,26,23,.18);
  --display:  "Fraunces", Georgia, "Times New Roman", serif;
  --sans:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* When embedded in the modal iframe, drop the page background so only the
   card shows through. The parent modal supplies the backdrop. */
body.embedded { background: transparent; padding: 0; }

.card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px 22px;
  position: relative;
}

/* --- beer-glass mark --- */
.brand { display: flex; justify-content: center; margin-bottom: 14px; }
.glass {
  position: relative;
  width: 34px; height: 40px;
  border: 2.5px solid var(--ink);
  border-top: none;
  border-radius: 4px 4px 7px 7px;
  background:
    linear-gradient(var(--amber), var(--amber-deep));
  overflow: hidden;
  transform: rotate(-6deg);
}
.glass::after { /* handle */
  content: "";
  position: absolute;
  right: -11px; top: 7px;
  width: 11px; height: 18px;
  border: 2.5px solid var(--ink);
  border-left: none;
  border-radius: 0 6px 6px 0;
}
.glass .foam {
  position: absolute;
  inset: 0 0 auto 0;
  height: 9px;
  background: var(--foam);
  border-bottom: 1px solid rgba(28,26,23,.12);
}

h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-align: center;
  margin: 0 0 8px;
}

.sub {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin: 0 auto 22px;
  max-width: 30ch;
}
.nowrap { white-space: nowrap; }

/* --- wallets --- */
.wallet { margin-bottom: 6px; }
#express-checkout { min-height: 4px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
}
.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--hair);
  flex: 1;
}

/* --- card form --- */
#payment-element { margin-bottom: 16px; }

.pay {
  position: relative;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  background: var(--amber-deep);
  transition: transform .08s ease, filter .15s ease;
  isolation: isolate;
}
.pay:disabled { opacity: .55; cursor: default; }
.pay:not(:disabled):hover { filter: brightness(1.04); }
.pay:not(:disabled):active { transform: translateY(1px); }

/* the "beer fill" — a foam-topped amber rising behind the label */
.pay-fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, var(--amber) 0%, var(--amber-deep) 100%);
}
.pay-fill::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: rgba(255,255,255,.55);
}
.pay-label { position: relative; }
.pay.busy .pay-label { opacity: .65; }

.status {
  min-height: 18px;
  margin: 12px 2px 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}
.status.error { color: #B23A2E; }

.trust {
  margin: 14px 0 2px;
  font-size: 11.5px;
  line-height: 1.4;
  text-align: center;
  color: var(--muted);
}

/* --- success --- */
.done { text-align: center; padding: 14px 0 6px; }
.done h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  margin: 10px 0 6px;
}
.done p { color: var(--muted); font-size: 14px; margin: 0; }
.done-close {
  margin-top: 18px;
  padding: 10px 22px;
  border: 1px solid var(--amber-deep);
  border-radius: 999px;
  background: transparent;
  color: var(--amber-deep);
  font: 600 14px/1 inherit;
  cursor: pointer;
}
.done-close:hover { background: var(--amber-deep); color: #fff; }
.done-close:active { transform: translateY(1px); }
.cheers {
  display: inline-block;
  width: 40px; height: 40px;
  background: linear-gradient(var(--amber), var(--amber-deep));
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  position: relative;
}
.cheers::after {
  content: "✓";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 20px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 2px; }
