/* ================================================================
   KBC Senarai Semak Perkembangan — Mobile-First CSS v8
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

#kbcp-wrap {
  font-family: 'Nunito', sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 60px;
  font-size: 15px;
  color: #2d1a0e;
  -webkit-text-size-adjust: 100%;
}

/* ── HERO ── */
.kbcp-hero {
  background: linear-gradient(135deg, #e8500a 0%, #c43d00 60%, #8b2500 100%);
  border-radius: 0 0 24px 24px;
  padding: 28px 20px 32px;
  text-align: center;
  margin-bottom: 20px;
}
.kbcp-logo-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.15);
  border-radius: 50px;
  padding: 7px 16px;
  margin-bottom: 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.kbcp-logo-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900;
  color: #e8500a;
  flex-shrink: 0;
}
.kbcp-hero h2 { color: #fff; font-size: 20px; font-weight: 800; margin-bottom: 6px; line-height: 1.3; }
.kbcp-hero p  { color: rgba(255,255,255,.82); font-size: 13px; line-height: 1.5; }

/* ── STEP INDICATOR ── */
.kbcp-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 16px;
  margin-bottom: 16px;
  overflow: hidden;
}
.kbcp-step {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #c8b0a0;
  white-space: nowrap;
  flex-shrink: 0;
}
.kbcp-step span {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #eeddd5;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: #c8b0a0;
  flex-shrink: 0;
}
.kbcp-step.active { color: #e8500a; }
.kbcp-step.active span { background: #e8500a; color: #fff; }
.kbcp-step.done { color: #28a745; }
.kbcp-step.done span { background: #28a745; color: #fff; }
.kbcp-step-line { flex: 1; height: 2px; background: #eeddd5; min-width: 12px; max-width: 48px; }

/* ── CARD ── */
.kbcp-card {
  background: #fff;
  border: 1.5px solid #f0d8cc;
  border-radius: 18px;
  padding: 20px 16px;
  margin: 0 12px 16px;
  box-shadow: 0 2px 16px rgba(232,80,10,.07);
}
.kbcp-hidden { display: none !important; }

.kbcp-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #2d1a0e;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.kbcp-num {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: #e8500a;
  color: #fff;
  font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── FORM FIELDS ── */
.kbcp-field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.kbcp-field { margin-bottom: 12px; }
.kbcp-field label, .kbcp-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #6a4030;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.req { color: #e8500a; }
.kbcp-field-hint { display: block; font-size: 11px; color: #a07060; margin-top: 4px; }

.kbcp-field input[type="text"],
.kbcp-field input[type="email"],
.kbcp-field select,
.kbcp-field textarea {
  width: 100%;
  border: 1.5px solid #e8d0c4;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: 'Nunito', sans-serif;
  color: #2d1a0e;
  background: #fffaf8;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px; /* touch target */
}
.kbcp-field input:focus,
.kbcp-field select:focus,
.kbcp-field textarea:focus {
  outline: none;
  border-color: #e8500a;
  box-shadow: 0 0 0 3px rgba(232,80,10,.12);
  background: #fff;
}
.kbcp-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%23e8500a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.kbcp-field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }

/* ── USIA BOX ── */
.kbcp-usia-box {
  background: #fff8f5;
  border: 1.5px solid #f0d8cc;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}
.kbcp-usia-label {
  font-size: 11px; font-weight: 700; color: #a07060;
  text-transform: uppercase; letter-spacing: .7px;
  margin-bottom: 10px;
}
.kbcp-usia-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.kbcp-usia-pill {
  background: #e8500a; color: #fff;
  font-size: 14px; font-weight: 800;
  padding: 6px 16px;
  border-radius: 50px;
}
.kbcp-peringkat-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid #e8500a;
  border-radius: 50px; padding: 7px 14px;
  font-size: 13px; font-weight: 700; color: #e8500a;
}

/* ── DOMAIN TABS ── */
.kbcp-domain-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 14px;
  /* snap scrolling for mobile swipe */
  scroll-snap-type: x proximity;
}
.kbcp-domain-tabs::-webkit-scrollbar { display: none; }

.kbcp-dtab {
  border: 1.5px solid #e8d0c4;
  background: #fff;
  border-radius: 50px;
  padding: 9px 16px;
  font-size: 13px; font-weight: 700;
  color: #a07060;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 44px;
  transition: all .15s;
  scroll-snap-align: start;
}
.kbcp-dtab:hover, .kbcp-dtab:active { border-color: #e8500a; color: #e8500a; }
.kbcp-dtab.active { background: #e8500a; border-color: #e8500a; color: #fff; }
.kbcp-dtab.kbcp-dtab-done:not(.active) { border-color: #28a745; color: #28a745; background: #f0fff4; }

/* ── DOMAIN PANEL ── */
.kbcp-domain-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: #fff0ea;
  border-radius: 12px 12px 0 0;
  font-size: 13px; font-weight: 700; color: #c43d00;
  border: 1.5px solid #f0d8cc;
  border-bottom: none;
}
.kbcp-mini-prog { font-size: 12px; font-weight: 800; color: #e8500a; }

/* ── CHECKLIST ── */
.kbcp-checklist-header {
  display: grid;
  grid-template-columns: 28px 1fr 52px;
  gap: 6px;
  padding: 8px 12px;
  background: #fff8f5;
  font-size: 11px; font-weight: 700; color: #a07060;
  border: 1.5px solid #f0d8cc;
  border-top: none;
  border-bottom: none;
}
/* hide tarikh & catatan headers on mobile — shown inline on row */
.kbcp-checklist-header span:nth-child(4),
.kbcp-checklist-header span:nth-child(5) { display: none; }

.kbcp-cl-item {
  display: grid;
  grid-template-columns: 28px 1fr 52px;
  gap: 6px;
  padding: 12px 12px 8px;
  border: 1.5px solid #f0d8cc;
  border-top: none;
  background: #fff;
  align-items: start;
  transition: background .15s;
}
.kbcp-cl-item:last-child { border-radius: 0 0 12px 12px; }
.kbcp-cl-item:nth-child(even) { background: #fffaf8; }

/* On mobile, tarikh + catatan go below perkara text in their own row */
.kbcp-cl-bottom {
  grid-column: 2 / 4;
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.kbcp-cl-bottom input {
  flex: 1;
  border: 1.5px solid #e8d0c4;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: 'Nunito', sans-serif;
  color: #2d1a0e;
  background: #fff;
  min-height: 40px;
  -webkit-appearance: none;
}
.kbcp-cl-bottom input:focus {
  outline: none; border-color: #e8500a;
  box-shadow: 0 0 0 2px rgba(232,80,10,.1);
}
.kbcp-cl-bottom input::placeholder { color: #c8b0a0; font-size: 12px; }

.kbcp-cl-num {
  font-size: 11px; font-weight: 800; color: #e8500a;
  padding-top: 3px; text-align: center;
}
.kbcp-cl-text { font-size: 14px; color: #2d1a0e; line-height: 1.45; }

/* Checkbox — large touch target */
.kbcp-cl-ya {
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 2px;
}
.kbcp-ya-checkbox {
  width: 28px; height: 28px;
  border: 2px solid #e8d0c4;
  border-radius: 8px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  flex-shrink: 0;
  transition: all .15s;
  position: relative;
}
.kbcp-ya-checkbox:checked {
  background: #e8500a;
  border-color: #e8500a;
}
.kbcp-ya-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 5px; left: 8px;
  width: 6px; height: 11px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* ── OVERALL PROGRESS ── */
.kbcp-overall-progress {
  background: #fff8f5;
  border: 1.5px solid #f0d8cc;
  border-radius: 14px;
  padding: 14px;
  margin-top: 16px;
}
.kbcp-overall-label {
  display: flex; justify-content: space-between;
  font-size: 13px; font-weight: 700; color: #5a3a28;
  margin-bottom: 8px;
}
#kbcp-overall-pct { color: #e8500a; font-size: 16px; font-weight: 900; }

/* ── PROGRESS BAR ── */
.kbcp-progress-bar {
  height: 8px;
  background: #f0d8cc;
  border-radius: 50px;
  overflow: hidden;
}
.kbcp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e8500a, #ff6b2b);
  border-radius: 50px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
  width: 0%;
}

/* ── BUTTONS ── */
.kbcp-btn {
  display: block;
  width: 100%;
  border: none;
  background: #e8500a;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  padding: 15px 20px;
  border-radius: 14px;
  cursor: pointer;
  transition: all .2s;
  margin-top: 10px;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: .2px;
}
.kbcp-btn:active { transform: scale(.97); }
.kbcp-btn:hover  { background: #c43d00; }

.kbcp-btn-outline {
  background: transparent;
  border: 2px solid #e8500a;
  color: #e8500a;
}
.kbcp-btn-outline:hover, .kbcp-btn-outline:active { background: #fff0ea; }

.kbcp-btn-row { display: flex; gap: 10px; margin-top: 14px; }
.kbcp-btn-row .kbcp-btn { flex: 1; }

/* ── INFO BAR ── */
.kbcp-info-bar {
  background: #fff0ea;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #7a4020;
  margin-bottom: 14px;
  line-height: 1.5;
}
.kbcp-info-bar span { font-weight: 700; color: #c43d00; }

/* ── ERROR ── */
.kbcp-error {
  color: #c0392b;
  font-size: 13px;
  padding: 8px 0 2px;
  font-weight: 600;
  display: none;
}
.kbcp-error.show { display: block; }

/* ── SUMMARY ── */
.kbcp-summary-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.kbcp-summary-meta div {
  background: #fff8f5;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #f0d8cc;
}
.kbcp-summary-meta label {
  display: block;
  font-size: 10px;
  color: #a07060;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 3px;
}
.kbcp-summary-meta strong { font-size: 13px; color: #2d1a0e; word-break: break-word; }

.kbcp-sum-overall {
  text-align: center;
  padding: 16px;
  background: #fff0ea;
  border-radius: 14px;
  margin-bottom: 14px;
}
.kbcp-pct-big { font-size: 42px; font-weight: 900; color: #e8500a; line-height: 1; }
.kbcp-pct-big + small { font-size: 13px; color: #a07060; display: block; margin-top: 4px; }

.kbcp-sum-domains { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.kbcp-sum-domain {
  background: #fff8f5;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1.5px solid #f0d8cc;
}
.kbcp-sum-domain-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 700; color: #3d2010;
  margin-bottom: 6px;
}
.kbcp-sum-pct { font-size: 12px; color: #e8500a; font-weight: 800; }
.kbcp-sum-kesimpulan {
  padding: 12px 14px;
  background: #fff8f5;
  border-left: 4px solid #e8500a;
  border-radius: 8px;
  font-size: 13px; margin-top: 8px; line-height: 1.6;
}

/* ── SUCCESS ── */
.kbcp-success-icon {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #28a745, #1e7e34);
  color: #fff;
  font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  margin: 4px auto 16px;
  box-shadow: 0 4px 16px rgba(40,167,69,.3);
}

/* ── TABLET / DESKTOP ── */
@media (min-width: 520px) {
  .kbcp-hero { border-radius: 18px; margin: 12px 12px 20px; padding: 32px 28px 36px; }
  .kbcp-card { padding: 24px 22px; margin: 0 0 16px; }
  .kbcp-hero h2 { font-size: 23px; }

  /* Show tarikh & catatan headers on larger screens */
  .kbcp-checklist-header {
    grid-template-columns: 28px 1fr 52px 120px 1fr;
  }
  .kbcp-checklist-header span:nth-child(4),
  .kbcp-checklist-header span:nth-child(5) { display: block; }

  /* Show tarikh + catatan inline on larger screens */
  .kbcp-cl-item {
    grid-template-columns: 28px 1fr 52px 120px 1fr;
    align-items: center;
    padding: 10px 12px;
  }
  .kbcp-cl-bottom { display: none; }
  .kbcp-cl-tarikh-desk, .kbcp-cl-catatan-desk { display: block; }

  .kbcp-steps { font-size: 12px; }
  .kbcp-step { gap: 6px; font-size: 12px; }
  .kbcp-step span { width: 26px; height: 26px; font-size: 12px; }
}

@media (max-width: 519px) {
  .kbcp-cl-tarikh-desk, .kbcp-cl-catatan-desk { display: none; }
  .kbcp-field-group { grid-template-columns: 1fr; }
  .kbcp-summary-meta { grid-template-columns: 1fr; }
  .kbcp-step-line { min-width: 8px; max-width: 24px; }
}

/* ── ARAHAN ── */
.kbcp-arahan {
  background: #fff8f5;
  border: 1.5px solid #f0d8cc;
  border-left: 4px solid #e8500a;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kbcp-arahan p {
  font-size: 13px;
  color: #5a3a28;
  line-height: 1.65;
  margin: 0;
}
.kbcp-arahan strong { color: #c43d00; }
.kbcp-arahan u { text-decoration-color: #e8500a; }
@media (min-width: 520px) {
  .kbcp-arahan { margin: 0 0 18px; }
  .kbcp-arahan p { font-size: 14px; }
}
