/* ========== FONT SYSTEM (Mobile-first, system fonts) ========== */
/* Keyframe: blueGlow – pulsing box-shadow, 3 pulses with fade in/out, 3s total */
@keyframes blueGlow {
  0%, 33.33%, 66.67%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 rgba(44, 62, 124, 0);
  }
  16.67%, 50%, 83.33% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 20px 6px rgba(44, 62, 124, 0.45);
  }
}

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --color-primary: #2C3E7C;
  --color-gray-900: #111827;
  --color-gray-700: #374151;
  --color-gray-600: #4b5563;
  --color-green-600: #16a34a;
  --color-red-700: #b91c1c;
  --color-blue-600: #2563eb;
}

/* Kunci scroll mengufuk pada smartphone – body tak bergerak kiri–kanan (sama seperti index) */
html, body {
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-gray-900);
  background: #F8F9FA;
}

/* Latar halaman light grey seperti bolt.new */
.site-header {
  width: 100%;
  background: #2C3E7C;
  color: #fff;
  padding: 1.5rem 0.75rem 1rem;
}
@media (min-width: 640px) {
  .site-header { padding: 2rem 1rem 1rem; }
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s ease;
}
.logo:hover {
  opacity: 0.9;
}
.logo:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.logo-img {
  display: block;
  height: 32px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.logo:hover .logo-img {
  transform: scale(1.05);
}
.logo-wordmark {
  white-space: nowrap;
  color: #fff;
  font-size: 0;
  line-height: 1;
}
.logo-wordmark-light {
  font-weight: 300;
  font-size: 1.125rem;
}
.logo-wordmark-bold {
  font-weight: 700;
  font-size: 1.125rem;
}
@media (max-width: 639px) {
  .logo-wordmark { display: none; }
}
@media (min-width: 640px) {
  .logo-img { height: 40px; }
  .logo-wordmark-light,
  .logo-wordmark-bold { font-size: 1.25rem; }
}
@media (min-width: 1024px) {
  .logo-img { height: 48px; }
  .logo-wordmark-light,
  .logo-wordmark-bold { font-size: 1.5rem; }
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.header-nav a {
  color: inherit;
  text-decoration: none;
}
.header-nav a.btn-daftar {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
}
@media (min-width: 640px) {
  .header-nav a.btn-daftar { font-size: 1rem; }
}
.header-nav a.btn-daftar:hover {
  background: rgba(255, 255, 255, 0.3);
}
.header-nav a:focus,
.header-nav a.btn-daftar:focus,
.btn-icon:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: inherit;
  font-size: 1.25rem;
}

/* Task 7: Settings dropdown – wrapper (position relative for panel) */
.settings-dropdown-wrapper {
  position: relative;
  display: inline-block;
}
.settings-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 2rem));
  background: #fff;
  color: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0;
  z-index: 100;
  list-style: none;
}
.settings-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}
.settings-dropdown-item:hover {
  background: #f0f0f0;
}
.settings-dropdown-item--disabled {
  color: #9ca3af;
  cursor: not-allowed;
  font-weight: 400;
}
.settings-dropdown-item--disabled:hover {
  background: transparent;
}
.settings-dropdown-label {
  padding: 0.35rem 1rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.settings-dropdown-divider {
  height: 1px;
  margin: 0.25rem 0.5rem;
  background: #e5e7eb;
}
@media (max-width: 480px) {
  .settings-dropdown {
    min-width: 200px;
  }
}

/* Task 9: What's New modal */
.whatsnew-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  box-sizing: border-box;
}
.whatsnew-modal {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}
.whatsnew-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}
.whatsnew-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
}
.whatsnew-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  margin: -0.25rem -0.25rem -0.25rem 0;
}
.whatsnew-modal-close:hover {
  color: #1a1a1a;
}
.whatsnew-modal-body {
  padding: 1rem 1.25rem 1.25rem;
}
.whatsnew-card {
  padding: 1rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.whatsnew-card:last-child {
  border-bottom: none;
}
.whatsnew-card-title {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #2C3E7C;
}
.whatsnew-card-date {
  margin: 0 0 0.5rem 0;
  font-size: 0.8125rem;
  color: #6b7280;
}
.whatsnew-card-desc {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #374151;
}

/* Kawasan tajuk dalam header gelap (teks putih) – Task 13: berpusat, responsif */
.header-title-block {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 0.75rem 1.25rem;
  text-align: center;
}
.header-title-block .page-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.25rem 0;
  color: #fff;
}
.header-title-block .page-tagline {
  font-size: 1rem;
  line-height: 1.4;
  margin: 0;
  opacity: 0.9;
  color: #fff;
}
/* Tablet 640–767px */
@media (min-width: 640px) {
  .header-title-block { padding: 1rem 1rem 1.25rem; }
  .header-title-block .page-title { font-size: 1.875rem; }
  .header-title-block .page-tagline { font-size: 1.125rem; }
}
/* Laptop 768–1023px */
@media (min-width: 768px) {
  .header-title-block .page-title { font-size: 2.25rem; }
  .header-title-block .page-tagline { font-size: 1.25rem; }
}
/* PC ≥1024px */
@media (min-width: 1024px) {
  .header-title-block { padding: 1.25rem 1.5rem 1.5rem; }
  .header-title-block .page-title { font-size: 2.5rem; line-height: 1.2; }
  .header-title-block .page-tagline { font-size: 1.3125rem; }
}

