/* =====================================================
   CUSTOM.CSS — Modern (React/Tailwind-inspired)
   Author: Nazmi
   Scope ketat ke #limesurvey agar tak bentrok komponen lain
===================================================== */

/* ---------- Theme tokens (mudah ganti warna) ---------- */
:root {
  --primary: #009b4c;         /* blue-600 */
  --primary-hover: #057d40;   /* blue-700 */
  --text: #1f2937;            /* slate-800 */
  --muted: #6b7280;           /* slate-500 */
  --bg: #f8fafc;              /* slate-50 */
  --card: #ffffff;
  --border: #cbccce;          /* slate-200 */
  --border-strong: #d1d5db;   /* slate-300 */
  --ring: rgba(22, 250, 38, 0.149);
}

/* =====================================================
   BASE
===================================================== */
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

.question-container .ls-label-question {
    font-size: 18px;
    font-weight: 600;
    line-height: 29px;
}

.ls-answers label, .answer-item label, .control-label {
    font-weight: 500;
    font-size: 16px;
    line-height: 25px;
}


.ls-answers .ls-heading th, .ls-answers th {
    font-weight: 500;
    font-size: 1rem;
    line-height: 20px;
    color: #1f2937;
}

.table-hover > tbody > tr:hover > th {
    background-color: #cccccc33;
    color: #505050;
}
.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: rgb(231 231 231 / 8%);
}

#limesurvey h1, #limesurvey h2, #limesurvey h3, #limesurvey h4 {
  color: #111827;
  font-weight: 600;
}

#limesurvey p { color: #4b5563; margin-bottom: 1rem; }

/* =====================================================
   LAYOUT (biarkan fluid; jika mau boxed card, aktifkan blok komentar di bawah)
===================================================== */
/*
#limesurvey .survey-container,
#limesurvey .survey-question-container {
  max-width: 720px;
  margin: 2rem auto;
  background: var(--card);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  transition: box-shadow .2s ease, transform .2s ease;
}
#limesurvey .survey-container:hover { transform: translateY(-2px); }
*/

/* =====================================================
   QUESTION TITLES / HELP
===================================================== */
#limesurvey .question-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 1rem;
}
#limesurvey .question-help {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 1.25rem;
}

/* =====================================================
   FORM CONTROLS (input/select/textarea)
===================================================== */
#limesurvey .form-control,
#limesurvey .form-select,
#limesurvey textarea {
  background-color: #f9fafb !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 10px !important;
  padding: .5rem 1rem !important;
  font-size: 1rem !important;
  transition: all .15s ease-in-out;
}
#limesurvey .form-control:focus,
#limesurvey .form-select:focus,
#limesurvey textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--ring) !important;
  background-color: #fff !important;
  outline: none !important;
}

@media (max-width: 768px) {
#limesurvey .form-control,
#limesurvey .form-select,
#limesurvey textarea {
  background-color: #f9fafb !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 10px !important;
  padding: .5rem 1rem !important;
  font-size: 1rem !important;
  transition: all .15s ease-in-out;
  margin-top: 10px;
}
}
/* =====================================================
   ANSWERS (RADIO) — pill card + bullet custom
===================================================== */
/* =====================================================
   NAV BUTTONS — Next solid, Previous outline
===================================================== */

/* wrapper spacing agar rapi */
#navigator-container .ls-move-btn { margin: 0 .4rem; }

/* Next (solid primary) */
#limesurvey .ls-move-next-btn,
#limesurvey .btn-primary {
  background-color: var(--primary) !important;
  color: #fff !important;
  border: 2px solid var(--primary) !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
  padding: .5rem 2rem !important;
  transition: all .2s ease !important;
  box-shadow: none !important;
}
#limesurvey .ls-move-next-btn:hover,
#limesurvey .btn-primary:hover {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  transform: translateY(-1px);
}
#limesurvey .ls-move-next-btn:disabled {
  background-color:#cbd5e1!important; color:#fff!important; border-color:#cbd5e1!important;
}

/* Previous (outline white) -> hover jadi solid */
#limesurvey .ls-move-previous-btn {
  background-color:#fff!important;
  color: var(--primary) !important;
  border: 2px solid var(--primary) !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
  padding: .5rem 2rem !important;
  transition: all .2s ease !important;
  box-shadow: none !important;
}
#limesurvey .ls-move-previous-btn:hover {
  background-color: var(--primary) !important;
  color:#fff!important;
  border-color: var(--primary) !important;
  transform: translateY(-1px);
}
#limesurvey .ls-move-previous-btn:disabled {
  background-color:#f3f4f6!important;
  color:#9ca3af!important;
  border-color: var(--border) !important;
}

