/* ── View Transitions API — smooth cross-document page changes ──────────── */
/* (@view-transition navigation:auto is now declared globally in site.css) */
.mem-panel { view-transition-name: mem-content; }

/* ── Membership page layout ─────────────────────────────────────────────── */
:root { --mem-sidebar-w: 300px; }
.mem-layout {
  display: grid;
  grid-template-columns: var(--mem-sidebar-w) 1fr;
  gap: 2.5rem;
  align-items: start;
}
/* A sticky child can only travel inside its containing block, and the grid's
   align-items:start shrinks this column to its own content height. Stretching it
   to the full row is what lets a sticky panel ride the whole form. */
.mem-info-col { align-self: stretch; }
.mem-info-sticky {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
}

/* Download card (ahli baru sidebar) — the only pinned panel on that page, and
   deliberately the last one: it stays beside the upload rows without covering
   the benefits and fee panels above it on the way back up. */
.mem-dl-card {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  scroll-margin-top: calc(var(--nav-height) + 1rem);
}
/* The shared .dl-item is sized for a full-width column; in the 300px sidebar its
   icon squeezes the title into three wrapped lines. Drop the icon, keep the arrow. */
.mem-dl-card .dl-item { padding: 0.7rem 0.85rem; gap: 0.6rem; }
.mem-dl-card .dl-item__icon { display: none; }

/* Fee row */
.mem-fee-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  color: var(--fg-mid);
  padding: 0.28rem 0;
}

/* Top section */
.mem-top-section {
  margin-bottom: 0.75rem;
  padding: 1.25rem;
  background: var(--cream-mid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

/* ── Accordion ──────────────────────────────────────────────────────────── */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 0.6rem;
  overflow: hidden;
  background: var(--surface);
}
.accordion--error { border-color: #c0392b; }

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  transition: background 0.15s;
}
.accordion__trigger:hover { background: var(--cream-mid); }

.accordion__label { display: flex; align-items: center; gap: 0.75rem; }

.accordion__end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.accordion__step {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--fg-subtle);
  font-weight: 500;
  white-space: nowrap;
}

.accordion__alpha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.accordion__alpha--error { background: #c0392b; }

.accordion__chevron {
  flex-shrink: 0;
  color: var(--fg-muted);
  transition: transform 0.25s;
}
.accordion--open .accordion__chevron { transform: rotate(180deg); }

.accordion__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.accordion--open .accordion__body {
  grid-template-rows: 1fr;
}
.accordion__body-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 1.25rem;
}
.accordion--open .accordion__body-inner {
  padding-top: 0.25rem;
  padding-bottom: 1.5rem;
}

/* Section label inside accordion */
.acc-section-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* ── Grid overrides ─────────────────────────────────────────────────────── */
.mem-grid-2 { grid-template-columns: 1fr 1fr; }
.mem-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Radio cards ─────────────────────────────────────────────────────────── */
.radio-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.radio-card {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex: 1;
  min-width: 100px;
}
.radio-card input { display: none; }
.radio-card__title { font-family: var(--font-ui); font-weight: 600; font-size: 0.88rem; color: var(--navy); }
.radio-card__sub   { font-family: var(--font-ui); font-size: 0.73rem; color: var(--fg-muted); }
.radio-card--active { border-color: var(--navy); background: var(--navy-light); }
.radio-card:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }

/* ── Radio chips ─────────────────────────────────────────────────────────── */
.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.8rem;
  border: 1.5px solid var(--border-mid);
  border-radius: 99px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--fg-mid);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
  user-select: none;
}
.radio-chip input { display: none; }
.radio-chip--active { border-color: var(--navy); background: var(--navy); color: #fff; }
.radio-chip:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }

/* ── Contribution inputs ─────────────────────────────────────────────────── */
.mem-contrib-info {
  background: var(--cream-mid);
  border-radius: var(--r-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--fg-mid);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.mem-contrib-readonly {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  background: var(--cream-mid);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 0.5rem;
  gap: 1rem;
}
.mem-contrib-readonly__label { font-family: var(--font-ui); font-weight: 600; font-size: 0.83rem; color: var(--fg-mid); display: block; }
.mem-contrib-readonly__note  { font-family: var(--font-ui); font-size: 0.73rem; color: var(--fg-muted); }
.mem-contrib-readonly__amount { font-family: var(--font-ui); font-weight: 700; font-size: 0.92rem; color: var(--navy); white-space: nowrap; }

.contrib-input-wrap { display: flex; align-items: stretch; }
.contrib-prefix {
  padding: 0 0.65rem;
  background: var(--cream-mid);
  border: 1.5px solid var(--border-mid);
  border-right: none;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--fg-mid);
  display: flex;
  align-items: center;
}
.contrib-input-wrap .contrib-input {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  width: 120px;
  flex-shrink: 0;
}
.field-hint { font-family: var(--font-ui); font-size: 0.74rem; color: var(--fg-muted); margin-top: 0.3rem; line-height: 1.55; }

/* Insurans rows */
.insurans-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: nowrap; width: 100%; }
.insurans-row__tag {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-mid);
  white-space: nowrap;
  min-width: 90px;
  max-width: 110px;
  flex-shrink: 0;
}
.insurans-row__range { font-family: var(--font-ui); font-size: 0.73rem; color: var(--fg-muted); white-space: nowrap; margin-left: auto; padding-left: 0.6rem; }
.insurans-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
  color: var(--fg-muted);
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.insurans-remove-btn:hover { border-color: #c0392b; color: #c0392b; }

.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.85rem;
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--r-sm);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 0.79rem;
  color: var(--fg-mid);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost-sm:hover { border-color: var(--navy); color: var(--navy); }
.btn-ghost-sm:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Coop rows ──────────────────────────────────────────────────────────── */
.coop-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--cream-mid);
}
.coop-row__num {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--fg-muted);
  padding-top: 0.35rem;
  min-width: 16px;
}
.coop-row__fields { flex: 1; min-width: 0; }

/* ── Proposer grid ──────────────────────────────────────────────────────── */
.proposer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.proposer-block {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--cream-mid);
}
.proposer-block__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── Attachments ────────────────────────────────────────────────────────── */
.mem-docs-notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  background: #fffbec;
  border: 1px solid #e8cc6a;
  border-radius: var(--r-sm);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: #6b5200;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}
