:root {
  --green-900: #0b4a27;
  --green-800: #0f5f31;
  --green-700: #14783d;
  --green-600: #169747;
  --blue-800: #1f4388;
  --blue-700: #2864d9;
  --red-700: #c91f23;
  --amber-100: #fff7df;
  --amber-600: #b7791f;
  --ink-900: #071422;
  --ink-700: #21364d;
  --ink-500: #60738c;
  --line: #dce5ee;
  --soft: #f4f7fa;
  --white: #ffffff;
  --shadow: 0 18px 42px rgba(4, 31, 16, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--green-800);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 80% 12%, rgba(31, 67, 136, 0.22), transparent 28rem),
    linear-gradient(140deg, var(--green-900), var(--green-700) 58%, var(--green-800));
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.top-logo {
  min-height: 43vh;
  display: grid;
  place-items: center;
  background: var(--white);
  padding: 2.25rem 1rem;
}

.top-logo img {
  width: min(360px, 76vw);
  height: auto;
  display: block;
}

.green-stage {
  min-height: 57vh;
  display: grid;
  place-items: center;
  padding: 3rem 1rem;
}

.page-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
}

.page-stack {
  width: min(100%, 460px);
}

.page-stack.wide {
  width: min(100%, 980px);
}

.brand-pill {
  width: fit-content;
  margin: 0 auto 1rem;
  padding: 0.64rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f4fff8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.brand-pill span {
  margin-right: 0.45rem;
  opacity: 0.75;
}

.card {
  background: #ffffff;
  background-color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-pad {
  padding: 1.45rem;
}

.panel-head {
  padding: 1.55rem;
  color: var(--white);
  background: linear-gradient(120deg, var(--green-700), #18a653);
}

.panel-head.red {
  background: linear-gradient(120deg, var(--red-700), #e0292d);
}

.panel-head.blue {
  background: linear-gradient(120deg, #1f4388, #2b56b8);
}

.kicker {
  margin: 0 0 0.45rem;
  font-size: 0.76rem;
  font-weight: 800;
  opacity: 0.9;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  line-height: 1.14;
  letter-spacing: 0;
  margin-bottom: 0.55rem;
}

h2 {
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  line-height: 1.18;
  letter-spacing: 0;
  margin-bottom: 0.55rem;
}

h3 {
  font-size: 1.02rem;
  margin-bottom: 0.35rem;
}

p {
  line-height: 1.55;
}

.muted {
  color: var(--ink-500);
}

.small {
  font-size: 0.82rem;
}

.center {
  text-align: center;
}

.portal-ribbon {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 1rem;
  padding: 0.48rem 0.72rem;
  border-radius: 8px;
  border: 1px solid #bfe6ce;
  background: #effaf3;
  color: #0d6932;
  font-weight: 800;
  font-size: 0.78rem;
  text-align: center;
}

.btn-row {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--green-600);
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(10, 95, 49, 0.22);
  background: var(--green-700);
}

.btn:disabled {
  background: #c7d2df;
  cursor: not-allowed;
}

.btn.secondary {
  color: var(--green-800);
  background: #ffffff;
  border: 1px solid #98d4ad;
  box-shadow: inset 0 0 0 1px rgba(20, 120, 61, 0.08);
}

.btn.red {
  background: var(--red-700);
}

.btn.red:hover:not(:disabled) {
  background: #b0181c;
}

.btn.blue {
  background: var(--blue-700);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.form-group {
  display: grid;
  gap: 0.35rem;
}

.full {
  grid-column: 1 / -1;
}

label {
  color: #1a2c3e;
  font-size: 0.78rem;
  font-weight: 800;
}

.required {
  color: #d21f2b;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cad5e1;
  border-radius: 6px;
  padding: 0.7rem 0.75rem;
  background: #fbfcfe;
  color: var(--ink-900);
  outline: none;
  transition: border 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus {
  border-color: #2aa962;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(42, 169, 98, 0.18);
}

.kin-box {
  grid-column: 1 / -1;
  padding: 0.85rem;
  border: 1px solid #d7e7f7;
  border-radius: 8px;
  background: #eef6ff;
}

.kin-box strong {
  display: block;
  margin-bottom: 0.65rem;
  color: #164b96;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.option-list {
  display: grid;
  gap: 0.75rem;
  padding: 1.25rem;
}

.choice {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 44px 1fr 22px;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 0.75rem;
  text-align: left;
  transition: border 160ms ease, background 160ms ease, transform 160ms ease;
}

.choice:hover {
  transform: translateY(-1px);
  border-color: #9ac6db;
  background: #fbfdff;
}

.choice.selected {
  border-color: var(--green-600);
  background: #edf9f1;
}

.choice-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue-800);
  background: #edf3f8;
  font-size: 1.1rem;
  font-weight: 900;
}

.radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #b9c8d8;
  position: relative;
}

.choice.selected .radio-dot {
  border-color: var(--green-700);
  border-width: 5px;
}

.note {
  margin: 0 1.25rem 1rem;
  padding: 0.8rem;
  border: 1px solid #f2cf76;
  border-radius: 8px;
  color: #77490c;
  background: var(--amber-100);
  font-size: 0.82rem;
}

.notice {
  margin-top: 1rem;
  padding: 0.8rem;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #244a7d;
  font-size: 0.82rem;
}

.status-list {
  display: grid;
  gap: 0.65rem;
  margin: 1.1rem 0 0;
}

.status-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid #bce8ce;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  background: #effaf3;
  color: #0b5c2d;
  font-size: 0.85rem;
}

.status-row.pending {
  border-color: #cbd8e5;
  background: #f8fafc;
  color: #536780;
}

.check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-600);
  color: white;
  font-size: 0.8rem;
  font-weight: 900;
}

