/* ------------------------------------------------------------------------
   Plant a Tree — checkout.plantatree.es
   Palette: canopy #1F3B2C · moss #5B8C5A · bark #6B4A34 · paper #F6F2E7 · clay #B4623E
   Type: "Fraunces" (display, used sparingly) + "Work Sans" (body/UI)
   ------------------------------------------------------------------------ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  --canopy: #1f3b2c;
  --canopy-dark: #142719;
  --moss: #5b8c5a;
  --moss-light: #8fb389;
  --bark: #6b4a34;
  --paper: #f6f2e7;
  --paper-dim: #ece5d4;
  --clay: #b4623e;
  --ink: #20261f;
  --ink-soft: #4d5a48;
  --line: #d9d0ba;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', system-ui, -apple-system, sans-serif;

  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--canopy);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(91, 140, 90, 0.35), transparent 55%),
    radial-gradient(circle at 85% 100%, rgba(180, 98, 62, 0.18), transparent 50%);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* -- header --------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  color: var(--paper);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--paper);
}

.brand-mark { font-size: 1.35rem; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.secure-note {
  font-size: 0.8rem;
  color: var(--moss-light);
  letter-spacing: 0.03em;
}

/* -- layout ----------------------------------------------------------- */

.checkout {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 720px) {
  .checkout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.45);
}

.panel h1, .panel h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--canopy-dark);
}

.panel h1 { font-size: 1.4rem; }
.panel h2 { font-size: 1.25rem; }

/* -- order summary ------------------------------------------------------ */

.order-lines {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  border-top: 1px solid var(--line);
}

.order-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.order-line__qty { color: var(--ink-soft); }
.order-line__price { font-variant-numeric: tabular-nums; font-weight: 500; }

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 2px solid var(--canopy-dark);
}

.order-total dt {
  font-weight: 500;
  color: var(--ink-soft);
}

.order-total dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--canopy-dark);
}

.order-ref {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.order-ref code {
  background: var(--paper-dim);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

/* -- payment panel ------------------------------------------------------ */

.payment-explainer {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.payment-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--paper-dim);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-soft);
  flex: none;
  position: relative;
}

.status-dot[data-state="idle"]    { background: var(--ink-soft); }
.status-dot[data-state="working"] { background: var(--clay); animation: pulse 1.1s ease-in-out infinite; }
.status-dot[data-state="success"] { background: var(--moss); }
.status-dot[data-state="error"]   { background: var(--clay); }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.6); opacity: 0.45; }
}

.status-text { color: var(--ink); }

.btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--moss-light); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--canopy-dark);
  color: var(--paper);
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }

.payment-fineprint {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--clay);
}

.payment-fineprint a {
  color: inherit;
  font-weight: 600;
}

/* -- footer --------------------------------------------------------- */

.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--moss-light);
  font-size: 0.78rem;
}

@media (prefers-reduced-motion: reduce) {
  .status-dot[data-state="working"] { animation: none; }
}