/* ================================================================
   pages/simulasi.css — PT Asuransi Intra Asia
   Halaman: simulasi-kendaraan.php
   Mobile-first. Base = smartphone (<=480px).
   Breakpoints: 481 | 768 | 992
   Menggantikan: simulasi-kendaraan.css (desktop-first, max-width breakpoints)
   Dimuat via $page_head_styles -> terakhir di <head> -> menang cascade.

   PENTING — kontrak JS:
   .form-currency.is-invalid  -- dipakai validateHargaPasar() di simulasi-kendaraan.js
   .is-invalid                -- Bootstrap validation state (simulasi-kendaraan.js)
   JANGAN ubah nama kelas-kelas ini.

   Root cause 1 !important:
   .simulasi-warning-alert { border: 1px solid #ffe082 !important }
   Melawan Bootstrap .alert { border: 1px solid transparent } -- !important dipertahankan.
================================================================ */


/* ============================================================
   LAYOUT UTAMA
   ============================================================ */
.insurance-simulation {
  background: #f0f4f8;
  padding: 24px 0 40px;
  min-height: calc(100vh - 200px);
}

/* ============================================================
   SIDE MENU — disembunyikan di mobile/tablet, tampil di desktop
   ============================================================ */
.insurance-simulation-side-menu { display: none; }
.side-menu-mobile               { display: block; }
.insurance-simulation-card      { width: 100%; }