/* Task 8.1: Desktop/tablet – layout dua lajur, max-width & gap konsisten */
.page-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
@media (min-width: 769px) {
  .page-main { padding: 1.5rem 1.5rem 2rem; }
}
.calculator-app {
  margin-top: 1rem;
}
.calculator-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  grid-template-areas: "input result";
}
@media (min-width: 1024px) {
  .calculator-layout { gap: 2rem; }
}
/* Panel kiri/kanan – kad putih dengan shadow (seperti bolt.new). Task 14: panel kiri full width. */
.calculator-input {
  grid-area: input;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
  min-height: 200px;
}
.calculator-result {
  grid-area: result;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
  min-height: 200px;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.calculator-result.result-panel-highlight {
  animation: blueGlow 3s ease-in-out;
  border-color: var(--color-primary);
}
.input-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e0e0e0;
  color: var(--color-gray-900);
}
@media (min-width: 768px) {
  .input-section-title { font-size: 1.875rem; }
}
.input-section-subtitle {
  font-size: 1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
  color: var(--color-gray-700, #374151);
}
/* Gaji + dropdown bersebelahan (desktop) */
.field-row-income {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.field-row-income .field-group {
  margin-bottom: 0;
}
@media (max-width: 600px) {
  .field-row-income {
    grid-template-columns: 1fr;
  }
}
.field-group {
  margin-bottom: 1rem;
}
.field-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--color-gray-700);
}
/* Task 14: input span penuh lebar kotak (hujung ke hujung) */
.field-group input[type="number"],
.field-group select {
  width: 100%;
  max-width: none;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
}
.field-group input[type="number"]:focus,
.field-group select:focus,
.calculator-input input:focus,
.calculator-input select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-color: var(--color-primary);
}
.calculator-input button:focus,
.calculator-input .btn:focus,
.calculator-input .btn-link-add:focus,
.calculator-input .btn-remove-row:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.field-group-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.field-group-checkboxes .checkbox-label {
  width: 100%;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: #444;
}
.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.checkbox-wrap input {
  width: auto;
  max-width: none;
}
.field-note {
  font-size: 0.75rem;
  color: var(--color-gray-600);
  margin: 0.35rem 0 0 0;
}
.checkbox-10percent-box {
  padding: 0.75rem 1rem;
  background: #f0f0f0;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}
.checkbox-10percent-box .field-note {
  margin-top: 0.5rem;
}
.tempoh-sesuai-text {
  margin: 0;
  font-size: 0.95rem;
}
.tempoh-sesuai-text .field-note {
  display: block;
  margin-top: 0.2rem;
}
.applicant-1-section {
  margin-bottom: 0;
  background: rgba(44, 62, 124, 0.04);
  border: 1px solid rgba(44, 62, 124, 0.18);
  border-left: 3px solid var(--color-primary);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.applicant-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid rgba(44, 62, 124, 0.25);
  letter-spacing: 0.01em;
}
.applicant-1-section .input-section-title:first-of-type {
  margin-top: 0;
}
/* JL Step 10: smooth expand/collapse */
.joint-loan-expand {
  border-top: 2px solid #d1d5db;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.3s ease, padding-top 0.3s ease;
}
.joint-loan-expand.joint-loan-expand--open {
  max-height: 2200px;
  opacity: 1;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
}
.joint-loan-expand.joint-loan-expand--open .applicant-2-section {
  animation: jointFormFadeIn 0.2s ease;
}
@keyframes jointFormFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.applicant-2-section {
  background: rgba(20, 184, 166, 0.06);
  border: 1px solid rgba(20, 184, 166, 0.25);
  border-left: 3px solid #14B8A6;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.applicant-2-title {
  color: #0d9488;
  border-bottom-color: rgba(20, 184, 166, 0.35);
}
.applicant-2-section .input-section-title:first-of-type {
  margin-top: 0;
}
/* JL Step 10: responsive – joint section & applicant cards on small screens */
@media (max-width: 639px) {
  .joint-loan-expand.joint-loan-expand--open {
    margin-top: 1rem;
    padding-top: 1rem;
  }
  .applicant-1-section,
  .applicant-2-section {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
  .applicant-2-section {
    padding: 0.875rem 1rem;
  }
}
@media (min-width: 640px) and (max-width: 768px) {
  .applicant-2-section {
    padding: 1rem 1.125rem;
  }
}
.applicant-2-placeholder {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  margin: 0;
}
.btn-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.btn-actions-row-1 {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}
.btn-actions-left {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 0%;
  min-width: 0;
}
.btn-actions-left .btn {
  width: 100%;
  flex: 1;
  min-height: 44px;
}
.btn-actions-note {
  font-size: 0.6875rem;
  color: var(--color-gray-600);
  line-height: 1.2;
}
.btn-actions-row-1 .btn {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 44px;
}
.btn-actions .btn-actions-row-1 + .btn,
.btn-actions .btn-reset {
  width: 100%;
}
.btn-joint-loan {
  background: #14B8A6;
  color: #fff;
  border: 1px solid #0d9488;
}
.btn-joint-loan:hover {
  background: #0d9488;
}
.btn-joint-loan:disabled {
  cursor: default;
  opacity: 0.85;
}
.btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  min-height: 44px;
  min-width: 140px;
  box-sizing: border-box;
}
@media (min-width: 640px) {
  .btn { font-size: 1rem; padding: 1rem 1.5rem; }
}
.btn-kira {
  background: var(--color-primary);
  color: #fff;
}
.btn-kira:hover {
  background: #1e3a5f;
  filter: brightness(0.9);
}
.btn-reset {
  background: #c00;
  color: #fff;
}
.btn-reset:hover {
  background: #a00;
}
.btn-link-add {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  padding: 0.25rem 0;
  text-decoration: underline;
}
.btn-link-add:hover {
  color: #1e3a5f;
}
.pendapatan-tambahan-expand {
  margin-top: 0.5rem;
}
.pendapatan-tambahan-expand .input-section-subtitle {
  margin-top: 0;
}
.pendapatan-lain-list {
  margin-bottom: 0.5rem;
}
/* Task 28: Row dinamik Tambah Komitmen Lain – seragam dengan .field-group input/select */
.komitmen-lain-list {
  margin-bottom: 0.5rem;
}
.komitmen-lain-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.komitmen-lain-row .komitmen-lain-type {
  min-width: 11rem;
  flex: 1 1 auto;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
  background-color: #fff;
  color: var(--color-gray-900);
}
.komitmen-lain-row .komitmen-lain-type:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-color: var(--color-primary);
}
.komitmen-lain-row .input-komitmen-lain {
  width: 7rem;
  min-width: 6rem;
  flex: 0 1 auto;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
}
.komitmen-lain-row .input-komitmen-lain:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-color: var(--color-primary);
}
.pendapatan-lain-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.pendapatan-lain-row input {
  width: 120px;
  max-width: none;
  padding: 0.4rem;
  font-size: 0.95rem;
}
.btn-remove-row {
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
}
.btn-remove-row:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
/* Task 15: Perkemas UI/UX Pendapatan Kasar & Pendapatan Bersih – label kiri, nilai kanan, mudah dibaca */
.income-summary {
  margin-top: 1rem;
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 1.25rem;
  background: #dbeafe;
  border-radius: 8px;
  font-size: 0.9375rem;
  color: #1e40af;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid rgba(30, 64, 175, 0.2);
}
.income-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 1.5em;
}
.income-summary-label {
  color: #1e40af;
  font-weight: 500;
}
.income-summary-value {
  color: #1565c0;
  font-weight: 700;
  font-size: 1.0625rem;
  text-align: right;
  flex-shrink: 0;
}
.income-summary .summary-value {
  color: #1565c0;
  font-weight: 700;
}
.komitmen-summary p {
  margin: 0.35rem 0;
}
.komitmen-summary p {
  margin: 0.35rem 0;
}
/* Task 16: Jumlah Komitmen Bank (atas) & Baki Pendapatan (bawah) – susunan menegak, full width, warna konsisten */
.komitmen-summary {
  margin-top: 1rem;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.summary-row-label {
  font-weight: 500;
  color: var(--color-gray-900);
}
.summary-row-value {
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}
/* Task 14 + 16: kotak ringkasan span penuh lebar panel; Jumlah Komitmen oren, Baki Pendapatan hijau */
.jumlah-komitmen-box {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 1rem;
  background: #fff5eb;
  border-radius: 8px;
  border: 1px solid #ffe4cc;
}
.jumlah-komitmen-box .komitmen-value {
  color: #c45a00;
  font-weight: 700;
}
.baki-pendapatan-box {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 1rem;
  background: #e8f5e9;
  border-radius: 8px;
  border: 1px solid #c8e6c9;
}
.baki-pendapatan-box .baki-pendapatan-value {
  color: var(--color-green-600);
  font-weight: 700;
}
.baki-pendapatan-value {
  color: var(--color-green-600);
  font-weight: 600;
}
.placeholder-text {
  color: #888;
  margin: 0;
}
.result-content {
  min-height: 120px;
}
.result-placeholder {
  color: #888;
  margin: 0;
}
.result-figures {
  margin: 0;
  scroll-margin-top: 1.5rem;
}
.result-hero {
  margin-bottom: 1rem;
}
.result-hero-label {
  font-size: 1rem;
  color: var(--color-gray-600);
  margin: 0 0 0.25rem 0;
}
@media (min-width: 768px) {
  .result-hero-label { font-size: 1.125rem; }
}
.result-hero-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
  line-height: 1.2;
}
@media (min-width: 768px) {
  .result-hero-value { font-size: 2.25rem; }
}
.result-hero-joint-increase {
  font-size: 0.875rem;
  color: #0d9488;
  margin: 0.35rem 0 0 0;
  font-weight: 600;
}
.result-joint-summary {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: rgba(20, 184, 166, 0.08);
  border-radius: 8px;
  border-left: 3px solid #14B8A6;
}
.result-joint-summary-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gray-700);
  margin: 0 0 0.5rem 0;
}
.result-joint-summary-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-gray-700);
}
.result-joint-summary-list li {
  margin: 0.2rem 0;
}
.result-ansuran-block {
  margin: 0 0 1rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}
