:root {
  color-scheme: light;
  --brand: #0f766e;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --danger: #b91c1c;
  --success: #15803d;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: #0f172a;
  margin: 0;
  padding: 0 0 4rem;
}

header {
  background: var(--brand);
  color: white;
  padding: 1.5rem 2rem;
}

header h1 { margin: 0 0 0.25rem; font-size: 1.4rem; }
header p { margin: 0; opacity: 0.85; font-size: 0.9rem; }

.tabs {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 2rem 0;
  border-bottom: 1px solid var(--border);
  background: white;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #475569;
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.tab-panel {
  display: none;
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.tab-panel.active { display: block; }

form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #334155;
}

input, select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

button {
  align-self: flex-start;
  background: var(--brand);
  color: white;
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

button:hover { opacity: 0.9; }

.hint {
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.5;
}

.warning {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  color: #92400e;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.status {
  margin-top: 1rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.status.error { color: var(--danger); }
.status.success { color: var(--success); }

.checkout-iframe {
  width: 100%;
  height: 600px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 1rem;
}

.whitelist-banner {
  background: #ecfeff;
  border-bottom: 1px solid #a5f3fc;
  color: #155e75;
  padding: 0.7rem 2rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.simulated-panel {
  margin-top: 1rem;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  color: #334155;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.manual-confirm {
  margin-top: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

.manual-confirm p {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: #475569;
}

.iframe-fallback {
  margin-top: 0.75rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.iframe-fallback p { margin: 0 0 0.4rem; }

.iframe-fallback a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.iframe-fallback a:hover { text-decoration: underline; }

.method-field { display: flex; flex-direction: column; gap: 0.4rem; }

.method-field-label {
  font-size: 0.85rem;
  color: #334155;
}

.method-tabs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.method-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 84px;
  padding: 0.7rem 0.6rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: white;
  color: #475569;
  font-size: 0.78rem;
  cursor: pointer;
  align-self: auto;
}

.method-tab:hover { border-color: #94a3b8; }

.method-tab.active {
  border-color: var(--brand);
  background: #f0fdfa;
  color: var(--brand);
  font-weight: 600;
}

.method-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  color: white;
}

.method-icon svg { width: 20px; height: 20px; }

.method-icon-mpesa { background: #16a34a; }
.method-icon-wallet { background: var(--brand); }
.method-icon-paypal { background: #003087; }
.method-icon-card { background: #1e293b; }

.steps-indicator {
  display: flex;
  gap: 0.5rem;
  margin: 1.1rem 0 0;
}

.step-dot {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.4rem;
  border-radius: 8px;
  background: #eef2f7;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
}

.step-dot.active {
  background: var(--brand);
  color: white;
}

.step-dot.done {
  background: #d1fae5;
  color: #047857;
}

.buy-step { display: none; }
.buy-step.active { display: block; }

.result-panel {
  margin-top: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.6;
}

.result-panel.success { border-color: #bbf7d0; background: #f0fdf4; color: var(--success); }
.result-panel.error { border-color: #fecaca; background: #fef2f2; color: var(--danger); }

.secondary-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: #475569;
  margin-top: 1rem;
}

.secondary-btn:hover { background: #f1f5f9; opacity: 1; }
