/* ============================================================
   components.css — form card, kalkulator, modal, upload, dll
   ============================================================ */

/* ── FORM CARD ───────────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  padding: 28px 24px;
  border: 1.5px solid var(--gray-100);
  position: sticky;
  top: 80px;
  scroll-margin-top: 80px;
}
.fc-head { margin-bottom: 18px; }
.fc-head-title {
  font-family: var(--font-disp);
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  position: relative;
  padding-left: 12px;
}
.fc-head-title::before {
  content: '';
  position: absolute;
  left: 0; top: 2px; bottom: 2px;
  width: 4px;
  background: var(--accent);
  border-radius: 4px;
}
.fc-head-sub { font-size: 12.5px; color: var(--gray-500); margin-top: 4px; }

/* ── LABELS & INPUTS ─────────────────────────────────────────── */
.fc-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 5px;
  margin-top: 14px;
}
.fc-label:first-of-type { margin-top: 0; }
.fc-note {
  font-weight: 400;
  color: var(--gray-500);
  font-size: 11.5px;
}
.fc-input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--gray-900);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  appearance: auto;
}
.fc-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(0,55,129,.1);
}
.fc-input::placeholder { color: var(--gray-300); }

/* ── DATE ROW ────────────────────────────────────────────────── */
.date-row {
  display: flex;
  gap: 10px;
  margin-top: 0;
}
.date-row > div { flex: 1; }

/* ── DURASI BADGE ────────────────────────────────────────────── */
.durasi-badge {
  margin-top: 8px;
  background: var(--navy-l);
  border: 1px solid #bed0f7;
  border-radius: var(--r-sm);
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-align: center;
}
.durasi-badge.warn {
  background: #FFF3E0;
  border-color: #FFCC80;
  color: #BF360C;
}

/* ── TIPE TABS ───────────────────────────────────────────────── */
.tipe-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.tipe-tab {
  flex: 1;
  padding: 9px 4px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gray-500);
  transition: all .15s;
  text-align: center;
}
.tipe-tab:hover { border-color: var(--navy); color: var(--navy); }
.tipe-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.tipe-info {
  font-size: 12px;
  color: var(--gray-500);
  background: var(--gray-50);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 4px;
  min-height: 30px;
}

/* ── PLAN TABS ───────────────────────────────────────────────── */
.plan-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.plan-tab {
  flex: 1;
  padding: 10px 4px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  transition: all .15s;
  text-align: center;
}
.plan-tab:hover { border-color: var(--accent); }
.plan-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-l);
}

/* ── WILAYAH DISPLAY ─────────────────────────────────────────── */
.wilayah-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-l);
  border-radius: var(--r-sm);
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-top: 6px;
}
.wilayah-display.excluded {
  background: #FFF3E0;
  color: #BF360C;
}
.wilayah-display strong { font-weight: 800; }

/* ── NOTES ───────────────────────────────────────────────────── */
.basic-note,
.plan-basic-note {
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: #7B5800;
  margin-top: 6px;
  line-height: 1.6;
}
.plan-basic-note { background: #EEF4FF; border-color: #bed0f7; color: var(--navy); }

.group-info-box {
  background: var(--navy-l);
  border: 1px solid #bed0f7;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--navy);
  margin-top: 6px;
  margin-bottom: 4px;
  line-height: 1.6;
}

/* ── PESERTA CARD ────────────────────────────────────────────── */
.peserta-card {
  border: 1.5px solid var(--gray-100);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  position: relative;
  background: var(--gray-50);
}
.peserta-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.btn-hapus-peserta {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #c0392b;
  font-size: 17px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  transition: background .15s;
}
.btn-hapus-peserta:hover { background: #fdecea; }
.sub-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
  margin: 12px 0 8px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── BTN ADD ─────────────────────────────────────────────────── */
.btn-add {
  background: none;
  border: 1.5px dashed var(--navy);
  color: var(--navy);
  border-radius: var(--r-sm);
  padding: 9px;
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: background .15s;
}
.btn-add:hover { background: var(--navy-l); }

/* ── BTN HITUNG ──────────────────────────────────────────────── */
.btn-hitung {
  width: 100%;
  padding: 14px;
  margin-top: 18px;
  background: linear-gradient(135deg, var(--navy), #0055c8);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-family: var(--font-disp);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,55,129,.3);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  letter-spacing: .2px;
}
.btn-hitung:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,55,129,.4); }
.btn-hitung:disabled { opacity: .6; transform: none; cursor: not-allowed; }

/* ── RESULT BOX ──────────────────────────────────────────────── */
.result-box {
  margin-top: 16px;
  background: linear-gradient(135deg, var(--navy), #0055c8);
  border-radius: var(--r-md);
  padding: 18px 20px;
  color: var(--white);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.rb-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  opacity: .85;
  border-bottom: 1px dashed rgba(255,255,255,.15);
  margin-bottom: 4px;
}
.rb-row em { font-style: normal; opacity: .7; font-size: 11px; }
.rb-subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  opacity: .8;
  margin-top: 4px;
}
.rb-divider {
  border: none;
  border-top: 1px dashed rgba(255,255,255,.3);
  margin: 10px 0;
}
.rb-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}
.rb-total span { font-size: 13px; opacity: .85; }
.rb-total strong {
  font-family: var(--font-disp);
  font-size: 22px;
  font-weight: 800;
}
.btn-beli {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-family: var(--font-disp);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255,107,0,.4);
  transition: transform .15s, box-shadow .15s;
}
.btn-beli:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,107,0,.5); }

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
  animation: fadeIn .2s ease;
}
.modal-box {
  background: var(--white);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--sh-lg);
  position: relative;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform:translateY(20px); opacity:0; } to { transform:none; opacity:1; } }
