/* Tendabox Collection — public checkout styles */
:root {
  --bg: #f0f4f8;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1a56db;
  --primary-dark: #1240ab;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(15,23,42,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.site-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-header .brand { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; display:flex; align-items:center; }
.brand-logo { height: 28px; width: auto; }
.secure-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}
.secure-badge svg { width: 14px; height: 14px; }

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

/* ── Cards ── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title svg { color: var(--primary); }

/* ── Provider grid ── */
.provider-sections { display:grid; gap:16px; }
.provider-section h3 { font-size: 14px; margin-bottom: 8px; color: var(--muted); }
.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 400px) { .provider-grid { grid-template-columns: repeat(2, 1fr); } }

.provider-tile {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fafafa;
  user-select: none;
}
.provider-tile:hover { border-color: #93c5fd; background: #eff6ff; }
.provider-tile.selected {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}
.provider-tile.bank { }
.provider-logo { width: 40px; height: 40px; object-fit: contain; }
.provider-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.badge-vodacom  { background: #e6001e; }
.badge-airtel   { background: #d71920; }
.badge-tigo     { background: #0048a0; }
.badge-halopesa { background: #00857a; }
.badge-mpesa    { background: #00a550; }
.badge-crdb     { background: #003087; }
.badge-nmb      { background: #1a6e2e; }
.badge-default  { background: #475569; }
.provider-name  { font-size: 11px; font-weight: 600; text-align: center; color: var(--text); }
.provider-channel-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.provider-tile.selected .provider-channel-tag { color: var(--primary); }

/* ── Form ── */
.form-group { display: grid; gap: 6px; }
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-label .required { color: var(--danger); font-size: 10px; }
.form-input {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}
.form-input.error { border-color: var(--danger); }
.input-hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12px; color: var(--danger); display: none; }
.field-error.visible { display: block; }

.form-grid { display: grid; gap: 14px; }

/* ── OTP section ── */
#bank-otp-section {
  display: none;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 16px;
  gap: 12px;
}
#bank-otp-section.visible { display: grid; }
.otp-instructions {
  font-size: 13px;
  color: #0369a1;
  line-height: 1.6;
}
.otp-instructions strong { font-weight: 700; }
.otp-divider { height: 1px; background: #bae6fd; }

/* ── Amount display ── */
.amount-display {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.amount-display .label { font-size: 13px; color: var(--muted); }
.amount-display .value { font-size: 22px; font-weight: 800; color: var(--primary); }

/* ── Submit button ── */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-submit:hover { background: var(--primary-dark); }
.btn-submit:active { transform: scale(0.99); }
.btn-submit:disabled { background: #94a3b8; cursor: not-allowed; transform: none; }
.btn-submit.loading::after {
  content: "";
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* ── Trust footer ── */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.trust-item svg { width: 14px; height: 14px; color: var(--success); }

/* ── Status pages ── */
.status-card {
  text-align: center;
  padding: 40px 24px;
}
.status-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}
.status-icon.pending  { background: #fef3c7; }
.status-icon.success  { background: #d1fae5; }
.status-icon.failed   { background: #fee2e2; }
.status-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.status-subtitle { font-size: 15px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
.ref-badge {
  display: inline-block;
  padding: 6px 14px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 13px;
  font-family: monospace;
  color: var(--text);
  margin-bottom: 20px;
}
.btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  background: #e2e8f0;
  color: var(--text);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s;
}
.btn-secondary:hover { background: #cbd5e1; }
.pulse-ring {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 0 rgba(217,119,6,0.4);
  animation: pulse 1.5s infinite;
  margin: 0 auto 16px;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(217,119,6,0.5); }
  70%  { box-shadow: 0 0 0 12px rgba(217,119,6,0); }
  100% { box-shadow: 0 0 0 0 rgba(217,119,6,0); }
}
.progress-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  animation: progress 20s linear;
}
@keyframes progress { from { width: 0%; } to { width: 100%; } }