.result-ansuran-label {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}
.result-ansuran-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
}
@media (min-width: 768px) {
  .result-ansuran-value { font-size: 1.25rem; }
}
.result-details-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  align-items: stretch;
}
.result-details-card .result-detail-box {
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e8ecf0;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 5.5rem;
  box-sizing: border-box;
}
.result-details-card .result-detail-box strong {
  display: block;
  font-size: 0.875rem;
  color: var(--color-gray-600);
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.result-details-card .result-detail-box .result-detail-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-detail-input-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 2.25rem;
}
.result-detail-input {
  width: 5.5rem;
  min-height: 2.25rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  padding: 0.5rem 0.5rem;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}
.result-detail-input:hover {
  border-color: var(--color-primary);
  background: #f8fafc;
}
.result-detail-input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-color: var(--color-primary);
  background: #fff;
}
.result-details-card .result-row {
  margin: 0.35rem 0;
}
.result-reveal-hint {
  margin: 1rem 0 0 0;
  font-size: 0.875rem;
  color: var(--color-gray-600);
}
.result-reveal {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}
@media (max-width: 600px) {
  .result-details-card {
    grid-template-columns: 1fr;
  }
  .result-details-card .result-detail-box {
    min-height: 5.5rem;
  }
}
.result-title {
  font-size: 1rem;
  margin: 0 0 0.75rem 0;
  color: #333;
}
.result-row {
  margin: 0.4rem 0;
  font-size: 0.95rem;
}
.result-row.result-max {
  font-size: 1.05rem;
  color: #1e3a5f;
}
.result-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
  color: var(--color-gray-900);
}
@media (min-width: 768px) {
  .result-subtitle { font-size: 1.5rem; }
}
.dsr-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
}
.dsr-status-line {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.dsr-status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
}
.dsr-status-badge.dsr-status-ok {
  background: #0a6b0a;
  color: #fff;
}
.dsr-status-badge.dsr-status-over {
  background: #c00;
  color: #fff;
}
.dsr-bar-block {
  margin-bottom: 1.25rem;
}
.dsr-bar-block:last-of-type {
  margin-bottom: 0.75rem;
}
.dsr-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.35rem;
}
.dsr-bar-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0;
}
.dsr-bar-dsr {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
}
.dsr-bar-caption {
  font-size: 0.8125rem;
  color: var(--color-gray-700);
  margin: 0.4rem 0 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.dsr-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}