.attachment-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
/* Fixed-width so the four required slots line their drop zones up. */
.attachment-row__label {
  width: 160px;
  flex-shrink: 0;
  font-family: var(--font-ui);
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}
.file-upload-label {
  position: relative;
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  padding: 0.48rem 0.9rem;
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.15s;
  overflow: hidden;
}
.file-upload-label:hover,
.file-upload-label:focus-within,
.file-upload-label--drag { border-color: var(--navy); background: rgba(30,64,175,0.04); }
.file-upload-label:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }
.file-upload-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.file-upload-text {
  font-family: var(--font-ui);
  font-size: 0.81rem;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* MF file list */
.mf-file-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mf-file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cream-mid);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
}
.mf-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
}
.mf-file-size {
  color: var(--fg-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.mf-file-remove {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.mf-file-remove:hover { background: #fee2e2; color: #dc2626; }
.attachment-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
  color: var(--fg-muted);
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.attachment-remove-btn:hover { border-color: #c0392b; color: #c0392b; }

/* ── Ikrar box ──────────────────────────────────────────────────────────── */
.ikrar-box {
  padding: 1.25rem;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  background: var(--cream-mid);
  margin-bottom: 1.5rem;
}
.ikrar-box__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 0.65rem;
}
/* Lead-in line above a numbered declaration list ("Saya dengan ini
   mengisytiharkan bahawa:"). */
.pb-declare__intro {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--fg-mid);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}
.ikrar-list {
  margin: 0 0 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.83rem;
  color: var(--fg-mid);
  line-height: 1.65;
}
.ikrar-confirm {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  color: var(--navy);
  line-height: 1.6;
  transition: border-color 0.15s;
}
.ikrar-confirm input[type=checkbox] {
  width: 24px;
  height: 24px;
  margin-top: 0.1em;
  flex-shrink: 0;
  accent-color: var(--navy);
  cursor: pointer;
}
.ikrar-confirm--error { border-color: #c0392b; background: #fff5f5; }

/* ── Error / validation states ──────────────────────────────────────────── */
.field-group.has-error .field-input,
.field-group.has-error .field-textarea,
.field-group.has-error .field-select { border-color: #c0392b !important; }
.field-group.has-error .field-label { color: #c0392b; }
.field-input--invalid { border-color: #c0392b !important; }

/* Live format-validation success (field-validation.js) — border only, no
   icon/text, so a long form doesn't fill up with checkmarks. */
.field-group.has-success .field-input,
.field-group.has-success .field-select { border-color: #15803d; }

/* Fade/slide the live error in instead of an abrupt pop-in. */
.field-error--live {
  animation: field-error-in 0.15s ease-out;
}
@keyframes field-error-in {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Combobox (searchable dropdown) ─────────────────────────────────────── */
.combobox-wrap {
  position: relative;
}
.combobox-input {
  width: 100%;
}
.combobox-list {
  display: none;
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--r-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  z-index: 200;
  list-style: none;
  padding: 0.25rem 0;
  margin: 0;
}
.combobox-list.combobox-list--open {
  display: block;
}
.combobox-list li {
  padding: 0.45rem 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  color: var(--fg-mid);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combobox-list li:hover,
.combobox-list li.combobox-item--active {
  background: var(--cream-mid);
  color: var(--navy);
}
.combobox-list li[data-empty] {
  color: var(--fg-muted);
  cursor: default;
  font-style: italic;
}
/* Disabled submit button */
#submit-membership:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Mode switcher ──────────────────────────────────────────────────────── */
.mode-switcher {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}
.mode-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  background: var(--surface);
  border: 2px solid var(--border-mid);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  font-family: inherit;
  text-decoration: none;
  color: inherit;
}
.mode-card:hover {
  border-color: var(--navy);
  box-shadow: 0 2px 10px rgba(30,42,74,0.09);
}
.mode-card--active {
  border-color: var(--gold);
  background: var(--navy);
  box-shadow: 0 3px 14px rgba(30,42,74,0.18);
}
.mode-card--active .mode-card__icon,
.mode-card--active .mode-card__title,
.mode-card--active .mode-card__sub { color: #fff; }
.mode-card__icon {
  flex-shrink: 0;
  color: var(--navy);
  opacity: 0.75;
}
.mode-card__meta { display: flex; flex-direction: column; gap: 0.15rem; }
.mode-card__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
}
.mode-card__sub {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--fg-muted);
  line-height: 1.4;
}
@media (max-width: 540px) {
  .mode-switcher { flex-direction: column; }
  .mode-card { padding: 0.85rem 1.1rem; }
}

/* ── Member-form cards ──────────────────────────────────────────────────── */
.mf-category-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 2rem 0 0.6rem;
}
.mf-category-label:first-of-type { margin-top: 0; }
.mf-card {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}
.mf-card:hover { border-color: var(--border-mid); }
.mf-card--open { border-color: var(--navy); }
.mf-card__header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s;
}
.mf-card__header:hover { background: var(--cream-mid); }
.mf-card--open .mf-card__header { background: var(--cream-mid); }
.mf-card__icon {
  flex-shrink: 0;
  color: var(--navy);
  opacity: 0.6;
}
.mf-card__meta { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.mf-card__name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy);
}
.mf-card__desc {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--fg-muted);
}
.mf-card__chevron {
  flex-shrink: 0;
  color: var(--fg-muted);
  transition: transform 0.22s ease;
}
.mf-card--open .mf-card__chevron { transform: rotate(180deg); }
.mf-card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.25rem;
}
.mf-card--open .mf-card__body {
  max-height: 4000px;
  padding: 0.25rem 1.25rem 2.25rem;
}

/* ── Repeating row remove button ────────────────────────────────────────── */
.mf-repeat-row {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--cream-mid);
  margin-bottom: 0.75rem;
}
.mf-remove-row-btn {
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  color: var(--fg-muted);
  line-height: 0;
  transition: border-color 0.13s, color 0.13s;
}
.mf-remove-row-btn:hover { border-color: #c0392b; color: #c0392b; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1050px) {
  .mem-layout { grid-template-columns: 260px 1fr; gap: 1.75rem; }
  .mem-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .mem-layout { grid-template-columns: 1fr; }
  .mem-info-sticky, .mem-dl-card { position: static; }

  /* The sidebar is first in source order because on desktop it is the left
     column. Stacked, that put ~1,900px of benefits and fee breakdown between
     the page heading and the first form field. The form goes first; the
     reference material stays available underneath.
     `order` normally risks a DOM/visual mismatch for keyboard users, but this
     sidebar contains no focusable elements at all — benefits list, fee table
     and a security note, all static text — so nothing lands out of sequence. */
  .form-surface  { order: 1; }
  .mem-info-col  { order: 2; margin-top: 2rem; }
  .proposer-grid { grid-template-columns: 1fr; }
  .mem-grid-3, .mem-grid-2 { grid-template-columns: 1fr; }
  .mem-top-section .field-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .form-surface { padding: 1.25rem; }
  .accordion__body-inner { padding: 0 1rem; }
  .accordion--open .accordion__body-inner { padding: 0.25rem 1rem 1.25rem; }

  /* insurans row overflows at 20px base — allow wrapping and drop the range hint */
  .insurans-row { flex-wrap: wrap; }
  .insurans-row__range { display: none; }

  /* accordion step label squishes the section title — hide it on small screens */
  .accordion__step { display: none; }

  /* 160px label + 180px drop zone does not fit — stack them */
  .attachment-row__label { width: 100%; }
}

/* ── Section completion indicators ─────────────────────────────────────── */
.acc-indicator {
  font-size: 0.72rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 0.25rem;
}
.acc-indicator--done    { background: #15803d; color: #fff; }
.acc-indicator--pending { background: #b45309; color: #fff; }

/* Dot + word. Colour alone never carries the state (WCAG 1.4.1) — the word is
   the label, and the dot is aria-hidden. */
.acc-status {
  display:     inline-flex;
  align-items: center;
  gap:         0.35rem;
  flex-shrink: 0;
}

.acc-status__word {
  font-family: var(--font-ui);
  font-size:   0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.acc-status__word.is-done    { color: #15803d; }
.acc-status__word.is-pending { color: #b45309; }

/* Below 640px the trigger already carries "Seksyen n / 5" and the chevron, so
   the word goes screen-reader-only rather than wrapping the row. */
@media (max-width: 639px) {
  .acc-status__word {
    position:    absolute;
    width:       1px;
    height:      1px;
    padding:     0;
    margin:      -1px;
    overflow:    hidden;
    clip:        rect(0 0 0 0);
    clip-path:   inset(50%);
    white-space: nowrap;
    border:      0;
  }
}

/* ── Draft-restored banner ─────────────────────────────────────────────── */
.draft-notice {
  display:       flex;
  align-items:   flex-start;
  gap:           0.75rem;
  flex-wrap:     wrap;
  padding:       0.9rem 1.1rem;
  margin-bottom: 1.5rem;
  background:    var(--navy-light);
  border:        1px solid var(--border-mid);
  border-left:   3px solid var(--navy);
  border-radius: var(--r-sm);
  font-family:   var(--font-ui);
  font-size:     0.85rem;
  color:         var(--fg-mid);
  line-height:   1.55;
}

.draft-notice__text { flex: 1 1 16rem; margin: 0; }

.draft-notice__discard {
  flex-shrink:     0;
  min-height:      44px;
  padding:         0.5rem 1rem;
  font-family:     var(--font-ui);
  font-size:       0.82rem;
  font-weight:     600;
  color:           var(--navy);
  background:      var(--surface);
  border:          1px solid var(--border-mid);
  border-radius:   var(--r-sm);
  cursor:          pointer;
}

.draft-notice__discard:hover { background: var(--cream-mid); }

/* ── Required-field marker ─────────────────────────────────────────────── */
.req { color: #c0392b; font-weight: 600; }

/* ── File size error ────────────────────────────────────────────────────── */
.file-size-error {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: #c0392b;
  margin-top: 0.25rem;
}

/* ── B4 utility classes (replaces repeated inline styles) ───────────────── */
.field-textarea--short  { min-height: 70px; }
.field-input--narrow    { max-width: 260px; }
.contrib-input--sm      { width: 130px; }

/* ── View Transitions API ───────────────────────────────────────────────── */
/* ponytail: .form-surface previously duplicated .mem-panel's view-transition-name
   ("mem-content"), which is invalid — two elements visible at once can't share a
   name, so the browser aborted the transition. .mem-panel already carries the
   named transition for the baru<->sedia-ada mode switch; .form-surface needs none. */

/* ── Post-submit "check your email" modal ────────────────────────────────── */
.verify-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 32, 0.6);
  /* flex-start, NOT center: a flex item taller than its scroll container
     overflows in both directions when centred, and the part above the top edge
     cannot be scrolled to — which is what cut the success tick in half on
     phones. margin-block:auto below still centres it whenever it does fit. */
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem 1rem;
  /* Short viewports must still be able to reach the dismiss button. */
  overflow-y: auto;
  overscroll-behavior: contain;
}
.verify-modal-overlay.is-open { display: flex; }

.verify-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--r-md);
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  /* Centres vertically when there is room, top-aligns when there is not. */
  margin-block: auto;
}

/* The pembiayaan confirmation carries a reference number plus next-step copy —
   420px squeezed it into a narrow column on laptops. */
.verify-modal--wide { max-width: 620px; padding: 2.25rem 2.5rem 2rem; }
/* Extra top padding on phones: the close button sits in that corner, and the
   success tick needs to clear it rather than tuck under it. */
@media (max-width: 600px) { .verify-modal--wide { padding: 2.5rem 1.5rem 1.75rem; } }

.verify-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.verify-modal__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--gold-light, rgba(251,191,36,0.15));
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}

.verify-modal__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.6rem;
}

.verify-modal__body {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}
.verify-modal__body strong { color: var(--navy); }

.verify-modal__btn { width: 100%; justify-content: center; }

/* ── Pembiayaan (loan) application form — mobile-first ─────────────────────── */
.pb-container { max-width: var(--container-max); }

/* Two-column shell — mirrors the keanggotaan form: guide sidebar LEFT (sticky),
   form RIGHT taking all remaining width (1fr) so it isn't a skinny column.
   Mobile: single column with the form first (order) and the guide beneath. */
.pb-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.pb-form-col { min-width: 0; order: 1; }     /* form first on mobile; let grids shrink */
.pb-guide { order: 2; }
.pb-guide__sticky { display: flex; flex-direction: column; gap: 1rem; }
.pb-guide__steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.pb-guide__steps li { font-family: var(--font-ui); font-size: 0.82rem; color: var(--fg-mid); line-height: 1.5; }
.pb-guide__note {
  font-family: var(--font-ui); font-size: 0.8rem; line-height: 1.55; color: var(--fg-mid);
  margin: 0 0 0.85rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--border);
}
.pb-guide__semak {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 0.9rem; min-height: 40px;
  font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600; color: var(--teal);
  text-decoration: none;
}
.pb-guide__semak:hover { text-decoration: underline; }
.pb-guide__semak svg { flex-shrink: 0; }
.pb-guide__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--navy);
  border-radius: var(--r-md);
  padding: 1.1rem 1.25rem;
}
.pb-guide__title {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.85rem; font-weight: 700; color: var(--navy);
  margin: 0 0 0.6rem;
}
.pb-guide__title svg { color: var(--gold-ink); flex-shrink: 0; }
.pb-guide__list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.pb-guide__list li { font-family: var(--font-ui); font-size: 0.82rem; color: var(--fg-mid); line-height: 1.5; }
.pb-guide__text { font-family: var(--font-ui); font-size: 0.82rem; color: var(--fg-mid); line-height: 1.55; margin: 0 0 0.75rem; }
.pb-guide__contact {
  display: flex; align-items: center; gap: 0.5rem;
  min-height: 40px;
  font-family: var(--font-ui); font-size: 0.85rem; font-weight: 600; color: var(--teal);
  text-decoration: none; word-break: break-word;
}
.pb-guide__contact svg { flex-shrink: 0; }

