:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --ink: #17231e;
  --muted: #68736d;
  --line: #dce2dc;
  --accent: #1f7a5b;
  --accent-dark: #145b43;
  --gold: #e5b94f;
  --blue: #275b9f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.bank-payment { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 12px; min-width: 0; }
.bank-payment[hidden] { display: none; }
.bank-payment img { display: block; width: min(100%, 330px); height: auto; justify-self: center; }
.bank-payment p { margin: 0; line-height: 1.5; }
.bank-payment h2 { overflow-wrap: anywhere; }
#bankSubmissionStatus { padding: 12px; background: #fff6d8; color: #604b13; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

.student-page {
  min-height: 100vh;
  padding: 28px;
}

.payment-shell {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
}

.student-header {
  grid-column: 1 / -1;
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #17231e;
  color: #ffffff;
  border-radius: 8px;
  padding: 14px 18px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: #17231e;
  font-weight: 900;
}

.brand-row p,
.brand-row span,
.eyebrow,
h1 {
  margin: 0;
}

.brand-row p {
  font-weight: 900;
}

.brand-row span {
  color: #c7d8cf;
}

.status-pill {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 12px;
  color: #e9f5ee;
  font-weight: 800;
}

.payment-card,
.summary-panel,
.history-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.history-card {
  grid-column: 1 / -1;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.card-head strong {
  color: var(--accent-dark);
  font-size: 1.5rem;
  white-space: nowrap;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin-top: 4px;
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.student-form {
  display: grid;
  gap: 15px;
}

.field-row {
  display: grid;
  gap: 7px;
}

label {
  font-size: 0.9rem;
  font-weight: 760;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cfd8d0;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

input[readonly] {
  background: #eef2ee;
}

input:focus,
select:focus {
  outline: 3px solid rgba(31, 122, 91, 0.18);
  border-color: var(--accent);
}

.fee-options {
  display: grid;
  gap: 8px;
}

.fee-option {
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
  padding: 10px 12px;
}

.fee-option input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.fee-option span {
  font-weight: 800;
}

.fee-option strong {
  color: var(--accent-dark);
  white-space: nowrap;
}

.pay-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.pay-button:hover {
  background: var(--accent-dark);
}

.pay-button:disabled {
  cursor: not-allowed;
  background: #9fb8ac;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.secondary-button,
.receipt-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid #bdd0c5;
  background: #ffffff;
  color: var(--accent-dark);
  font-weight: 900;
  cursor: pointer;
}

.secondary-button {
  padding: 9px 14px;
}

.secondary-button:hover,
.receipt-button:hover {
  border-color: var(--accent);
  background: #eef7f2;
}

.history-status {
  color: var(--muted);
  margin-top: 14px;
  font-weight: 700;
}

.payment-history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
  padding: 14px;
}

.history-item p {
  margin: 7px 0 4px;
  color: var(--ink);
  font-weight: 780;
}

.history-item small {
  color: var(--muted);
}

.receipt-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status-chip {
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2ee;
  color: #4f5b55;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-chip.paid {
  background: #e8f6ee;
  color: #136b42;
}

.status-chip.pending {
  background: #fff6d8;
  color: #816113;
}

.status-chip.failed {
  background: #fbe7e7;
  color: #9d2525;
}

.status-chip.refunded {
  background: #e8effb;
  color: #234f92;
}

.history-amount {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 145px;
}

.history-amount strong {
  color: var(--accent-dark);
  font-size: 1.05rem;
}

.receipt-button {
  display: inline-grid;
  place-items: center;
  min-width: 118px;
  padding: 8px 12px;
  text-decoration: none;
}

dl {
  display: grid;
  gap: 13px;
  margin: 18px 0 0;
}

dl div {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

dt {
  color: var(--muted);
  font-size: 0.84rem;
}

dd {
  margin: 0;
  font-weight: 850;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  border-radius: 8px;
  background: #17231e;
  color: #ffffff;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  color: var(--muted);
  padding: 10px 0;
}

@media (max-width: 880px) {
  .student-page {
    padding: 16px;
  }

  .payment-shell {
    grid-template-columns: 1fr;
  }

  .student-header,
  .card-head,
  .history-head {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .fee-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .fee-option strong {
    grid-column: 2;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-amount {
    justify-items: stretch;
    min-width: 0;
  }
}
