:root {
  --red: #d60000;
  --red-dark: #9f0b0b;
  --red-soft: #fff0f0;
  --orange: #ff9800;
  --orange-dark: #ff7b00;
  --orange-soft: #fff5e8;
  --bg: #fffaf7;
  --surface: #ffffff;
  --text: #501515;
  --muted: #8c5e5e;
  --border: #f0d9d5;
  --success: #0d8a5a;
  --danger: #c33a3a;
  --shadow: 0 14px 40px rgba(156, 25, 25, .10);
  --radius: 18px;
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(214, 0, 0, .08), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 152, 0, .10), transparent 28%),
    linear-gradient(180deg, #fffdfb 0%, var(--bg) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit
}

button {
  cursor: pointer
}

.topbar {
  background: #ffffff;
  color: var(--text);
  padding: 16px 24px;
  border-bottom: 1px solid #f1dfda;
  box-shadow: 0 6px 24px rgba(94, 22, 22, .08);
}

.brand {
  width: min(1160px, 100%);
  margin: 0 auto;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  width: 300px;
  max-width: 52vw;
  height: auto;
  display: block;
  object-fit: contain;
}

.brand-copy {
  text-align: right;
}

.brand-copy strong {
  display: block;
  font-size: 18px;
  line-height: 1.15;
  color: var(--red-dark);
}

.brand-copy span {
  display: block;
  font-size: 11px;
  color: var(--orange-dark);
  margin-top: 6px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 38px auto 64px;
}

.view {
  animation: fadeUp .28s ease
}

.hidden {
  display: none !important
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.welcome {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 28px
}

.welcome h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin: 4px 0 12px;
  color: var(--red-dark)
}

.welcome p {
  line-height: 1.7;
  margin: 0;
  color: var(--muted)
}

.welcome .muted {
  font-weight: 700;
  color: var(--orange-dark);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .08em
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
  max-width: 980px;
  margin: 0 auto;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-panel {
  max-width: none;
  margin: 0;
  padding: 28px;
  min-height: 100%;
}

.form-panel h2,
.questionnaire-panel h2 {
  margin-top: 0
}

.entry-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
}

.entry-icon.resume {
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.form-copy {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
  margin: -4px 0 8px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin: 18px 0 0;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid #e6c8c3;
  background: white;
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--text);
  outline: none;
  transition: .2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(214, 0, 0, .10);
}

textarea {
  resize: vertical
}

.btn {
  border-radius: 11px;
  padding: 12px 17px;
  border: 1px solid transparent;
  font-weight: 700;
}

.btn.primary {
  background: linear-gradient(135deg, var(--red), #e74100);
  color: #fff;
  box-shadow: 0 10px 20px rgba(214, 0, 0, .18);
}

.btn.secondary {
  width: 100%;
  margin-top: 24px;
  background: linear-gradient(135deg, #fff2ea, #fff8f1);
  color: var(--red-dark);
  border-color: #f0cdb4;
}

.form-panel .btn.primary {
  width: 100%;
  margin-top: 24px
}

.btn.ghost {
  background: #fff;
  color: var(--red-dark);
  border-color: #e2c3bf;
}

.btn.danger-ghost {
  background: #fff;
  color: var(--danger);
  border-color: #f0c7c7;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed
}

.resume-help {
  margin-top: 15px;
  font-size: 12px;
  line-height: 1.5;
  color: #9a7373;
  text-align: center;
}

.session-box {
  background: linear-gradient(135deg, #fff3f0, #fff7f0);
  border: 1px solid #f0d4cd;
  padding: 18px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.session-box strong {
  display: block;
  color: var(--red-dark)
}

.session-box span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 5px
}

.session-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.section-heading {
  margin: 28px 0 16px
}

.section-heading h2 {
  margin: 0;
  color: var(--red-dark);
  font-size: 26px
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted)
}

.notice {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
}

.notice.success {
  background: #e8f8f0;
  color: #0f6b49;
  border: 1px solid #bdebd4;
}


.lecturer-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
}

.lecturer-heading .btn {
  flex: 0 0 auto;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  min-height: 190px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  text-align: left;
  box-shadow: 0 10px 28px rgba(156, 25, 25, .08);
  transition: .2s ease;
  position: relative;
  overflow: hidden;
}

.category-card::after {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  right: -24px;
  bottom: -24px;
  background: rgba(255, 152, 0, .10);
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: #e9b6aa;
  box-shadow: 0 16px 34px rgba(156, 25, 25, .13);
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--red-soft), var(--orange-soft));
  color: var(--red);
  font-size: 23px;
  font-weight: 800;
  margin-bottom: 18px;
}