@media (min-width: 861px) {
  .pb-layout {
    grid-template-columns: 300px minmax(0, 1fr);   /* guide left, form takes the rest */
    gap: 2.5rem;
    align-items: start;
  }
  .pb-form-col, .pb-guide { order: 0; }            /* desktop: DOM order (guide left, form right) */
  /* Clear the sticky nav; the guide follows the scroll down the long form. */
  .pb-guide__sticky { position: sticky; top: calc(var(--nav-height, 72px) + 1.5rem); }
}
@media (min-width: 861px) and (max-width: 1050px) {
  .pb-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 1.75rem; }
}

.pb-intro {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.pb-intro__note {
  font-family: var(--font-ui);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--fg-mid);
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--cream-mid);
  border: 1px solid var(--border);
  border-left: 3px solid var(--navy);
  border-radius: var(--r-sm);
}
.pb-intro__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  min-height: 44px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}
.pb-intro__link:hover { text-decoration: underline; }

.pb-alert { margin-bottom: 1.25rem; }
.pb-required-note {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin: 0 0 1.25rem;
}

.pb-form { display: flex; flex-direction: column; gap: 1.5rem; }
.pb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Sections rendered as <fieldset> — strip the UA chrome, keep semantics. */
.pb-section {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: clamp(1rem, 3.5vw, 1.5rem);
  margin: 0;
  min-width: 0;               /* let grids shrink inside a fieldset on mobile */
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pb-section__title {
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 2.6vw, 1.18rem);
  font-weight: 600;
  color: var(--navy);
  padding: 0;
  margin-bottom: 0.25rem;
}