/* Side menu desktop */
.insurance-simulation-side-menu h6 {
  background: #f8f9fa;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  margin: 0;
  border-bottom: 1px solid #e9ecef;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.insurance-simulation-side-menu ul {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}
.insurance-simulation-side-menu ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: #444;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}
.insurance-simulation-side-menu ul li a:hover {
  background: #f0f7ff;
  color: #006eb9;
  border-left-color: #006eb9;
}
.insurance-simulation-side-menu ul li.active a {
  background: #e8f4fd;
  color: #006eb9;
  border-left-color: #006eb9;
  font-weight: 600;
}
.insurance-simulation-side-menu ul li a i {
  font-size: 16px;
  color: #006eb9;
}
.insurance-simulation-side-menu {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  position: sticky;
  top: 80px;
}

@media (min-width: 992px) {
  .insurance-simulation          { padding: 40px 0 60px; }
  .insurance-simulation-side-menu { display: block; }
  .side-menu-mobile               { display: none; }
}


/* ============================================================
   MOBILE SIDE MENU DROPDOWN
   ============================================================ */
.side-menu-mobile-btn {
  border-color: #006eb9;
  color: #006eb9;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.side-menu-modal-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.side-menu-modal-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  color: #444;
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}
.side-menu-modal-list li a:hover { background: #f0f7ff; color: #006eb9; }
.side-menu-modal-list li.active a { background: #e8f4fd; color: #006eb9; font-weight: 600; }


/* ============================================================
   JUDUL HALAMAN
   ============================================================ */
.insurance-simulation-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a2e4a;
  margin-bottom: 20px;
}
@media (min-width: 481px) {
  .insurance-simulation-title { font-size: 22px; }
}


/* ============================================================
   CARD UTAMA
   ============================================================ */
.insurance-simulation-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  overflow: visible;
}


/* ============================================================
   CARD HEADER
   ============================================================ */
.insurance-simulation-card-header {
  background: #1a2e4a;
  padding: 20px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  box-sizing: border-box;
}
.card-header-title { flex: 1; }
.card-header-title__big {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 8px;
}
.card-header-title__small {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  font-weight: 400;
}

/* Gambar header: tersembunyi di mobile kecil */
.card-header-image { display: none; }

@media (min-width: 481px) {
  .card-header-image {
    display: block;
    flex-shrink: 0;
    margin-left: 20px;
  }
  .card-header-image img {
    max-width: 80px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  }
  .card-header-title__big { font-size: 20px; }
}
@media (min-width: 768px) {
  .insurance-simulation-card-header { padding: 28px 32px; }
  .card-header-title__big           { font-size: 26px; }
  .card-header-image img             { max-width: 160px; }
}


/* ============================================================
   CARD CONTENT
   ============================================================ */
.insurance-simulation-card-content {
  padding: 16px;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .insurance-simulation-card-content { padding: 28px 32px; }
}


/* ============================================================
   FORM SECTIONS
   ============================================================ */
.form-section {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 24px;
  margin-bottom: 24px;
}
.form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.form-section-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 700;
  color: #1a2e4a;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f4f8;
}
.form-section-name i { font-size: 18px; color: #006eb9; }


/* ============================================================
   RADIO BUTTONS
   ============================================================ */
.form-radio-wrapper {
  display: flex;
  gap: 12px;
  flex-direction: column; /* mobile: stack vertically */
  flex-wrap: wrap;
}
.form-radio-container {
  width: 100%;
  min-width: unset;
  cursor: pointer;
}
.form-radio-container input[type="radio"] { display: none; }
.form-radio-container .radio-label {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: #f8f9fa;
  cursor: pointer;
  position: relative;
}
.form-radio-container input[type="radio"]:checked + .radio-label {
  border-color: #006eb9;
  background: #e8f4fd;
}
.radio-title { font-weight: 600; font-size: 14px; color: #333; }
.form-radio-container input[type="radio"]:checked + .radio-label .radio-title { color: #006eb9; }
.radio-desc { font-size: 12px; color: #888; margin-top: 3px; }
.form-radio-container input[type="radio"]:checked + .radio-label .radio-desc { color: #4da6d7; }

@media (min-width: 768px) {
  .form-radio-wrapper   { flex-direction: row; }
  .form-radio-container { flex: 1; min-width: 200px; width: auto; }
}


/* ============================================================
   TOOLTIP INFO PADA RADIO
   ============================================================ */
.radio-info {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
}
.radio-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c2d9ef;
  color: #006eb9;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: default;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.radio-info:hover .radio-info-icon { background: #006eb9; color: white; }
.radio-info-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: #1a2e4a;
  color: #f0f4f8;
  font-size: 12px;
  font-weight: 400;
  padding: 10px 12px;
  border-radius: 8px;
  z-index: 200;
  line-height: 1.55;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.radio-info-tooltip strong { display: block; margin-bottom: 4px; font-size: 12px; color: #7ecef4; }
.radio-info-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 6px;
  border-width: 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent #1a2e4a;
}
.radio-info-tooltip--left { right: auto; left: 0; }
.radio-info-tooltip--left::before { right: auto; left: 6px; }
.radio-info:hover .radio-info-tooltip { visibility: visible; opacity: 1; }

@media (min-width: 481px) {
  .radio-info-tooltip { width: 220px; }
  /* kanan: tooltip rata kanan; kiri: rata kiri (--left variant sudah handle) */
}


/* ============================================================
   CHECKBOXES
   ============================================================ */
.form-check-custom {
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: #f8f9fa;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0;
  box-sizing: border-box;
}
.form-check-custom:hover { border-color: #006eb9; background: #f0f7ff; }
.form-check-custom:has(.form-check-input:checked) { border-color: #006eb9; background: #e8f4fd; }
.form-check-custom .form-check-input { margin-top: 0; flex-shrink: 0; }
.form-check-custom .form-check-label {
  font-size: 14px;
  color: #444;
  cursor: pointer;
  padding-left: 6px;
  line-height: 1.4;
}
.form-check-custom:has(.form-check-input:checked) .form-check-label {
  color: #006eb9;
  font-weight: 600;
}


/* ============================================================
   INPUT CURRENCY — kontrak JS: .form-currency.is-invalid JANGAN DIUBAH
   ============================================================ */
.form-currency {
  display: flex;
  align-items: stretch;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-currency:focus-within {
  border-color: #006eb9;
  box-shadow: 0 0 0 3px rgba(0,110,185,0.15);
}
.currency-prefix {
  padding: 0 14px;
  background: #f0f4f8;
  border-right: 1px solid #dee2e6;
  font-weight: 700;
  color: #555;
  font-size: 15px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.form-currency .form-control {
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 10px 14px;
  height: 44px;
  font-size: 15px;
  box-sizing: border-box;
}
.form-currency .form-control:focus { box-shadow: none; border: none; outline: none; }
.form-currency.is-invalid { border-color: #dc3545; } /* dipakai validateHargaPasar() */


/* ============================================================
   BENEFIT TOGGLE CARD
   ============================================================ */
.form-green-card {
  background: #f0fff4;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}
.form-green-card .form-label { color: #155724; font-weight: 600; margin-bottom: 8px; }


/* ============================================================
   TOMBOL SUBMIT
   ============================================================ */
.btn-simulasi-asuransi {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  background: #006eb9;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 52px;
  gap: 8px;
  box-sizing: border-box;
}
.btn-simulasi-asuransi:hover:not(:disabled) {
  background: #005a9c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,110,185,0.3);
}
.btn-simulasi-asuransi:disabled {
  background: #b0bec5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


/* ============================================================
   RINGKASAN HASIL (RESULT)
   ============================================================ */
.simulasi-result-summary {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  margin-bottom: 20px;
}
.simulasi-result-summary-header {
  background: #f8f9fa;
  padding: 16px 24px;
  border-bottom: 1px solid #e9ecef;
  font-size: 13px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.simulasi-result-summary-body {
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-direction: column; /* mobile: stack */
}
.summary-item { flex: 0 0 auto; }
.summary-item-label { font-size: 12px; color: #888; margin-bottom: 2px; }
.summary-item-value { font-size: 14px; font-weight: 600; color: #1a2e4a; }

@media (min-width: 768px) {
  .simulasi-result-summary-body { flex-direction: row; gap: 12px 24px; }
}


/* ============================================================
   KARTU HASIL
   ============================================================ */
.simulasi-result-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  overflow: hidden;
}
.simulasi-result-header {
  background: #1a2e4a;
  padding: 20px 16px;
  color: white;
  box-sizing: border-box;
}
.simulasi-result-header h4 { margin: 0; font-size: 20px; font-weight: 700; color: #ffffff; }
.simulasi-result-header p  { margin: 4px 0 0; opacity: 0.75; font-size: 14px; }
.simulasi-result-body      { padding: 16px; box-sizing: border-box; }

@media (min-width: 768px) {
  .simulasi-result-header { padding: 24px 32px; }
  .simulasi-result-body   { padding: 28px 32px; }
}


/* ============================================================
   BARIS HASIL
   ============================================================ */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
  gap: 12px;
}
.result-row:last-child { border-bottom: none; }
.result-row.result-total {
  font-weight: 700;
  font-size: 18px;
  border-top: 2px solid #e9ecef;
  border-bottom: none;
  padding-top: 16px;
  margin-top: 4px;
}
.result-label { color: #555; }
.result-value  { font-weight: 600; color: #1a2e4a; text-align: right; }
.result-total .result-label { color: #1a2e4a; }
.result-total .result-value {
  color: #006eb9;
  font-size: 17px; /* mobile */
}
@media (min-width: 481px) {
  .result-total .result-value { font-size: 20px; }
}

.result-unit { font-size: 12px; color: #888; font-weight: 400; display: block; }
.result-benefit-row { padding-left: 16px; border-left: 3px solid #e8f4fd; }
.result-benefit-row .result-label { color: #777; font-size: 14px; }
.result-benefit-row .result-value { font-size: 14px; color: #555; font-weight: 500; }

.result-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #006eb9;
  padding: 14px 0 6px;
  border-bottom: 1px dashed #dee2e6;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.result-section-title:first-child { padding-top: 0; }

.result-detail-row {
  padding: 10px 0 10px 8px;
  border-bottom: 1px solid #f5f5f5;
}
.result-detail-row:last-of-type { border-bottom-color: transparent; }
.result-detail-row .result-label { display: flex; flex-direction: column; gap: 2px; }

.result-formula { font-size: 11px; color: #aaa; font-weight: 400; font-style: italic; }

.result-subtotal-row {
  background: #f8fafc;
  padding: 11px 12px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  margin: 4px 0;
}
.result-subtotal-row .result-label { font-weight: 600; color: #1a2e4a; display: flex; flex-direction: column; gap: 2px; }
.result-subtotal-row .result-value { font-weight: 700; color: #1a2e4a; }

.result-badge {
  background: #e8f4fd;
  color: #006eb9;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #b8ddf5;
}


/* ============================================================
   TOMBOL APPLY (CTA)
   ============================================================ */
.simulasi-apply-card {
  background: linear-gradient(135deg, #006eb9, #0090d1);
  border-radius: 12px;
  padding: 20px 16px;
  color: white;
  margin-top: 24px;
  text-align: center;
}
.simulasi-apply-card h5 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.simulasi-apply-card p  { opacity: 0.85; margin-bottom: 20px; font-size: 15px; }
@media (min-width: 768px) {
  .simulasi-apply-card { padding: 28px 32px; }
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: white;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-wa:hover {
  background: #1da851;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,211,102,0.45);
}
.btn-back-simulasi {
  color: #006eb9;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 6px 0;
  transition: color 0.2s ease;
}
.btn-back-simulasi:hover { color: #005a9c; }


/* ============================================================
   RESULT TOPBAR (back + PDF button)
   ============================================================ */
.result-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.btn-save-pdf {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #c0392b;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-save-pdf:hover {
  background: #a93226;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(192,57,43,0.35);
}


/* ============================================================
   SESSION WARNING — 1 !important: melawan Bootstrap .alert { border:1px solid transparent }
   ============================================================ */
.simulasi-warning-alert {
  background: #fff8e1;
  border: 1px solid #ffe082 !important;
  color: #7b5300;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}
.simulasi-warning-alert i { color: #e65100; }


/* ============================================================
   PRINT / PDF STYLES
   ============================================================ */
.print-only { display: none; }

@media print {
  select,
  .side-menu-mobile,
  [data-bs-toggle="modal"],
  .dropdown-simulasi,
  button {
    display: none !important;
  }
  iframe,
  div[id*="privas"],
  div[class*="privas"],
  #privas-widget,
  .privas-widget,
  [data-privas],
  div[style*="position: fixed"],
  div[style*="position:fixed"] {
    display: none !important;
  }
  .no-print,
  #header,
  header, nav, .navbar,
  footer, .footer,
  .insurance-simulation-side-menu,
  .side-menu-modal-list,
  #sideMenuModal,
  .simulasi-apply-card,
  .result-topbar,
  .simulasi-warning-alert,
  iframe,
  div[style*="position: fixed"],
  div[style*="position:fixed"] {
    display: none !important;
  }
  .print-only { display: block !important; }
  body, .main, section, .insurance-simulation {
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .container { max-width: 100% !important; padding: 0 !important; }
  .insurance-simulation-content { display: block !important; }
  .col-lg-8 { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }
  .insurance-simulation-title { display: none; }

  .print-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1a2e4a;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
  .print-header-left { display: flex; align-items: center; gap: 12px; }
  .print-logo        { height: 40px; width: auto; }
  .print-company     { font-size: 14px; font-weight: 700; color: #1a2e4a; }
  .print-sub         { font-size: 11px; color: #888; }
  .print-doc-title   { font-size: 16px; font-weight: 700; color: #1a2e4a; text-align: right; }
  .print-doc-date    { font-size: 11px; color: #888; text-align: right; }

  .simulasi-result-summary,
  .simulasi-result-card {
    box-shadow: none !important;
    border: 1px solid #e0e0e0 !important;
    break-inside: avoid;
  }
  .simulasi-result-header {
    background: #1a2e4a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .simulasi-note-alert { break-inside: avoid; }
  a { text-decoration: none !important; color: inherit !important; }

  @page {
    margin: 1.5cm 1.5cm 1.5cm 1.5cm;
    size: A4 portrait;
  }
}
