/* ════════════════════════════════════════════════════════════════════════
   Nakala Donations — clean, modern, light donation interface
   ════════════════════════════════════════════════════════════════════════ */
:root {
  --bg:        #f4f7fb;
  --panel:     #ffffff;
  --text:      #0f1b2d;
  --muted:     #64748b;
  --faint:     #94a3b8;
  --border:    #e7ecf3;
  --border-2:  #d4dce8;
  --emerald:   #0ea371;
  --emerald-d: #0b8560;
  --teal:      #0d9488;
  --danger:    #e11d48;
  --warning:   #b45309;
  --success:   #059669;
  --grad:      linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  --grad-soft: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(14,165,233,0.10));
  --radius:    18px;
  --radius-sm: 13px;
  --shadow:    0 10px 34px rgba(16, 24, 40, 0.07);
  --shadow-sm: 0 2px 10px rgba(16, 24, 40, 0.05);
  --ring:      0 0 0 2px #10b981, 0 6px 18px rgba(16,185,129,0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(14,165,233,0.10), transparent 60%),
    radial-gradient(800px 500px at -5% 10%, rgba(16,185,129,0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
.site-header .brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--grad); font-size: 15px; color: #fff;
  box-shadow: 0 6px 16px rgba(16,185,129,0.28);
}
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); }
.secure-badge {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff;
}
.secure-badge svg { width: 14px; height: 14px; color: var(--emerald); }

/* ── Layout ── */
.checkout-wrapper {
  max-width: 560px; margin: 0 auto;
  padding: 26px 16px 64px;
  display: grid; gap: 16px;
}

/* ── Cards ── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.checkout-card { display: grid; gap: 20px; }

/* ── Hero (compact) ── */
.donate-hero {
  text-align: center;
  padding: 30px 24px;
  background:
    radial-gradient(120% 120% at 50% -20%, rgba(16,185,129,0.10), transparent 60%),
    var(--panel);
}
.checkout-title {
  font-size: 27px; font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; color: var(--text);
}
.checkout-subtitle {
  margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.55;
  max-width: 400px; margin-left: auto; margin-right: auto;
}

/* ── Section headings (numbered) ── */
.checkout-title-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.section-heading {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--text);
}
.section-heading::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 23px; height: 23px; border-radius: 7px;
  font-size: 12px; font-weight: 800; color: #fff;
  background: var(--grad); box-shadow: 0 4px 10px rgba(16,185,129,0.25);
}
.checkout-card { counter-reset: step; }

.env-badge {
  background: #fff7ed; color: var(--warning); border: 1px solid #fed7aa;
  border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; white-space: nowrap;
}

/* ── Provider grid ── */
.provider-groups { display: grid; gap: 16px; }
.provider-group { display: grid; gap: 9px; }
.group-title {
  font-size: 11px; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.09em;
}
.provider-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 440px) { .provider-grid { grid-template-columns: repeat(3, 1fr); } }