/* Touch targets: at least 44px on the controls people tap. */
.pb-form .field-input,
.pb-form .field-select { min-height: 44px; }
.pb-form .field-textarea { min-height: 72px; }
.pb-form .radio-chip { min-height: 44px; }

.pb-spouse-toggle { margin-bottom: 0.25rem; }
/* Accordion-style collapse: animate grid rows 0fr <-> 1fr so it opens/closes smoothly. */
.pb-spouse-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.pb-spouse-collapse.is-open { grid-template-rows: 1fr; }
.pb-spouse-fields { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 1rem; padding-top: 0.75rem; }
/* Per-product cap hint; briefly emphasised when it clamps a typed value. */
.pb-cap-hint { transition: color 0.2s ease; }
.pb-cap-hint.is-capped { color: #c0392b; font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .pb-spouse-collapse, .pb-cap-hint { transition: none; }
}
.pb-spouse-note {
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: var(--gold-light, rgba(184,147,90,0.12));
  border-radius: var(--r-sm);
  color: var(--fg-mid);
}
/* Proper drop zone: tall, centred, and obviously a target while dragging. */
.pb-file-label {
  width: 100%;
  max-width: 100%;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  min-height: 108px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.pb-file-label .file-upload-text { white-space: normal; font-weight: 600; color: var(--navy); }
.pb-file-drop-hint { font-family: var(--font-ui); font-size: 0.76rem; color: var(--fg-muted); }
.pb-file-label.file-upload-label--drag {
  border-style: solid;
  border-color: var(--navy);
  background: rgba(30,64,175,0.08);
  transform: scale(1.01);
}
@media (prefers-reduced-motion: reduce) { .pb-file-label { transition: none; } }
/* Bigger tap target for the per-file remove button on this form. */
.pb-file-remove { width: 32px; height: 32px; }

/* Auto-calculated readouts under a date field (age, length of service). */
/* `display:flex` outranks the UA's `[hidden] { display:none }`, so without this
   the readout sits there showing an em-dash before any date is entered. */
.pb-umur[hidden] { display: none; }
.pb-umur {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--fg-mid);
}
.pb-umur__label { font-weight: 600; color: var(--navy); }
.pb-umur__value { font-weight: 700; color: var(--navy); }
.pb-umur__note { font-size: 0.74rem; color: var(--fg-muted); }