.dsr-legend-item.caption-komitmen { color: #b91c1c; }
.dsr-legend-item.caption-loan { color: #ea580c; }
.dsr-legend-item.caption-baki { color: #15803d; }
.dsr-legend-bullet {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.dsr-legend-item.caption-komitmen .dsr-legend-bullet { background: #b91c1c; }
.dsr-legend-item.caption-loan .dsr-legend-bullet { background: #ea580c; }
.dsr-legend-item.caption-baki .dsr-legend-bullet { background: #15803d; }
.link-bank-calc {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  text-decoration: underline;
}
.link-bank-calc:hover {
  color: #1e3a5f;
}
.link-bank-calc:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.dsr-bar {
  display: flex;
  width: 100%;
  height: 1.5rem;
  border-radius: 4px;
  overflow: hidden;
  background: #eee;
}
.dsr-seg {
  transition: width 0.2s ease;
}
.dsr-seg-komitmen {
  background: #c00;
}
.dsr-seg-loan {
  background: #e85c0a;
}
.dsr-seg-baki {
  background: #0a6b0a;
}
.result-subtitle.result-section-title {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}
@media (min-width: 768px) {
  .result-subtitle.result-section-title { font-size: 1.875rem; }
}
.bank-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
  align-items: stretch;
}
@media (max-width: 480px) {
  .bank-cards {
    grid-template-columns: 1fr;
  }
}
.bank-card {
  padding: 0.85rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-sizing: border-box;
}
.bank-card-name {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--color-primary);
}
.bank-card-rate {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  margin: 0;
}
.bank-card-joint-note {
  font-size: 0.8125rem;
  color: #0d9488;
  margin: 0.35rem 0 0 0;
  line-height: 1.35;
}

/* Task 8.2: Mobile – stack menegak (input atas, result bawah), tap target ≥44px */
@media (max-width: 768px) {
  .calculator-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "input" "result";
    gap: 1.25rem;
  }
  .calculator-input,
  .calculator-result {
    min-height: 0;
  }
  .calculator-input .field-group input[type="number"],
  .calculator-input .field-group select {
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    max-width: none;
  }
  .calculator-input .btn,
  .calculator-input .btn-link-add {
    min-height: 44px;
    padding: 0.65rem 1rem;
    font-size: 1rem;
  }
  .calculator-input .btn-remove-row {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }
  .calculator-input .komitmen-lain-row .komitmen-lain-type,
  .calculator-input .komitmen-lain-row .input-komitmen-lain {
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
  }
  .calculator-input .pendapatan-lain-row input {
    min-height: 44px;
    padding: 0.5rem;
  }
  .calculator-input .checkbox-wrap {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0;
  }
}

/* Task 8.3: Aksesibiliti – focus visible, label, contrast */
.field-group label[for] {
  cursor: pointer;
}
.field-group input:focus-visible,
.field-group select:focus-visible,
.calculator-input input:focus-visible,
.calculator-input select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-color: var(--color-primary);
}
.calculator-input button:focus-visible,
.calculator-input .btn:focus-visible,
.calculator-input .btn-link-add:focus-visible,
.calculator-input .btn-remove-row:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.calculator-result .btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.calculator-input,
.calculator-result {
  color: var(--color-gray-900);
}
.input-section-title,
.result-title {
  color: var(--color-gray-900);
}

/* ========== Task #30: Kawasan footer – Penafian & copyright (aha moment) ========== */
.calculator-footer {
  font-family: var(--font-sans);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
  border-top: 1px solid #e5e7eb;
  background: #F8F9FA;
}
.calculator-footer .footer-disclaimer {
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 560px;
  margin: 0 auto 0.5rem;
  color: #979a99;
}
.calculator-footer .footer-disclaimer strong {
  font-weight: 700;
  color: #2d4271;
}
.calculator-footer .footer-copyright {
  font-size: 0.75rem;
  color: #787873;
  margin: 0;
}

/* ========== Task #31: Red Info Icon Set for Clear Communication ========== */
.label-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  margin-bottom: 0.35rem;
}
.label-row label {
  display: inline-block;
  margin-bottom: 0;
}
.label-row + input,
.label-row + select {
  margin-top: 0;
}
.info-icon-wrap {
  margin-left: 6px;
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #DC2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  font-family: var(--font-sans);
  line-height: 1;
  border: none;
  box-shadow: none;
  transition: opacity 0.15s ease;
}
.info-icon-wrap:hover .info-icon {
  opacity: 0.9;
}
.info-icon-wrap:focus {
  outline: none;
}
.info-icon-wrap:focus-visible .info-icon {
  outline: 2px solid #DC2626;
  outline-offset: 2px;
}
.info-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  max-width: 220px;
  width: max-content;
  font-size: 13px;
  line-height: 1.4;
  color: #1F2937;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.15s ease, opacity 0.15s ease;
  z-index: 100;
  pointer-events: none;
}
.info-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
}
.info-icon-wrap:hover .info-tooltip,
.info-icon-wrap.info-tooltip-open .info-tooltip {
  visibility: visible;
  opacity: 1;
}
@media (min-width: 640px) {
  .info-icon {
    width: 15px;
    height: 15px;
    font-size: 12px;
  }
}
@media (min-width: 1024px) {
  .info-icon {
    width: 16px;
    height: 16px;
    font-size: 12px;
  }
}