.category-card strong {
  display: block;
  color: var(--red-dark);
  font-size: 18px;
  line-height: 1.35;
}

.category-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.category-count {
  margin-top: 16px !important;
  font-weight: 800;
  color: var(--orange-dark) !important;
}

.lecturer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.lecturer-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  padding: 0;
  box-shadow: 0 8px 24px rgba(156, 25, 25, .08);
  transition: .2s ease;
}

.lecturer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 34px rgba(156, 25, 25, .14);
  border-color: #e5a297;
}

.lecturer-photo {
  width: 100%;
  height: 260px;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #f7f3ef;
  padding: 7px;
  flex-shrink: 0;
}

.lecturer-info {
  padding: 12px 15px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  flex: 1;
  min-height: 118px;
}

.lecturer-info strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 40px;
  color: var(--red-dark);
  font-weight: 700;
  line-height: 1.28;
  margin: 0;
}

.lecturer-info strong.name-normal {
  font-size: 16px;
}

.lecturer-info strong.name-sm {
  font-size: 14px;
}

.lecturer-info strong.name-xs {
  font-size: 12.5px;
}

.lecturer-info > span:not(.role-badge):not(.done-badge) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  margin: 1px 0 0;
  min-height: 30px;
}

.lecturer-info span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.role-badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: auto;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 999px;
}

.done-badge {
  display: inline-block;
  align-self: stretch;
  margin-top: 6px;
  margin-left: 0;
  background: #e8f8f0;
  color: #0f6b49;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 999px;
}

.back-link {
  background: transparent;
  border: 0;
  color: var(--red);
  font-weight: 700;
  padding: 4px 0;
  margin-bottom: 16px;
}

.lecturer-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(156, 25, 25, .08);
  margin-bottom: 18px;
}

.lecturer-summary img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 13px;
}

.lecturer-summary strong {
  display: block;
  font-size: 20px;
  color: var(--red-dark)
}

.lecturer-summary span {
  display: block;
  color: var(--muted);
  margin-top: 6px
}

.summary-badge {
  display: inline-block;
  margin-top: 10px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
}

.questionnaire-panel {
  padding: 28px
}

.question {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 24px;
  align-items: center;
  border-top: 1px solid #f5eae7;
  padding: 18px 0;
}

.question:first-child {
  border-top: 0
}

.question-title {
  font-weight: 700;
  line-height: 1.45
}

.rating {
  display: flex;
  gap: 9px;
  position: relative;
}

.rating input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  pointer-events: none;
}

.rating label {
  margin: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #e1c3be;
  background: white;
  cursor: pointer;
  transition: .16s ease;
}

.rating input:checked+label {
  background: var(--red);
  color: white;
  border-color: var(--red);
  box-shadow: 0 6px 16px rgba(214, 0, 0, .23);
}

.rating label:hover {
  border-color: var(--red);
  color: var(--red)
}

.comment-label {
  margin-top: 24px
}

.form-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(55, 16, 16, .56);
  display: grid;
  place-items: center;
  padding: 22px;
  z-index: 100;
}

.modal {
  width: min(480px, 100%);
  background: white;
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
}

.modal-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffe9e9;
  color: var(--red);
  font-size: 30px;
  font-weight: 800;
}