/* Hint sits ABOVE the button (never beside it), button below. */
.pb-submit-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}
.pb-submit-hint {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--fg-muted);
}
/* Full width, matching the form column — a right-aligned pill looked detached.
   .btn-cta is inline-flex with no justify-content, so a full-width button
   leaves its label hugging the left edge — centre it here. */
.pb-submit { width: 100%; min-height: 48px; justify-content: center; }
.pb-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

/* ── Animated success tick (app-style confirmation) ───────────────────────── */
.pb-success-tick {
  width: clamp(56px, 16vw, 72px);
  height: clamp(56px, 16vw, 72px);
  margin: 0 auto 1rem;
}
.pb-success-tick svg { width: 100%; height: 100%; display: block; }
.pb-tick__circle {
  stroke: #1e9e5a;
  stroke-width: 3;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: pb-tick-circle 0.5s ease-out forwards;
}
.pb-tick__check {
  stroke: #1e9e5a;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: pb-tick-check 0.35s 0.45s ease-out forwards;
}
@keyframes pb-tick-circle { to { stroke-dashoffset: 0; } }
@keyframes pb-tick-check  { to { stroke-dashoffset: 0; } }

.pb-success-ref {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  padding: 0.75rem 1rem;
  margin: 0 auto 1rem;
  background: var(--cream-mid);
  border: 1px dashed var(--border-mid);
  border-radius: var(--r-sm);
}
.pb-success-ref__label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.pb-success-ref__value {
  font-family: var(--font-ui);
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.03em;
}
/* Sits inside the reference box, under the number itself. max-width keeps the
   dashed box from stretching to the full modal width just to fit one sentence. */
