:root {
  --asmsi-form-surface: #ffffff;
  --asmsi-form-surface-muted: #f7f9ff;
  --asmsi-form-border: #d9e1f2;
  --asmsi-form-border-strong: #c3cee8;
  --asmsi-form-text: #26324b;
  --asmsi-form-label: #4f5d7a;
  --asmsi-form-focus: #222fb9;
  --asmsi-form-focus-ring: rgba(34, 47, 185, 0.16);
  --asmsi-form-shadow: 0 14px 36px rgba(31, 45, 85, 0.08);
  --asmsi-form-shadow-soft: 0 8px 20px rgba(31, 45, 85, 0.06);
}

.card {
  border: 1px solid rgba(217, 225, 242, 0.9);
  border-radius: 18px;
  box-shadow: var(--asmsi-form-shadow-soft);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
  border-bottom: 1px solid rgba(217, 225, 242, 0.95);
}

.card-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

label,
.form-label {
  margin-bottom: 0.45rem;
  color: var(--asmsi-form-label);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-control,
.form-select,
select,
textarea,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="search"] {
  min-height: 46px;
  padding: 0.72rem 0.95rem;
  border: 1px solid var(--asmsi-form-border);
  border-radius: 12px;
  background-color: var(--asmsi-form-surface);
  color: var(--asmsi-form-text);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

textarea.form-control,
textarea {
  min-height: 120px;
  padding-top: 0.9rem;
}

.form-control:hover,
.form-select:hover,
select:hover,
textarea:hover,
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="datetime-local"]:hover,
input[type="time"]:hover,
input[type="search"]:hover {
  border-color: var(--asmsi-form-border-strong);
  background-color: var(--asmsi-form-surface-muted);
}

.form-control:focus,
.form-select:focus,
select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
input[type="search"]:focus {
  border-color: var(--asmsi-form-focus);
  background-color: #fff;
  box-shadow: 0 0 0 4px var(--asmsi-form-focus-ring);
  transform: translateY(-1px);
}

.form-control::placeholder,
textarea::placeholder,
input::placeholder {
  color: #98a3bf;
}