/* =====================================================
   PROGRESS
===================================================== */
#limesurvey .progress {
  height: 6px; border-radius: 3px; background-color: var(--border);
  margin-top: 1.2rem; overflow: hidden;
}
#limesurvey .progress-bar {
  background-color: var(--primary); height: 100%; border-radius: 3px;
  transition: width .3s ease;
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 768px) {
  #limesurvey .survey-container { margin: 1rem; padding: 1.5rem; }
  #limesurvey .question-title { font-size: 1.08rem; }
  #limesurvey .ls-move-btn,
  #limesurvey .btn-primary { width: 100%; text-align: center; }
}

/* =====================================================
   ANIMATION UTIL
===================================================== */
.fade-in { animation: fadeIn .3s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }


.space-col {
    margin-top: 1em;
    margin-bottom: 0em;
}

.control-label {
    margin-bottom: 0px;
}




/* =================== *#

/* Paksa semua state 'selected/success' jadi warna brand */
:root { --bs-success: var(--primary); } /* jaga-jaga jika theme pakai var bootstrap */

/*#limesurvey .form-check-input[type="radio"]:checked {*/
/*  background-color: var(--primary) !important;*/
/*  border-color: var(--primary) !important;*/
/*}*/

.radio-item input[type=radio]:checked + label {
color: var(--primary) !important;

}

/* Jika LimeSurvey memberi class text-success pada label/teks jawaban */
#limesurvey .answers-list .text-success,
#limesurvey .ls-answers .text-success,
#limesurvey .answer-item .text-success,
#limesurvey .control-label.text-success {
  color: var(--primary-hover) !important;
  font-weight: 600 !important;
}

/* Beberapa tema menaruh warna hijau di <span> dalam label */
#limesurvey .form-check-label .text-success,
#limesurvey .form-check-label span.text-success {
  color: var(--primary-hover) !important;
}

/* Saat radio checked, pastikan labelnya biru (backup untuk DOM berbeda) */
#limesurvey .form-check-input:checked + .form-check-label {
  color: var(--primary-hover) !important;
  font-weight: 600 !important;
}



/* ================= */




.btn-check:checked + .btn-outline-primary, .btn-check:active + .btn-outline-primary, .btn-outline-primary:active, .btn-outline-primary.active, .btn-outline-primary.dropdown-toggle.show {
  color: #000;
  background-color: var(--primary);
  border-color: var(--primary;
}



/* =======================================================
   FIXES: spacing multiline, "Lainnya", checkbox, dan typo
   Letakkan di PALING BAWAH custom.css
======================================================= */

/* 0) PERBAIKI TYPO PADA RULE BOOTSTRAP OUTLINE BUTTON (kalau masih ada di file) */
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-outline-primary.dropdown-toggle.show {
  color: #000;
  background-color: var(--primary);
  border-color: var(--primary); /* <-- perbaikan tanda tutup ) */
}

/* 1) SPACING MULTILINE (opsi 2 baris tidak rapat) */
#limesurvey .ls-answers,
#limesurvey .answers-list {
  gap: .75rem !important;                 /* antar item lebih lega */
}

#limesurvey .form-check {
  padding: 14px 16px 14px 52px !important; /* dalam item lebih lega */
}

#limesurvey .form-check-label {
  line-height: 1.6 !important;            /* teks 2 baris tidak dempet */
  white-space: normal !important;         /* pastikan boleh turun baris */
}

/* 2) “LAINNYA, SEBUTKAN” — sejajarkan & beri jarak */
#limesurvey .answer-item .othertext,
#limesurvey .answer-item .other-text,
#limesurvey .othertext {
  display: block !important;
  margin-left: 52px !important;           /* sejajar dengan teks opsi */
  margin-top: 1rem !important;           /* jarak dari checkbox/label */
}

#limesurvey .othertext input,
#limesurvey .othertext textarea,
#limesurvey .answer-item .othertext input,
#limesurvey .answer-item .othertext textarea {
  width: 100% !important;
  border-radius: 10px !important;
  padding: .55rem .9rem !important;
  border: 1.5px solid var(--border) !important;
  background: #fff !important;
}

#limesurvey .othertext input:focus,
#limesurvey .othertext textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--ring) !important;
  outline: none !important;
}


@media (max-width: 768px) {
#limesurvey .form-control, #limesurvey .form-select, #limesurvey textarea {
    background-color: #f9fafb !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 10px !important;
    padding: .5rem 1rem !important;
    font-size: 1rem !important;
    transition: all .15s 
ease-in-out;
    margin-top: 10px;
}
}


