/* ============================================================
   PEVYO DON — Design system (aligné sur pevyo.net)
   ============================================================ */

:root {
  --bg: #08080f;
  --surface: #12121f;
  --surface-2: #1a1a2c;
  --border: #26263f;
  --text: #f5f5fa;
  --text-dim: #9ca3af;
  --text-faint: #5b5b76;

  --blue: #3b82f6;
  --purple: #a855f7;
  --pink: #ec4899;
  --accent: linear-gradient(135deg, var(--blue), var(--purple), var(--pink));
  --accent-solid: #a855f7;

  --cta: #ff3468;
  --cta-hover: #ff5580;
  --yellow: #ffd23f;
  --green: #22c55e;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); }

img { max-width: 100%; display: block; }

/* ---------------- Test-mode ribbon (comme Stripe en mode test) ---------------- */
.test-ribbon {
  background: repeating-linear-gradient(45deg, #ffb020, #ffb020 10px, #1a1200 10px, #1a1200 20px);
  color: #1a1200;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 6px 10px;
}
.test-ribbon span {
  background: #08080f;
  color: #ffb020;
  padding: 3px 10px;
  border-radius: 100px;
}

/* ---------------- Shell ---------------- */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  cursor: pointer;
}
.nav-back:hover { color: var(--text); }

/* ---------------- Brand ---------------- */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 20px 0 30px;
  text-align: center;
}

.brand img { width: 64px; height: 64px; border-radius: 16px; }

.brand-word {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
  max-width: 380px;
  line-height: 1.5;
}

/* ---------------- Typography ---------------- */
h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.5;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 28px 0 12px;
}

/* ---------------- Impact cards ---------------- */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0;
}
.impact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}
.impact-card .n {
  font-size: 20px;
  font-weight: 800;
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.impact-card .l {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.3;
}

/* ---------------- Amount picker ---------------- */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.amount-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.amount-btn:hover { border-color: var(--accent-solid); }
.amount-btn.active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.custom-amount {
  position: relative;
  margin-bottom: 8px;
}
.custom-amount input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 16px 14px 30px;
  border-radius: var(--radius-sm);
}
.custom-amount input:focus { outline: none; border-color: var(--accent-solid); }
.custom-amount::before {
  content: '€';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-weight: 700;
}
.custom-amount.active input { border-color: var(--accent-solid); }

/* ---------------- Form ---------------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 600;
}

.field input, .field select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: border-color .15s ease;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent-solid); }

.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.field-error { font-size: 12px; color: var(--pink); margin-top: 6px; display: none; }
.field.error input { border-color: var(--pink); }
.field.error .field-error { display: block; }

/* ---------------- Buttons ---------------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; pointer-events: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }

.btn-row { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: 12px;
  margin: 22px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------------- Footer ---------------- */
.legal-links {
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 32px;
}
.legal-links a { color: var(--text-dim); text-decoration: underline; }

/* ============================================================
   CHECKOUT (imite l'apparence de Stripe Checkout)
   ============================================================ */
.checkout-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (min-width: 860px) {
  .checkout-wrap { flex-direction: row; min-height: 100dvh; }
}

.checkout-summary {
  background: var(--bg);
  padding: 40px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.checkout-summary .merchant {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
.checkout-summary .merchant img { width: 32px; height: 32px; border-radius: 8px; }
.checkout-summary .merchant span { font-size: 15px; font-weight: 700; color: var(--text-dim); }

.checkout-summary .label { font-size: 14px; color: var(--text-dim); margin-bottom: 6px; }
.checkout-summary .amount { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 28px; }

.line-item {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.line-item.total { border-top: 1.5px solid var(--border); font-weight: 700; }
.line-item .desc { color: var(--text-dim); }
.line-item.total .desc { color: var(--text); }

.checkout-form {
  background: #ffffff;
  color: #1a1a2c;
  flex: 1;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 860px) {
  .checkout-form { max-width: 460px; }
}

.checkout-form .field label { color: #4b4b5a; }
.checkout-form .field input, .checkout-form .field select {
  background: #f7f7fb;
  border: 1.5px solid #e2e2ec;
  color: #1a1a2c;
}
.checkout-form .field input:focus, .checkout-form .field select:focus { border-color: var(--accent-solid); }
.checkout-form .field-hint { color: #8a8a9a; }

.card-field-group {
  border: 1.5px solid #e2e2ec;
  border-radius: var(--radius-sm);
  background: #f7f7fb;
  overflow: hidden;
}
.card-field-group .row {
  display: flex;
  border-top: 1px solid #e2e2ec;
}
.card-field-group .row input { border-radius: 0; border: none; }
.card-field-group .row input:first-child { border-right: 1px solid #e2e2ec; }
.card-field-group input {
  width: 100%;
  background: transparent;
  border: none;
  color: #1a1a2c;
  font-family: var(--font);
  font-size: 15px;
  padding: 14px 16px;
}
.card-field-group input:focus { outline: none; }
.card-number-wrap { position: relative; }
.card-brand-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); height: 20px; }

.pay-btn {
  background: linear-gradient(135deg, var(--blue), var(--purple), var(--pink));
  color: #fff;
  margin-top: 20px;
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #8a8a9a;
  font-size: 12px;
  margin-top: 16px;
}

.test-cards-hint {
  margin-top: 24px;
  background: #f7f7fb;
  border: 1px dashed #d8d8e6;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: #6b6b7a;
  line-height: 1.6;
}
.test-cards-hint b { color: #1a1a2c; }
.test-cards-hint code {
  background: #ece9f7;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.decline-banner {
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.35);
  color: #d1226e;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}
.decline-banner.show { display: block; }

/* ============================================================
   SUCCESS PAGE
   ============================================================ */
.success-check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px auto 20px;
}
.success-check svg { width: 34px; height: 34px; }

.receipt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 18px;
  margin: 24px 0;
}
.receipt .row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.receipt .row:last-child { border-bottom: none; }
.receipt .row .k { color: var(--text-dim); }
.receipt .row .v { font-weight: 600; text-align: right; }
.receipt .row .v.mono { font-family: 'SF Mono', Consolas, monospace; font-size: 12.5px; }

.center-text { text-align: center; }