.provider-tile {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 7px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  cursor: pointer; background: #fff; color: var(--text);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  user-select: none;
}
.provider-tile:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.provider-tile.selected { border-color: #10b981; box-shadow: var(--ring); }
.provider-logo { width: 30px; height: 30px; object-fit: contain; }
.provider-badge {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; letter-spacing: -0.5px;
}
.badge-vodacom  { background: #e6001e; }
.badge-airtel   { background: #e40000; }
.badge-tigo     { background: #1e5bd6; }
.badge-halopesa { background: #00a99d; }
.badge-mpesa    { background: #00a550; }
.badge-crdb     { background: #0a52b8; }
.badge-nmb      { background: #1f9e3e; }
.badge-azampesa { background: #2a52d4; }
.badge-default  { background: #64748b; }
.provider-name { font-size: 11px; font-weight: 600; text-align: center; color: var(--text); line-height: 1.2; }
.provider-channel-tag {
  font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--faint);
}
.provider-tile.selected .provider-channel-tag { color: var(--emerald); }
.provider-tile.maintenance { opacity: 0.5; cursor: not-allowed; }
.provider-tile.maintenance:hover { transform: none; box-shadow: none; }
.provider-tile small { font-size: 8.5px; color: var(--warning); }

/* ── Forms ── */
.form-grid { display: grid; gap: 17px; }
.form-group { display: grid; gap: 7px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-label {
  font-size: 13px; font-weight: 600; color: #334155;
  display: flex; align-items: center; gap: 5px;
}
.form-label .required { color: var(--emerald); font-size: 14px; line-height: 1; }
.form-label .optional { color: var(--faint); font-size: 11px; font-weight: 500; }
.form-input {
  padding: 13px 15px; border: 1.5px solid var(--border); border-radius: 11px;
  font-size: 15px; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.form-input::placeholder { color: var(--faint); }
.form-input:focus {
  outline: none; border-color: #10b981; box-shadow: 0 0 0 3.5px rgba(16,185,129,0.14);
}
.form-input.input-readonly { background: #f8fafc; color: var(--muted); }
.input-hint { font-size: 12px; color: var(--faint); line-height: 1.5; }
.field-error { font-size: 12.5px; color: var(--danger); font-weight: 500; display: none; }
.field-error.visible { display: block; }

/* ── Amount chips ── */
.amount-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
@media (max-width: 440px) { .amount-chips { grid-template-columns: repeat(3, 1fr); } }
.amount-chip {
  border: 1.5px solid var(--border); background: #fff; border-radius: 12px;
  padding: 12px 4px; font-size: 13.5px; font-weight: 700; font-family: inherit; color: var(--text);
  cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.amount-chip span.cur { display: block; font-size: 9.5px; font-weight: 700; color: var(--faint); letter-spacing: 0.8px; }
.amount-chip:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: var(--shadow-sm); }
.amount-chip.selected {
  border-color: #10b981; color: var(--emerald-d);
  background: var(--grad-soft); box-shadow: var(--ring);
}
.amount-chip.selected span.cur { color: var(--emerald); }

/* ── Amount field ── */
.amount-field { position: relative; display: flex; align-items: center; }
.amount-prefix { position: absolute; left: 15px; font-size: 14px; font-weight: 800; color: var(--emerald); pointer-events: none; }
.amount-input { padding-left: 54px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.amount-input::-webkit-outer-spin-button, .amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input { -moz-appearance: textfield; }

/* ── Donation summary ── */
.donate-summary {
  display: none; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-radius: 13px;
  border: 1px solid rgba(16,185,129,0.28);
  background: var(--grad-soft);
}
.donate-summary .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.donate-summary .value { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; color: var(--emerald-d); }

/* ── OTP / bank section ── */
#bank-otp-section {
  display: none; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 13px;
  padding: 17px; gap: 13px;
}
#bank-otp-section.visible { display: grid; }
.otp-instructions { font-size: 13px; color: #0369a1; line-height: 1.6; }
.otp-instructions strong { color: #075985; font-weight: 700; }
.otp-divider { height: 1px; background: #bae6fd; }
.autofill-badge {
  font-size: 10px; font-weight: 700; color: var(--emerald-d);
  background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3);
  border-radius: 999px; padding: 1px 8px; margin-left: 4px;
}

/* ── Provider error ── */
#provider-error {
  display: none; padding: 11px 15px; background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 11px; font-size: 13px; color: var(--danger);
}
#provider-error.visible { display: block; }

/* ── Donate button ── */
.btn-submit {
  position: relative; width: 100%; padding: 16px; border: none; border-radius: 13px;
  font-size: 16px; font-weight: 800; letter-spacing: 0.01em; font-family: inherit; color: #fff;
  cursor: pointer; background: var(--grad);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 10px 26px rgba(16,185,129,0.3);
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(16,185,129,0.4); filter: brightness(1.03); }
.btn-submit:active { transform: translateY(0) scale(0.995); }
.btn-submit:disabled { filter: grayscale(0.3) brightness(0.92); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-submit.loading::after {
  content: ""; width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.45); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Trust footer ── */
.trust-bar { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.trust-item { display: flex; align-items: center; gap: 6px; font-weight: 500; }

/* ════════════════════════════════════════════════════════════════════════
   Status pages
   ════════════════════════════════════════════════════════════════════════ */
.status-card { text-align: center; padding: 42px 26px; }
.status-icon {
  width: 78px; height: 78px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}
.status-icon.pending { background: #fef3c7; }
.status-icon.success { background: #d1fae5; }
.status-icon.failed  { background: #fee2e2; }
.status-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 9px; }
.status-title-success { color: var(--success); }
.status-title-failed  { color: var(--danger); }
.status-subtitle { font-size: 15px; color: var(--muted); margin-bottom: 24px; line-height: 1.6; max-width: 400px; margin-left: auto; margin-right: auto; }
.status-note { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.status-help { font-size: 13px; color: var(--faint); margin: 16px 0; }
.status-actions { margin-top: 10px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.ref-badge {
  display: inline-block; padding: 7px 15px; background: #f1f5f9; border: 1px solid var(--border);
  border-radius: 8px; font-size: 12.5px; font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  color: var(--muted); margin-bottom: 20px;
}
.btn-secondary {
  display: inline-block; padding: 12px 22px; background: #f1f5f9; color: var(--text);
  border: 1px solid var(--border-2); border-radius: 11px; text-decoration: none; font-weight: 700; font-size: 14px;
  transition: background 0.15s, transform 0.12s, border-color 0.15s;
}
.btn-secondary:hover { background: #e7edf5; transform: translateY(-1px); border-color: var(--emerald); }

.transaction-summary {
  display: grid; gap: 10px; text-align: left; padding: 17px; margin: 0 auto 22px; max-width: 380px;
  border: 1px solid var(--border); border-radius: 13px; background: #fafbfd;
}
.transaction-summary-success { border-color: #a7f3d0; background: #f0fdf9; }
.txn-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.txn-label { color: var(--muted); }
.txn-value { color: var(--text); font-weight: 600; text-align: right; }
.txn-value-success { color: var(--success); font-weight: 800; }
.txn-mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; }

.pulse-ring {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 20px; background: var(--grad);
  box-shadow: 0 0 0 0 rgba(16,185,129,0.4); animation: bigpulse 1.6s infinite;
}
@keyframes bigpulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); transform: scale(0.95); }
  70% { box-shadow: 0 0 0 18px rgba(16,185,129,0); transform: scale(1); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); transform: scale(0.95); }
}
.progress-bar { height: 5px; background: #e7ecf3; border-radius: 999px; overflow: hidden; margin: 18px auto; max-width: 300px; }
.progress-bar-fill { height: 100%; background: var(--grad); border-radius: 999px; animation: progress 20s linear forwards; }
@keyframes progress { from { width: 4%; } to { width: 100%; } }

.access-denied { text-align: center; padding: 48px 24px; }
