@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --primary: #1e4a6b;
  --primary-dark: #0f2c3f;
  --primary-light: #e8f0f7;
  --secondary: #c17b3c;
  --secondary-light: #f5e6d9;
  --text-dark: #1e293b;
  --text-medium: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --success: #10b981;
  --success-bg: #f0fdf4;
  --success-border: #86efac;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.12);
  --transition: all 0.2s ease;

  /* Legacy aliases kept so nothing else that references these breaks */
  --accent: #c17b3c;
  --bg: #f4f6f8;
  --text: #1e293b;
  --error: #dc2626;
}


* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e9f0f5 100%);
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px;
}

/* ── Brand bar (checkout/success pages) ── */
.site-brand-bar {
  width: 100%;
  max-width: 640px;
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.site-brand-bar span {
  color: var(--secondary-light);
  font-weight: 500;
  margin-left: 6px;
}

.home-link {
  display: inline-block;
  margin-top: 20px;
  padding: 14px 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: var(--transition);
}

.home-link:hover { background: var(--secondary); transform: translateY(-2px); }

.card {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 36px;
  max-width: 640px;
  width: 100%;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--secondary);
}

h1 { margin-top: 0; color: var(--primary); font-size: 1.6em; font-weight: 600; }

.muted { color: var(--text-light); font-size: 0.9em; font-weight: normal; }

form { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }

.form-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type { border-bottom: none; }

.form-section h2 {
  color: var(--primary);
  font-size: 1.1em;
  margin: 0 0 16px;
}

.form-section label,
.form-section .checkbox-row {
  margin-bottom: 16px;
  display: flex;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9em; color: var(--text-dark); }

input, select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1em;
  font-weight: normal;
  font-family: inherit;
  transition: var(--transition);
  background: var(--bg-white);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 74, 107, 0.1);
}

.addons {
  border: none;
  padding: 0;
  margin: 0 0 8px;
}

.addons legend {
  font-weight: 600;
  font-size: 0.9em;
  margin-bottom: 8px;
  padding: 0;
  color: var(--text-dark);
}

.checkbox-row {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-weight: normal;
  font-size: 0.9em;
  color: var(--text-medium);
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.checkbox-row a { color: var(--secondary); }

button {
  padding: 13px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: var(--transition);
}

button:hover:not(:disabled) { background: var(--secondary); transform: translateY(-1px); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.error { color: var(--error); font-weight: 600; }

.error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 14px 18px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95em;
  margin: 16px 0 0;
}

.status-banner {
  background: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text-medium);
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9em;
  margin: 16px 0 0;
}

.order-summary {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  color: var(--text-medium);
  font-size: 0.95em;
  border-bottom: 1px dashed var(--border);
}

.summary-item:first-child { padding-top: 0; }

.summary-item strong { color: var(--text-dark); }

.summary-total {
  display: flex;
  justify-content: space-between;
  padding: 14px 0 0;
  margin-top: 8px;
  border-top: 2px solid var(--border);
  font-size: 1.1em;
  font-weight: 700;
  color: var(--primary);
}

.summary-total .amount { color: var(--secondary); }

.payment-buttons { min-height: 80px; }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 0;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--secondary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.secure-note {
  max-width: 640px;
  width: 100%;
  text-align: center;
  font-size: 0.8em;
  color: var(--text-light);
  margin-top: 18px;
}

/* ── Success page ── */
.success-icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  color: white;
  font-size: 1.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-heading { text-align: center; }
.success-heading h1 { display: inline-block; }

.next-steps {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-top: 16px;
}

.next-steps h3 {
  color: var(--primary);
  font-size: 0.95em;
  margin: 0 0 10px;
}

.next-steps ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.next-steps li {
  padding: 6px 0 6px 22px;
  position: relative;
  color: var(--text-medium);
  font-size: 0.9em;
}

.next-steps li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--secondary);
}

