/* ============================================
   Lab Profile Assessment - Stylesheet
   ============================================ */

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #eff6ff;
  --accent:        #7c3aed;
  --success:       #16a34a;
  --warning:       #d97706;
  --danger:        #dc2626;
  --gray-50:       #f9fafb;
  --gray-100:      #f3f4f6;
  --gray-200:      #e5e7eb;
  --gray-300:      #d1d5db;
  --gray-500:      #6b7280;
  --gray-700:      #374151;
  --gray-900:      #111827;
  --radius:        10px;
  --shadow:        0 2px 8px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 30px rgba(0,0,0,.12);
  --transition:    all .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  padding: 2.5rem 1rem;
  text-align: center;
}
.site-header h1 { font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.5px; }
.site-header p  { opacity: .85; margin-top: .5rem; font-size: 1.05rem; }

/* ── Container ─────────────────────────────── */
.container { max-width: 860px; margin: 0 auto; padding: 2rem 1rem 4rem; }

/* ── Card ──────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--primary-light);
}

/* ── Progress bar ──────────────────────────── */
.progress-wrap { position: sticky; top: 0; z-index: 100; background: #fff; padding: .75rem 1rem; box-shadow: var(--shadow); }
.progress-label { display: flex; justify-content: space-between; font-size: .85rem; color: var(--gray-500); margin-bottom: .4rem; }
.progress-bar-bg { background: var(--gray-200); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar    { background: linear-gradient(90deg, var(--primary), var(--accent)); height: 100%; border-radius: 99px; transition: width .4s ease; }

/* ── Respondent form ───────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .9rem; font-weight: 600; color: var(--gray-700); }
.form-group input {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .65rem .9rem;
  font-size: .95rem;
  transition: var(--transition);
  outline: none;
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ── Metaprogram block ─────────────────────── */
.meta-section { margin-bottom: .5rem; }
.meta-label {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: .2rem .7rem;
  border-radius: 99px;
  margin-bottom: 1rem;
}

/* ── Question ──────────────────────────────── */
.question { margin-bottom: 1.75rem; }
.question-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: .85rem;
  line-height: 1.5;
}
.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 700;
  margin-right: .5rem;
  flex-shrink: 0;
}

/* ── Options ───────────────────────────────── */
.options { display: flex; flex-direction: column; gap: .55rem; }
.option {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  background: #fff;
}
.option:hover { border-color: var(--primary); background: var(--primary-light); }
.option input[type="radio"] { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }
.option.selected { border-color: var(--primary); background: var(--primary-light); }
.option-label { font-size: .95rem; color: var(--gray-700); cursor: pointer; line-height: 1.5; }

/* ── Button ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: .4rem 1rem; font-size: .875rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Submit area ───────────────────────────── */
.submit-area {
  text-align: center;
  padding: 1.5rem;
  background: var(--primary-light);
  border-radius: var(--radius);
  border: 2px dashed var(--primary);
}

/* ── Alert ─────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .95rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.alert-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1d4ed8; }

/* ── Result chart ──────────────────────────── */
.result-grid { display: grid; gap: 1rem; }
.result-item { display: flex; flex-direction: column; gap: .4rem; }
.result-meta { display: flex; justify-content: space-between; align-items: center; }
.result-name { font-weight: 600; font-size: .95rem; color: var(--gray-700); }
.result-kategori { font-size: .85rem; font-weight: 700; color: var(--primary); }
.result-bar-wrap { background: var(--gray-100); border-radius: 99px; height: 10px; overflow: hidden; }
.result-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .6s ease; }

/* ── Admin table ───────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: var(--primary); color: #fff; padding: .75rem 1rem; text-align: left; font-weight: 600; white-space: nowrap; }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
tr:hover td { background: var(--gray-50); }

/* ── Freeze Kolom ───────────────────────────── */
.table-wrap{
  overflow-x:auto;
}

th:nth-child(1),
td:nth-child(1){
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  min-width: 60px;
}

th:nth-child(2),
td:nth-child(2){
  position: sticky;
  left: 60px;
  z-index: 3;
  background: #fff;
  min-width: 220px;
}

/* khusus header */
thead th:nth-child(1),
thead th:nth-child(2){
  z-index: 4;
  background: #2f5fe3; /* samakan warna header */
  color: #fff;
}

/* ── Stats row ─────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; text-align: center; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .85rem; color: var(--gray-500); margin-top: .25rem; }

/* ── Login ─────────────────────────────────── */
.login-wrap { max-width: 400px; margin: 6rem auto; }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo h2 { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.login-logo p  { color: var(--gray-500); font-size: .9rem; }

/* ── Nav ───────────────────────────────────── */
.admin-nav {
  background: var(--gray-900);
  color: #fff;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.admin-nav .brand { font-weight: 800; font-size: 1.1rem; padding: 1rem 0; color: #fff; text-decoration: none; }
.admin-nav a { color: var(--gray-300); text-decoration: none; padding: 1rem 0; font-size: .9rem; transition: color .2s; }
.admin-nav a:hover { color: #fff; }
.admin-nav .spacer { flex: 1; }

/* ── Footer ────────────────────────────────── */
.site-footer { text-align: center; padding: 2rem 1rem; color: var(--gray-500); font-size: .85rem; }

/* ── Utility ───────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex  { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-blue   { background: var(--primary-light); color: var(--primary); }
.badge-purple { background: #f5f3ff; color: var(--accent); }
.badge-green  { background: #f0fdf4; color: var(--success); }