/* 3) CHECKBOX MODERN (square + checkmark) */
#limesurvey .form-check-input[type=checkbox] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  position: absolute !important;
  inset: 0 auto 0 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  pointer-events: none !important;
}

/* kotak checkbox */
#limesurvey .form-check-input[type=checkbox] + .form-check-label::before {
  border-radius: 6px !important;
  width: 20px; height: 20px;
}

/* tanda centang: garis miring rotasi (-45deg) */
#limesurvey .form-check-input[type=checkbox] + .form-check-label::after {
  left: 26px; top: 50%;
  width: 10px; height: 6px;
  background: none;
  border: 2px solid transparent;
  border-left-color: var(--primary);
  border-bottom-color: var(--primary);
  transform: translate(-50%, -55%) rotate(-45deg) scale(0);
  transition: transform .15s ease;
}

/* focus ring */
#limesurvey .form-check-input[type=checkbox]:focus + .form-check-label::before {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

/* checked state: kotak biru muda + centang muncul */
#limesurvey .form-check-input[type=checkbox]:checked + .form-check-label::before {
  border-color: var(--primary);
  background-color: #eef2ff; /* very soft */
}
#limesurvey .form-check-input[type=checkbox]:checked + .form-check-label::after {
  transform: translate(-50%, -55%) rotate(-45deg) scale(1);
}


/* 5) MOBILE sticky nav: beri buffer lebih besar agar tidak terasa mepet */
@media (max-width: 768px) {
  #navigator-container { bottom: 12px; z-index: 20; position: sticky; padding: 12px 0;
    background: linear-gradient(180deg, rgba(248,250,252,0), var(--bg) 40%);
    backdrop-filter: blur(2px);
  }
  #limesurvey .survey-container,
  #limesurvey .container,
  #limesurvey .container-fluid { padding-bottom: 92px; }
  #limesurvey .ls-move-btn { min-width: 46%; margin: 0 .35rem !important; }
}


/* ===================== NAVIGATOR: sticky yang benar di mobile ===================== */
:root { --nav-h: 92px; } /* kira-kira tinggi bar tombol; ubah jika butuh */

/* 1) Hapus efek buffer bawah yang bikin tombol muncul terlalu cepat */
@media (max-width: 768px) {
  #limesurvey .survey-container,
  #limesurvey .container,
  #limesurvey .container-fluid {
    padding-bottom: 0 !important;        /* override hack sebelumnya */
  }
}

/* 2) Pastikan area konten minimal setinggi viewport - navigator */
@media (max-width: 768px) {
  /* pilih wrapper konten yang membungkus pertanyaan (fallback beberapa tema) */
  #limesurvey .survey-question-container,
  #limesurvey .survey-container,
  #limesurvey .outerframe,
  #limesurvey .container-fluid {
    min-height: calc(100vh - var(--nav-h)) !important;
  }

  /* sticky di bawah: awalnya di luar viewport (kalau konten panjang), 
     lalu menempel saat sudah terscroll ke posisinya */
  #navigator-container {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 20;
    padding: 12px 0;
    background: var(--bg);
    /* opsional, sedikit pemisah saat sudah menempel */
    box-shadow: 0 -6px 18px rgba(0,0,0,.03);
  }

  /* tombolnya tetap enak dipencet dan berbaris rapi */
  #limesurvey .ls-move-btn {
    min-width: 46%;
    margin: 0 .35rem !important;
  }
}


/* 1) Beat theme_apple: force block label and remove padding it adds */
.radio-item label {
  display: block !important;        /* <-- key: defeats `.radio-item label {display:inline}` */
  padding-left: 0 !important;
  vertical-align: baseline !important;
  white-space: normal !important;
}

/* 2) Make each radio item a two-column row: [bullet][text] */
.radio-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  list-style: none !important;
}

/* 3) Keep the bullet optically centered for your 25px line-height */
:root { --lh: 25px; --radio-size: 20px; }
.radio-item > input[type="radio"] {
  width: var(--radio-size) !important;
  height: var(--radio-size) !important;
  flex: 0 0 var(--radio-size) !important;
  margin: calc((var(--lh) - var(--radio-size)) / 2) 0 0 0 !important;
  accent-color: var(--primary) !important;
}

/* 4) Text styling (now it will wrap with a clean hanging indent) */
.radio-item > label.control-label {
  line-height: var(--lh) !important;
  margin: 0 !important;
  color: #4b5563 !important;
  cursor: pointer !important;
}

/* 5) Selected color (keeps brand blue, replaces green) */
.radio-item > input[type="radio"]:checked + label.control-label {
  color: var(--primary-hover) !important;
  font-weight: 600 !important;
}