.pb-success-track {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 34ch;
  margin: 0.35rem 0 0;
}
/* "Didn't get the email?" note — quieter than the body, still readable. */
.pb-success-note {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: -0.5rem 0 1.1rem;
}
.pb-success-actions { display: flex; flex-direction: column; gap: 0.6rem; }
/* A full-bleed CTA looks stretched once the modal widens — cap and centre it
   instead, keeping the primary-above-dismiss order from mobile. */
@media (min-width: 600px) {
  .verify-modal--wide .pb-success-actions { align-items: center; }
  .verify-modal--wide .pb-success-actions > * { width: 100%; max-width: 340px; justify-content: center; }
}
.pb-success-dismiss {
  min-height: 44px;
  background: none;
  border: none;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
}
.pb-success-dismiss:hover { color: var(--navy); }

@media (prefers-reduced-motion: reduce) {
  .pb-tick__circle, .pb-tick__check { animation: none; stroke-dashoffset: 0; }
}

/* ── Semak (status tracking) page ──────────────────────────────────────────── */
.pb-semak-container { max-width: 640px; }
.pb-semak-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.pb-semak-submit { min-height: 48px; width: 100%; }
@media (min-width: 560px) {
  .pb-semak-submit { width: auto; min-width: 200px; align-self: flex-start; }
}