.ref-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.95em;
}


    /* ===== ADDITIONAL CSS FOR MPESA CARD ===== */
    .mpesa-card {
      background: linear-gradient(135deg, #00a651 0%, #008c3f 100%);
      border-radius: 20px;
      padding: 2rem 1.8rem 1.8rem;
      margin-top: 2rem;
      color: #fff;
      box-shadow: 0 10px 25px rgba(0, 166, 81, 0.25);
      border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .mpesa-card h2 {
      font-size: 1.6rem;
      font-weight: 600;
      margin-bottom: 0.25rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .mpesa-card h2 span {
      background: rgba(255, 255, 255, 0.2);
      padding: 0.15rem 0.8rem;
      border-radius: 40px;
      font-size: 0.8rem;
      font-weight: 400;
      letter-spacing: 0.5px;
    }

    .mpesa-card .muted {
      color: rgba(255, 255, 255, 0.8);
      font-size: 0.95rem;
      margin-bottom: 1.5rem;
    }

    .mpesa-detail {
      background: rgba(255, 255, 255, 0.12);
      backdrop-filter: blur(4px);
      border-radius: 16px;
      padding: 1.2rem 1.4rem;
      margin-bottom: 1.5rem;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mpesa-detail .label {
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 1px;
      opacity: 0.75;
      margin-bottom: 0.25rem;
    }

    .mpesa-detail .till-number {
      font-size: 2rem;
      font-weight: 700;
      letter-spacing: 2px;
      font-family: 'Courier New', monospace;
      background: rgba(0, 0, 0, 0.2);
      padding: 0.4rem 1rem;
      border-radius: 12px;
      display: inline-block;
      margin-top: 0.25rem;
    }

    .mpesa-amount-box {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 14px;
      padding: 1rem 1.4rem;
      margin-bottom: 1.8rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-left: 5px solid #ffd700;
    }

    .mpesa-amount-box .label {
      font-size: 0.9rem;
      opacity: 0.9;
    }

    .mpesa-amount-box .amount {
      font-size: 1.8rem;
      font-weight: 700;
      color: #ffd700;
      letter-spacing: 1px;
    }

    .mpesa-amount-box .amount small {
      font-size: 1rem;
      font-weight: 400;
      margin-left: 4px;
      opacity: 0.9;
    }

    .mpesa-instructions {
      background: rgba(0, 0, 0, 0.15);
      border-radius: 14px;
      padding: 1.2rem 1.4rem;
      margin-bottom: 0.5rem;
    }

    .mpesa-instructions h3 {
      font-size: 1rem;
      font-weight: 600;
      margin-bottom: 0.75rem;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }

    .mpesa-instructions ol {
      padding-left: 1.2rem;
      margin: 0;
      font-size: 0.95rem;
      line-height: 1.7;
      opacity: 0.95;
    }

    .mpesa-instructions ol li {
      margin-bottom: 0.3rem;
    }

    .mpesa-instructions .highlight-box {
      background: rgba(255, 215, 0, 0.15);
      border: 1px dashed rgba(255, 215, 0, 0.5);
      border-radius: 10px;
      padding: 0.75rem 1rem;
      margin-top: 0.9rem;
      font-size: 0.9rem;
    }

    .mpesa-instructions .highlight-box strong {
      color: #ffd700;
    }

    .mpesa-instructions .placeholder {
      background: rgba(255, 255, 255, 0.2);
      padding: 0.1rem 0.5rem;
      border-radius: 6px;
      font-family: 'Courier New', monospace;
      font-weight: 600;
      letter-spacing: 0.5px;
    }

    .mpesa-footnote {
      margin-top: 1rem;
      font-size: 0.8rem;
      opacity: 0.7;
      text-align: center;
      border-top: 1px solid rgba(255, 255, 255, 0.15);
      padding-top: 0.9rem;
    }

    /* ensure existing card doesn't get margin collapse */
    .card {
      margin-bottom: 2rem;
    }
.success-actions { text-align: center; }

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 28px 22px; }
}