.modal-icon.refresh {
  background: #fff0e0;
  color: var(--orange-dark)
}

.modal h3 {
  font-size: 24px;
  margin: 4px 0 10px;
  color: var(--red-dark)
}

.modal p {
  color: var(--muted);
  line-height: 1.6
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px
}

footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto 20px;
  padding-top: 20px;
  border-top: 1px solid #f0dfda;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #a06767;
}


/* =========================================
   RESPONSIVE FINAL
   ========================================= */

@media (max-width: 1100px) {
  .lecturer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .lecturer-photo {
    height: 240px;
  }
}

@media (max-width: 800px) {
  .entry-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lecturer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .lecturer-photo {
    height: 210px;
    padding: 6px;
  }

  .lecturer-info {
    padding: 12px 13px 14px;
  }

  .lecturer-info strong {
    min-height: 38px;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 205px;
    max-width: 68vw;
  }

  .brand-copy {
    display: none;
  }

  .shell {
    width: min(100% - 20px, 1160px);
    margin-top: 22px;
  }

  .form-panel,
  .questionnaire-panel {
    padding: 18px;
  }

  .session-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-actions {
    width: 100%;
  }

  .session-actions .btn {
    flex: 1;
  }

  .lecturer-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  /* Satu card per baris */
  .lecturer-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    grid-auto-rows: auto;
    justify-items: center;
    align-items: start;
  }

  .lecturer-card {
    width: 100%;
    max-width: 340px;
    height: auto;
    min-height: 0;
    border-radius: 14px;
    align-self: start;
  }

  /* Foto dibuat lebih seimbang dengan ukuran card */
  .lecturer-photo {
    width: 100%;
    height: 230px;
    padding: 6px;
    object-fit: contain;
    object-position: center;
    background: #f7f3ef;
  }

  /* Deskripsi mengikuti isi, tidak menyisakan ruang kosong besar */
  .lecturer-info {
    padding: 10px 12px 12px;
    gap: 2px;
    min-height: 0;
    height: auto;
    flex: 0 0 auto;
  }

  .lecturer-info strong {
    min-height: 0;
    margin: 0;
    line-height: 1.25;
  }

  .lecturer-info strong.name-normal {
    font-size: 14px;
  }

  .lecturer-info strong.name-sm {
    font-size: 12.5px;
  }

  .lecturer-info strong.name-xs {
    font-size: 11.5px;
  }

  /* Area/divisi langsung dekat dengan nama */
  .lecturer-info > span:not(.role-badge):not(.done-badge) {
    min-height: 0;
    margin: 2px 0 0;
    font-size: 10.5px;
    line-height: 1.3;
  }

  .role-badge {
    margin-top: 6px;
    font-size: 10px;
    padding: 4px 7px;
  }

  .done-badge {
    margin-top: 7px;
    font-size: 10px;
    padding: 5px 8px;
  }

  .question {
    grid-template-columns: 1fr;
  }

  .rating {
    flex-wrap: wrap;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .shell {
    width: min(100% - 14px, 1160px);
  }

  .lecturer-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .lecturer-card {
    max-width: 320px;
  }

  .lecturer-photo {
    height: 215px;
    padding: 5px;
  }

  .lecturer-info {
    padding: 9px 11px 11px;
  }

  .lecturer-info strong.name-normal {
    font-size: 13.5px;
  }

  .lecturer-info strong.name-sm {
    font-size: 12px;
  }

  .lecturer-info strong.name-xs {
    font-size: 11px;
  }

  .lecturer-info > span:not(.role-badge):not(.done-badge) {
    font-size: 10px;
  }
}


/* =========================================
   KUISIONER 2026
   ========================================= */

.question-copy {
  min-width: 0;
}

.question-title {
  font-weight: 700;
  line-height: 1.4;
  color: var(--red-dark);
}

.question-description {
  margin-top: 5px;
  max-width: 690px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 400;
}

.comment-title {
  display: block;
  color: var(--red-dark);
  font-weight: 700;
}