/* ========== Task 31b: Red Info Icon inside Komitmen Lain dropdown ========== */
.komitmen-lain-dropdown-wrap {
  position: relative;
  margin-right: 16px;
  min-width: 11rem;
  flex: 1 1 auto;
}
.komitmen-lain-dropdown-wrap .komitmen-lain-type {
  width: 100%;
  padding-right: 48px;
  margin: 0;
}
.komitmen-lain-row .komitmen-lain-dropdown-wrap .komitmen-lain-type {
  min-width: 0;
}
.info-icon-wrap--dropdown {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.info-icon--dropdown {
  width: 14px;
  height: 14px;
  font-size: 11px;
}
.info-icon-wrap--dropdown:hover .info-icon--dropdown,
.info-icon-wrap--dropdown.info-tooltip-open .info-icon--dropdown {
  opacity: 0.9;
}
.info-tooltip--dropdown {
  bottom: calc(100% + 8px);
  left: 50%;
  top: auto;
  transform: translateX(-50%);
  max-width: 200px;
  font-size: 12px;
  padding: 0.4rem 0.6rem;
}
.info-tooltip--dropdown::after {
  top: auto;
  bottom: -6px;
  border-top-color: transparent;
  border-bottom-color: #fff;
}
.info-icon-wrap--dropdown:hover .info-tooltip--dropdown,
.info-icon-wrap--dropdown.info-tooltip-open .info-tooltip--dropdown {
  visibility: visible;
  opacity: 1;
}