.pb-result {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: clamp(1.1rem, 4vw, 1.75rem);
}
.pb-result__heading {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  color: var(--navy);
  margin: 0 0 1.25rem;
}

/* Vertical milestone stepper — reads cleanly at every width. */
.pb-stepper { list-style: none; margin: 0; padding: 0; }
.pb-step { position: relative; display: flex; gap: 0.9rem; padding-bottom: 1.5rem; }
.pb-step--last { padding-bottom: 0; }
.pb-step::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--border-mid);
}
.pb-step--last::before { display: none; }
.pb-step--done::before { background: #1e9e5a; }

.pb-step__marker {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid var(--border-mid);
  color: var(--fg-muted);
}
.pb-step--done .pb-step__marker { background: #1e9e5a; border-color: #1e9e5a; color: #fff; }
.pb-step--current .pb-step__marker { border-color: var(--navy); color: var(--navy); box-shadow: 0 0 0 4px rgba(26,58,107,0.12); }

.pb-step__body { display: flex; flex-direction: column; gap: 0.15rem; padding-top: 0.3rem; }
.pb-step__label { font-family: var(--font-ui); font-size: 0.92rem; font-weight: 600; color: var(--navy); }
.pb-step--todo .pb-step__label { color: var(--fg-muted); font-weight: 500; }
.pb-step__state { font-family: var(--font-ui); font-size: 0.75rem; color: var(--fg-muted); }
.pb-step--current .pb-step__state { color: var(--navy); font-weight: 600; }

.pb-result__rejected {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem;
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: var(--r-sm);
  color: #c0392b;
}
.pb-result__rejected-title { font-family: var(--font-ui); font-weight: 700; color: #c0392b; margin: 0 0 0.2rem; }
.pb-result__rejected-note { font-size: 0.84rem; color: var(--fg-mid); margin: 0; }

.pb-result__hint { font-size: 0.82rem; color: var(--fg-muted); margin: 0.5rem 0 0; }

.pb-result__contact { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.pb-result__contact-note { font-family: var(--font-ui); font-size: 0.78rem; font-weight: 600; color: var(--fg-muted); margin: 0 0 0.5rem; }
.pb-result__contact-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.pb-result__contact-links a { font-family: var(--font-ui); font-size: 0.88rem; font-weight: 600; color: var(--teal); min-height: 44px; display: inline-flex; align-items: center; }

.pb-semak-mohon-link { text-align: center; margin-top: 1.5rem; }
.pb-semak-mohon-link a { font-family: var(--font-ui); font-size: 0.88rem; color: var(--teal); font-weight: 600; }


/* ── Email verification result page ──────────────────────────────────────────
   One outcome per visit: a tick or a warning, what happened, and one obvious
   next step. Shares the submission modal's tick so confirming reads as the same
   flow finishing rather than a different site. */
.verify-result {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}
.verify-result__icon {
  width: clamp(48px, 14vw, 60px);
  height: clamp(48px, 14vw, 60px);
  margin: 0 auto 1rem;
  color: #b45309;
}
.verify-result__icon svg { width: 100%; height: 100%; display: block; }
.verify-result__title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.65rem);
  line-height: 1.25;
  color: var(--navy);
  margin: 0 0 0.6rem;
}
.verify-result__body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--fg-mid);
  margin: 0 auto 1.5rem;
  max-width: 46ch;
}
.verify-result .pb-success-ref { margin-bottom: 1.5rem; }
.verify-result__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.verify-result__home {
  font-family: var(--font-ui);
  font-size: 0.84rem;
  color: var(--fg-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  /* 44px tap target (HIG) without pushing the two actions apart visually. */
  padding: 0.6rem 0.5rem;
}
.verify-result__home:hover,
.verify-result__home:focus-visible { color: var(--navy); }
.verify-result__help {
  margin-top: 1.75rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--fg-muted);
}
.verify-result__help a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