.modal-header {
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
  border-bottom: 1px solid var(--gray-100);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-family: var(--font-disp);
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
}
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--gray-500);
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.modal-close:hover { background: var(--gray-100); }
.modal-body { padding: 24px; }

/* ── MODAL SUMMARY ───────────────────────────────────────────── */
.modal-summary {
  background: var(--navy-l);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
}
.ms-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: var(--gray-600);
  border-bottom: 1px solid rgba(0,55,129,.08);
}
.ms-row:last-child { border: none; }
.ms-row b { color: var(--navy); font-weight: 700; }
.ms-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  border-top: 1px dashed var(--gray-300);
  padding-top: 10px;
}
.ms-total span { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.ms-total b {
  font-family: var(--font-disp);
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
}

/* ── UPLOAD AREA ─────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--r-md);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  margin-top: 5px;
  transition: border-color .15s, background .15s;
}
.upload-area:hover, .upload-area:focus {
  border-color: var(--navy);
  background: var(--navy-l);
  outline: none;
}
.upload-icon { font-size: 28px; margin-bottom: 8px; }
.upload-text { font-size: 13px; color: var(--gray-500); line-height: 1.5; }
.upload-text strong { color: var(--navy); }
.upload-text small { font-size: 11.5px; display: block; margin-top: 4px; }
.upload-input { display: none; }
.upload-preview {
  font-size: 12.5px;
  color: var(--green);
  margin-top: 8px;
  font-weight: 600;
  min-height: 18px;
}

/* ── PAYMENT OPTS ────────────────────────────────────────────── */
.payment-opts {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}
.payment-opt {
  flex: 1;
  border: 2px solid var(--gray-300);
  border-radius: var(--r-md);
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.payment-opt:hover { border-color: var(--navy); }
.payment-opt.selected {
  border-color: var(--navy);
  background: var(--navy-l);
}
.payment-opt input[type="radio"] { display: none; }
.po-icon { font-size: 24px; margin-bottom: 6px; }
.po-label { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.po-sub { font-size: 11.5px; color: var(--gray-500); margin-top: 3px; line-height: 1.4; }

.pay-info {
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 12.5px;
  color: #7B5800;
  line-height: 1.6;
}

/* ── BTN SUBMIT ──────────────────────────────────────────────── */
.btn-submit {
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  background: linear-gradient(135deg, var(--navy), #0055c8);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-family: var(--font-disp);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,55,129,.3);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,55,129,.4); }
.btn-submit:disabled { opacity: .6; transform: none; cursor: not-allowed; }

.modal-privacy {
  text-align: center;
  font-size: 11.5px;
  color: var(--gray-500);
  margin-top: 12px;
}

/* =============================================
   DOMESTIC FORM STYLES
   ============================================= */
.domestic-banner {
  background: linear-gradient(135deg, #003781, #0055c8);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.domestic-banner strong { font-weight: 800; }

.dom-tipe-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.dom-tipe-tab {
  flex: 1;
  padding: 10px 8px;
  border: 2px solid var(--gray-300);
  border-radius: var(--r-sm);
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
  transition: all .15s;
}
.dom-tipe-tab small { font-weight: 400; font-size: 11px; display: block; }
.dom-tipe-tab:hover { border-color: var(--navy); color: var(--navy); }
.dom-tipe-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.domestic-info-box {
  background: var(--navy-l);
  border: 1px solid #bed0f7;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin-top: 14px;
}

/* Wilayah display domestic */
.wilayah-display.domestic {
  background: #E8F5E9;
  color: #1B5E20;
  border: 1px solid #A5D6A7;
}

/* ── Upload per peserta ─────────────────────────────────────── */
.upload-note {
  background: #EEF4FF;
  border: 1px solid #bed0f7;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--navy);
  margin-bottom: 14px;
  line-height: 1.6;
}
.upload-peserta-block {
  margin-bottom: 16px;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--gray-50);
}
.upload-peserta-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.upload-row {
  display: flex;
  gap: 10px;
}
.upload-col { flex: 1; }
.upload-area-sm {
  border: 2px dashed var(--gray-300);
  border-radius: var(--r-sm);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  font-size: 22px;
}
.upload-area-sm:hover { border-color: var(--navy); background: var(--navy-l); }
.upload-text-sm { font-size: 11.5px; font-weight: 700; color: var(--gray-500); margin-top: 4px; }
.upload-preview-sm {
  font-size: 10.5px;
  color: var(--green);
  margin-top: 6px;
  font-weight: 600;
  min-height: 14px;
  line-height: 1.3;
  word-break: break-all;
}

/* ── Searchable Negara Dropdown ─────────────────────────────── */
.negara-search-wrap {
  position: relative;
}
.negara-search-wrap .fc-input {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.negara-search-wrap .fc-input[data-selected] {
  background-image: none;
}
.negara-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--navy);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(0,55,129,.15);
  max-height: 240px;
  overflow-y: auto;
  z-index: 200;
  -webkit-overflow-scrolling: touch;
}
.nd-group {
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
}
.nd-item {
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--gray-900);
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}
.nd-item:last-child { border: none; }
.nd-item:hover, .nd-item.nd-active {
  background: var(--navy-l);
  color: var(--navy);
  font-weight: 600;
}
.nd-disabled {
  color: var(--gray-300);
  cursor: not-allowed;
  font-size: 12.5px;
}
.nd-empty {
  padding: 14px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13.5px;
}

/* ── Payment Badge & Info Popup ─────────────────────────────── */
.po-badge {
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  background: #10B981;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 4px 8px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  letter-spacing: .2px;
}
.payment-opt {
  position: relative;
  padding-top: 28px; /* ruang untuk badge */
}
.payment-opt:not(.selected) .po-badge {
  display: none; /* badge hanya di card agen */
}

.payment-info-toggle {
  background: none;
  border: none;
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: block;
  margin-top: 6px;
  font-family: inherit;
}
.payment-info-toggle:hover { color: var(--accent); }

/* Popup */
.payment-info-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.pip-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(3px);
}
.pip-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 -8px 32px rgba(0,0,0,.15);
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.pip-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--gray-100);
  border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-700);
}
.pip-title {
  font-family: var(--font-disp);
  font-size: 17px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 18px;
}
.pip-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.pip-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.pip-label {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 14px;
  margin-bottom: 4px;
}
.pip-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.65;
}
.pip-divider {
  border: none;
  border-top: 1px solid var(--gray-100);
  margin: 16px 0;
}

/* ── Consent Checkbox ───────────────────────────────────────── */
.consent-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #EEF4FF;
  border: 1.5px solid #bed0f7;
  border-radius: var(--r-sm);
  margin-bottom: 14px;
  cursor: pointer;
}
.consent-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 1px;
  accent-color: var(--navy);
  cursor: pointer;
}
.consent-text {
  font-size: 12.5px;
  color: var(--gray-700);
  line-height: 1.6;
}
.consent-link {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Pemegang Polis Sama dengan Peserta 1 ───────────────────── */
.pemegang-sama-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  cursor: pointer;
  padding: 8px 0;
}
.pemegang-sama-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  accent-color: var(--navy);
  cursor: pointer;
}
.pemegang-sama-text {
  font-size: 12.5px;
  color: var(--gray-500);
  font-weight: 600;
}