.pending .check {
  background: transparent;
  border: 2px solid #9cb3ca;
}

.approved-mark {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--green-600);
  color: white;
  font-size: 2.1rem;
  box-shadow: 0 16px 32px rgba(22, 151, 71, 0.24);
}

.amount-box {
  margin: 1rem 0;
  padding: 1.05rem;
  border: 1px solid #8ab8ff;
  border-radius: 8px;
  background: #eaf3ff;
  text-align: center;
}

.amount-box span {
  display: block;
  color: #63738a;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.amount-box strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--green-700);
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 1.05;
}

.amount-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.approval-card {
  overflow: hidden;
}

.feed-card {
  max-height: 520px;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  color: white;
  background: linear-gradient(120deg, var(--blue-800), #294bb2);
}

.live-badge {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  font-size: 0.72rem;
  font-weight: 800;
}

.feed-list {
  display: grid;
  gap: 0.65rem;
  max-height: 442px;
  overflow: auto;
  padding: 0.8rem;
  background: #f2f5f8;
}

.feed-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: white;
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #7b36d9;
  font-size: 0.72rem;
  font-weight: 900;
}

.fee-box {
  margin: 1.25rem 0 1rem;
  border: 1px solid #f5b6b7;
  border-radius: 8px;
  background: #fff5f5;
  color: #821417;
  overflow: hidden;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.fee-row + .fee-row {
  border-top: 1px dashed #f0b9ba;
}

.fee-row strong {
  font-size: 1.35rem;
}

.receiver-help {
  margin: -0.25rem 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #c8ead5;
  border-radius: 8px;
  background: #f1fbf5;
  color: #0d6932;
  font-size: 0.8rem;
  line-height: 1.45;
}

.network-panel {
  display: grid;
  gap: 0.7rem;
}

.same-number {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.summary {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-500);
}

.summary-row strong {
  color: var(--ink-900);
}

.submitted-meta {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.9rem;
}

.footer-note {
  margin-top: 0.9rem;
  color: rgba(255,255,255,0.76);
  font-size: 0.75rem;
  text-align: center;
}

.screen-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 50, 26, 0.86);
  backdrop-filter: blur(4px);
}

.screen-loader.active {
  display: grid;
}

.loader-card {
  width: min(100%, 430px);
  padding: 2rem;
  border-radius: 8px;
  background: white;
  text-align: center;
  box-shadow: var(--shadow);
}

.loader-ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 5px solid #dce8f6;
  border-top-color: var(--blue-700);
  animation: spin 850ms linear infinite;
}

.loader-steps {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  text-align: left;
}

.loader-step {
  padding: 0.58rem 0.7rem;
  border: 1px solid #dbe7f3;
  border-radius: 8px;
  color: var(--ink-500);
  background: #f7fafc;
  font-size: 0.84rem;
}

.loader-step.done {
  border-color: #bce8ce;
  color: #0b5c2d;
  background: #effaf3;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fade-in {
  animation: fadeIn 220ms ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .amount-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-stage {
    align-items: flex-start;
    padding-top: 1.25rem;
  }

  .green-stage {
    padding: 2rem 1rem;
  }

  .form-grid,
  .inline-grid,
  .same-number {
    grid-template-columns: 1fr;
  }

  .card-pad,
  .panel-head,
  .option-list {
    padding: 1rem;
  }

  .choice {
    grid-template-columns: 38px 1fr 20px;
  }
}

/* ── M-PESA payment confirmation overlay ── */
.stk-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(7, 20, 34, 0.72);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.stk-overlay.active {
  display: flex;
}

.stk-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(4, 31, 16, 0.32);
  padding: 2rem 1.6rem 1.8rem;
  width: min(100%, 400px);
  text-align: center;
  animation: stk-pop 0.22s ease;
}

@keyframes stk-pop {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.stk-card h2 {
  margin-bottom: 0.5rem;
  font-size: 1.22rem;
}

.stk-phone {
  font-size: 0.9rem;
  color: var(--ink-700);
  margin-bottom: 0.6rem;
}

.stk-hint {
  font-size: 0.84rem;
  color: var(--ink-500);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.stk-timer {
  display: inline-block;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  background: #f0faf4;
  border: 1px solid #bfe6ce;
  color: #0d6932;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.stk-error-card {
  border-top: 4px solid var(--red-700);
}

.stk-error-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fdecea;
  color: var(--red-700);
  font-size: 1.5rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
}

.stk-error-msg {
  font-size: 0.88rem;
  color: var(--ink-700);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}