.comment-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
}

@media (max-width: 600px) {
  .question {
    gap: 12px;
    padding: 16px 0;
  }

  .question-title {
    font-size: 13.5px;
  }

  .question-description {
    font-size: 11.5px;
    line-height: 1.5;
  }

  .rating {
    gap: 7px;
  }

  .rating label {
    width: 38px;
    height: 38px;
    font-size: 12px;
  }
}


/* =========================================
   V11 - CLICK / TOUCH FIX
   ========================================= */

.btn,
.back-link,
.category-card,
.lecturer-card {
  position: relative;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn,
.back-link {
  z-index: 3;
}

.category-card,
.lecturer-card {
  z-index: 1;
}

.category-card::before,
.category-card::after {
  pointer-events: none;
}

.session-box,
.lecturer-heading {
  position: relative;
  z-index: 2;
}


/* =========================================
   V12 - NAVIGATION BUTTON HARD FIX
   ========================================= */

#backToCategoriesBtn,
#backToLecturersBtn,
#cancelQuestionnaireBtn {
  position: relative !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  cursor: pointer !important;
  isolation: isolate;
}

#backToCategoriesBtn::before,
#backToCategoriesBtn::after,
#backToLecturersBtn::before,
#backToLecturersBtn::after,
#cancelQuestionnaireBtn::before,
#cancelQuestionnaireBtn::after {
  pointer-events: none !important;
}

.lecturer-heading,
#questionnaireView {
  position: relative;
  isolation: isolate;
}


/* =========================================
   V14.2 - MOBILE SUBMIT / MODAL FIX
   ========================================= */

/* Modal harus selalu berada di atas seluruh isi halaman */
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  pointer-events: auto !important;
  touch-action: manipulation;
}

/* Isi modal harus bisa menerima tap */
.modal,
.modal-actions,
#confirmSendBtn,
#confirmCancelBtn {
  position: relative;
  z-index: 1000000;
  pointer-events: auto !important;
  touch-action: manipulation;
}

/* Tombol kirim pada form tidak boleh menembus/menutupi modal */
#submitQuestionnaireBtn {
  position: relative !important;
  z-index: auto !important;
  pointer-events: auto !important;
  touch-action: manipulation;
}

/* Hindari elemen dekoratif menangkap sentuhan */
.modal::before,
.modal::after,
.modal-backdrop::before,
.modal-backdrop::after {
  pointer-events: none !important;
}

@media (max-width: 600px) {
  .modal-backdrop {
    align-items: center;
    justify-items: center;
    padding: 16px;
  }

  .modal {
    width: min(100%, 420px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-actions {
    width: 100%;
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
    min-height: 46px;
  }
}
/* =========================================
   CARD SUDAH DIEVALUASI
   ========================================= */

.lecturer-card.completed {
  background: #e7f8ef !important;
  border: 2px solid #32a66a !important;
  box-shadow: 0 8px 24px rgba(13, 138, 90, .15);
}

/* bagian foto */
.lecturer-card.completed .lecturer-photo {
  background: #d9f3e5 !important;
}

/* bagian informasi */
.lecturer-card.completed .lecturer-info {
  background: #e7f8ef !important;
}

/* nama instruktur */
.lecturer-card.completed .lecturer-info strong {
  color: #087647 !important;
}

/* area instruktur */
.lecturer-card.completed
.lecturer-info > span:not(.role-badge):not(.done-badge) {
  color: #39755a !important;
}

/* badge role */
.lecturer-card.completed .role-badge {
  background: #c9efd9 !important;
  color: #087647 !important;
}

/* badge SUDAH DIISI */
.lecturer-card.completed .done-badge {
  background: #0d8a5a !important;
  color: white !important;
  text-align: center;
}

/* tidak terlalu bergerak saat hover */
.lecturer-card.completed:hover {
  border-color: #0d8a5a !important;
  box-shadow: 0 12px 28px rgba(13, 138, 90, .22);
}