.input-group-text {
  border: 1px solid var(--asmsi-form-border);
  border-radius: 12px;
  background: linear-gradient(135deg, #f7f9ff 0%, #eef3ff 100%);
  color: #607092;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .form-floating,
.input-group > .input-group-text {
  margin-bottom: 0;
}

.bootstrap-select .dropdown-toggle,
.bootstrap-select .dropdown-toggle:focus,
.bootstrap-select .dropdown-toggle:active {
  min-height: 46px;
  border: 1px solid var(--asmsi-form-border);
  border-radius: 12px;
  background-color: var(--asmsi-form-surface);
  color: var(--asmsi-form-text);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.bootstrap-select .dropdown-toggle:focus {
  border-color: var(--asmsi-form-focus);
  box-shadow: 0 0 0 4px var(--asmsi-form-focus-ring);
}

.btn {
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(31, 45, 85, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(31, 45, 85, 0.12);
}

.btn-primary {
  background-image: linear-gradient(135deg, #222fb9 0%, #3554d1 100%);
  border-color: #222fb9;
}

.btn-secondary {
  background-image: linear-gradient(135deg, #ff6175 0%, #ff7d82 100%);
  border-color: #ff6175;
}

.table-responsive,
.table-responsive-sm,
.table-responsive-md,
.table-responsive-lg,
.table-responsive-xl,
.table-responsive-xxl {
  border-radius: 16px;
  box-shadow: var(--asmsi-form-shadow-soft);
}

/* ── Elder-friendly table ───────────────────── */
.table {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--asmsi-form-text);
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0;
}

.table thead tr th {
  padding: 0.95rem 1rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 2px solid rgba(34, 47, 185, 0.25);
}

.table.table-primary thead tr,
.table thead tr.table-primary {
  background: #060d3f;
  color: #ffffff;
}

.table.table-primary thead tr th,
.table thead tr.table-primary th {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.table tbody tr td {
  padding: 0.9rem 1rem;
  font-size: 1rem;
  vertical-align: middle;
  border-top: 1px solid #e8edf7;
}

/* Alternating row shade for easy row tracking */
.table tbody tr:nth-child(odd) {
  background-color: #f8faff;
}

.table tbody tr:nth-child(even) {
  background-color: #ffffff;
}

.table-hover tbody tr:hover {
  background-color: #eef2ff !important;
  transition: background-color 0.15s ease;
}

/* Zebra + hover keep text dark and legible */
.table tbody tr td,
.table tbody tr:hover td {
  color: #1e2a42;
}

/* Action button in table */
.table .btn-sm {
  font-size: 0.88rem;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
}

/* Round the first/last visible cells at top of table */
.table thead tr th:first-child { border-top-left-radius: 10px; }
.table thead tr th:last-child  { border-top-right-radius: 10px; }

.epayment-screen {
  max-width: 1180px;
  margin: 0 auto;
}

.epayment-shell-card {
  width: 100%;
}

.epayment-shell-card .card-body {
  padding: 2rem;
}

.epayment-eyebrow {
  color: #0d1a7a;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.epayment-title {
  font-size: 2rem;
  line-height: 1.25;
  color: #14213d;
  margin-bottom: 0.65rem;
}

.epayment-subtitle,
.epayment-invalid-ref {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #4a5878;
}

.epayment-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border: 1px solid rgba(13, 26, 122, 0.12);
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: 0 18px 42px rgba(20, 33, 61, 0.08);
}

.epayment-section + .epayment-section {
  margin-top: 1.25rem;
}

.epayment-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f1d5f;
  margin-bottom: 0.9rem;
}

.epayment-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.95rem;
}

.epayment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  background: #ffffff;
  border: 1px solid #d9e1f2;
  border-radius: 16px;
}

.epayment-check {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin: 0;
  cursor: pointer;
  flex: 1;
}

.epayment-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.epayment-checkmark {
  width: 28px;
  min-width: 28px;
  height: 28px;
  margin-top: 0.15rem;
  border: 2px solid #2337a7;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
  position: relative;
}

.epayment-check input:checked + .epayment-checkmark {
  background: #102080;
  border-color: #102080;
}

.epayment-check input:checked + .epayment-checkmark::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 3px;
  width: 7px;
  height: 14px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.epayment-item-label {
  display: block;
  font-size: 1.12rem;
  font-weight: 700;
  color: #1b2844;
  line-height: 1.45;
}

.epayment-item-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.96rem;
  color: #67748d;
}

.epayment-item-code {
  display: block;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #102080;
  line-height: 1.2;
}

.epayment-item-description {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.96rem;
  color: #4a5878;
  line-height: 1.45;
}

.epayment-section-donation .epayment-items {
  grid-template-columns: 1fr;
}

.epayment-section-donation .epayment-item {
  align-items: flex-start;
}

.epayment-section-donation .epayment-amount-wrap {
  min-width: 220px;
  justify-content: flex-end;
}

.epayment-amount-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 205px;
}

.epayment-currency {
  font-size: 1rem;
  font-weight: 800;
  color: #2a3d74;
}

.epayment-amount {
  min-width: 130px;
  text-align: right;
  font-size: 1.08rem;
  font-weight: 700;
}

.epayment-amount:disabled {
  background: #eef2fb;
  color: #8a95ad;
}

.epayment-total-card {
  margin-top: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  background: #060d3f;
  color: #fff;
  border-radius: 18px;
}

.epayment-total-label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.epayment-total-note {
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.epayment-total-value {
  font-size: 1.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.epayment-invalid {
  text-align: center;
  padding: 1.6rem 0 0.4rem;
}

@media (max-width: 767.98px) {
  .epayment-title {
    font-size: 1.6rem;
  }

  .epayment-shell-card .card-body {
    padding: 1.1rem;
  }

  .epayment-items {
    grid-template-columns: 1fr;
  }

  .epayment-item,
  .epayment-total-card {
    flex-direction: column;
    align-items: stretch;
  }

  .epayment-item {
    overflow: hidden;
  }

  .epayment-amount-wrap {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    width: 100%;
    gap: 0.55rem;
  }

  .epayment-amount {
    min-width: 0;
    width: auto;
    max-width: 100%;
  }

  .epayment-section-donation .epayment-amount-wrap {
    min-width: 0;
    width: 100%;
  }

  .epayment-total-value {
    text-align: left;
  }
}

@media (max-width: 767.98px) {
  .card-body {
    padding: 1.1rem;
  }

  .form-control,
  .form-select,
  select,
  textarea,
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"],
  input[type="search"],
  .bootstrap-select .dropdown-toggle {
    min-height: 44px;
  }
}