/* ============================================================
   CSJ GROUP - Sistem Kuesioner Team Design
   Modern & Clean UI
   ============================================================ */

:root {
  --brand:        #2563eb;
  --brand-dark:   #1d4ed8;
  --brand-light:  #eff6ff;
  --brand-soft:   #dbeafe;

  --ink:          #0f172a;
  --ink-2:        #334155;
  --muted:        #64748b;
  --muted-2:      #94a3b8;
  --line:         #e2e8f0;
  --line-soft:    #f1f5f9;
  --bg:           #f6f8fb;
  --card:         #ffffff;

  --ok:           #10b981;
  --warn:         #f59e0b;
  --bad:          #ef4444;

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;

  --sh-sm: 0 1px 2px rgba(15,23,42,.05);
  --sh:    0 1px 3px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.12);
  --sh-lg: 0 4px 12px rgba(15,23,42,.06), 0 24px 48px -24px rgba(15,23,42,.25);

  --sidebar-w: 268px;
}

* { -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

h1,h2,h3,h4,h5,h6 { font-weight: 650; letter-spacing: -.015em; color: var(--ink); }

a { text-decoration: none; }

.text-muted-2 { color: var(--muted-2) !important; }
.fw-650 { font-weight: 650; }
.fs-13 { font-size: 13px; }
.fs-12 { font-size: 12px; }

/* ------------------------------------------------------------
   AUTH / LOGIN
   ------------------------------------------------------------ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--card);
}
.auth-hero {
  background: linear-gradient(150deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-hero::after {
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  right: -190px; bottom: -230px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.auth-hero::before {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  right: 60px; top: -160px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-brand { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; opacity: .85; font-weight: 600; }
.auth-title { font-size: 34px; font-weight: 700; color: #fff; line-height: 1.25; margin: 18px 0 14px; letter-spacing: -.02em; }
.auth-sub { opacity: .8; max-width: 420px; font-size: 15px; }
.auth-points { list-style: none; padding: 0; margin: 34px 0 0; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; font-size: 14.5px; opacity: .92; }
.auth-points i { margin-top: 3px; }
.auth-foot { font-size: 13px; opacity: .65; }

.auth-form {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
}
.auth-card { width: 100%; max-width: 390px; }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 36px 28px; }
  .auth-title { font-size: 26px; }
  .auth-points { display: none; }
}

/* ------------------------------------------------------------
   FORM CONTROLS
   ------------------------------------------------------------ */
.form-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-control, .form-select {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .62rem .85rem;
  font-size: 14.5px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(37,99,235,.12);
}
.input-group-text { background: var(--line-soft); border: 1px solid var(--line); border-right: 0; color: var(--muted); border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group > .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }

.btn { border-radius: var(--r-sm); font-weight: 600; font-size: 14.5px; padding: .6rem 1.1rem; transition: all .15s; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-lg { padding: .78rem 1.3rem; font-size: 15px; }
.btn-soft { background: var(--brand-light); color: var(--brand-dark); border: 1px solid var(--brand-soft); }
.btn-soft:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-white { background:#fff; border:1px solid var(--line); color: var(--ink-2); }
.btn-white:hover { background: var(--line-soft); color: var(--ink); }

/* ------------------------------------------------------------
   LAYOUT: SIDEBAR + MAIN
   ------------------------------------------------------------ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #0f172a;
  color: #cbd5e1;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 1040;
  transition: transform .25s ease;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 10px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 16px;
}
.sidebar-logo .mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
  flex: 0 0 40px;
}
.sidebar-logo .txt strong { color: #fff; display: block; font-size: 15px; line-height: 1.2; }
.sidebar-logo .txt span { font-size: 11.5px; color: #94a3b8; }

.nav-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #64748b; padding: 14px 12px 7px; font-weight: 700; }
.sidebar .nav-link {
  color: #cbd5e1;
  border-radius: var(--r-sm);
  padding: .6rem .75rem;
  font-size: 14.5px;
  font-weight: 500;
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 3px;
  transition: background .15s, color .15s;
}
.sidebar .nav-link i { width: 19px; text-align: center; font-size: 15px; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px rgba(37,99,235,.8); }
.sidebar .nav-link.active i { opacity: 1; }

.sidebar-user {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 14px;
}
.sidebar-user .box { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg,#475569,#334155);
  color: #fff; display: grid; place-items: center;
  font-weight: 650; font-size: 13px; flex: 0 0 36px;
}
.sidebar-user strong { color: #fff; font-size: 13.5px; display: block; line-height: 1.3; }
.sidebar-user span { font-size: 11.5px; color: #94a3b8; }

.main {
  flex: 1 1 auto;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 1030;
}
.topbar h1 { font-size: 19px; margin: 0; font-weight: 680; }
.topbar .sub { font-size: 13px; color: var(--muted); }

.content { padding: 26px 28px 44px; }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1035; }
}

/* ------------------------------------------------------------
   CARDS
   ------------------------------------------------------------ */
.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  background: var(--card);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 20px;
  font-weight: 650;
  font-size: 15px;
}
.card-body { padding: 20px; }

/* STAT TILES */
.stat {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  padding: 18px 20px;
  height: 100%;
  box-shadow: var(--sh-sm);
  position: relative;
  overflow: hidden;
}
.stat .ico {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 17px; margin-bottom: 13px;
}
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 29px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-top: 2px; }
.stat .value small { font-size: 15px; font-weight: 600; color: var(--muted-2); letter-spacing: 0; }
.stat .foot { font-size: 12.5px; color: var(--muted); margin-top: 7px; }

.ico-blue   { background: #eff6ff; color: #2563eb; }
.ico-green  { background: #ecfdf5; color: #059669; }
.ico-amber  { background: #fffbeb; color: #d97706; }
.ico-violet { background: #f5f3ff; color: #7c3aed; }
.ico-rose   { background: #fff1f2; color: #e11d48; }
.ico-slate  { background: #f1f5f9; color: #475569; }

/* ------------------------------------------------------------
   BADGES & PILLS
   ------------------------------------------------------------ */
.badge { font-weight: 600; font-size: 11.5px; padding: .38em .68em; border-radius: 7px; letter-spacing: .01em; }
.badge-soft-success { background:#ecfdf5; color:#047857; }
.badge-soft-primary { background:#eff6ff; color:#1d4ed8; }
.badge-soft-warning { background:#fffbeb; color:#b45309; }
.badge-soft-danger  { background:#fef2f2; color:#b91c1c; }
.badge-soft-slate   { background:#f1f5f9; color:#475569; }

.pill-q {
  display:inline-flex; align-items:center; gap:6px;
  background: var(--brand-light); color: var(--brand-dark);
  border: 1px solid var(--brand-soft);
  border-radius: 999px; padding: 4px 12px;
  font-size: 12.5px; font-weight: 650;
}

/* ------------------------------------------------------------
   TABLES
   ------------------------------------------------------------ */
.table { margin: 0; color: var(--ink-2); }
.table > thead > tr > th {
  background: var(--line-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--line);
  padding: 11px 16px;
  white-space: nowrap;
}
.table > tbody > tr > td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 14px; }
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table-hover > tbody > tr:hover > td { background: #fafbfd; }

/* ------------------------------------------------------------
   KUESIONER FORM
   ------------------------------------------------------------ */
.q-item {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 14px;
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
}
.q-item.answered { border-color: var(--brand-soft); background: #fcfdff; }
.q-item .q-no {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); color:#fff;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; flex: 0 0 28px;
}
.q-item.answered .q-no { background: var(--brand); }
.q-text { font-weight: 600; color: var(--ink); font-size: 14.8px; line-height: 1.5; }
.q-note { font-size: 12.5px; color: var(--warn); margin-top: 5px; font-weight: 600; }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin-top: 15px; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 6px 9px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: all .16s;
  user-select: none;
  margin: 0;
}
.scale label .n { display:block; font-size: 19px; font-weight: 700; color: var(--ink-2); line-height: 1.1; }
.scale label .t { display:block; font-size: 10.5px; color: var(--muted); margin-top: 3px; font-weight: 600; line-height: 1.25; }
.scale label:hover { border-color: var(--muted-2); background: #fafbfd; }
.scale input:checked + label {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 6px 16px -8px rgba(37,99,235,.9);
}
.scale input:checked + label .n,
.scale input:checked + label .t { color: #fff; }

@media (max-width: 575.98px) {
  .scale { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .scale label { padding: 9px 2px 7px; }
  .scale label .n { font-size: 16px; }
  .scale label .t { font-size: 8.5px; }
}

.legend-scale { display:flex; flex-wrap:wrap; gap: 8px 18px; font-size: 12.5px; color: var(--muted); }
.legend-scale b { color: var(--ink-2); }

/* ------------------------------------------------------------
   NOTICE / EMPTY STATE
   ------------------------------------------------------------ */
.notice {
  border-radius: var(--r);
  padding: 22px 24px;
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px solid var(--line);
  background: #fff;
}
.notice .ico { width: 46px; height: 46px; border-radius: 13px; display:grid; place-items:center; font-size: 20px; flex: 0 0 46px; }
.notice h5 { margin: 0 0 5px; font-size: 16px; }
.notice p { margin: 0; color: var(--muted); font-size: 14px; }
.notice-success { background:#f0fdf4; border-color:#bbf7d0; }
.notice-warning { background:#fffbeb; border-color:#fde68a; }
.notice-info    { background:#eff6ff; border-color:#bfdbfe; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty i { font-size: 40px; color: var(--muted-2); opacity: .55; }
.empty h6 { margin: 14px 0 4px; color: var(--ink-2); font-size: 15.5px; }
.empty p { font-size: 13.5px; margin: 0; }

/* ------------------------------------------------------------
   MISC
   ------------------------------------------------------------ */
.progress { height: 7px; background: var(--line-soft); border-radius: 999px; }
.progress-bar { border-radius: 999px; }

.chart-box { position: relative; height: 300px; }
.chart-box-sm { position: relative; height: 250px; }

.divider { height:1px; background: var(--line-soft); margin: 18px 0; }

.alert { border: 0; border-radius: var(--r-sm); font-size: 14px; padding: .8rem 1rem; font-weight: 500; }
.alert-success { background:#ecfdf5; color:#065f46; }
.alert-danger  { background:#fef2f2; color:#991b1b; }
.alert-warning { background:#fffbeb; color:#92400e; }
.alert-info    { background:#eff6ff; color:#1e40af; }

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}

/* ============================================================
   HALAMAN PUBLIK (kuesioner tanpa login)
   ============================================================ */
.pub-body { background: var(--bg); }

.pub-wrap { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 18px; }

.pub-topbar {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  position: sticky; top: 0; z-index: 1030;
}
.pub-mark {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 40px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.pub-topbar strong { font-size: 15px; line-height: 1.2; }

.pub-main { padding-top: 26px; padding-bottom: 34px; }

.pub-head { text-align: center; margin-bottom: 24px; }
.pub-head h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: -.02em; }
.pub-head p { color: var(--muted); font-size: 14.5px; margin: 0 0 12px; }

/* Kartu pilih nama */
.pick {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  height: 100%;
}
a.pick:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 20px -12px rgba(37,99,235,.7);
  transform: translateY(-1px);
  color: var(--ink);
}
.pick .avatar { width: 38px; height: 38px; flex: 0 0 38px; font-size: 14px;
                background: linear-gradient(135deg,#3b82f6,#2563eb); }
.pick.done { background: #fafbfd; border-style: dashed; }
.pick.done .avatar { background: linear-gradient(135deg,#cbd5e1,#94a3b8); }
.pick.done strong { color: var(--muted); font-weight: 600; }

/* Halaman selesai */
.pub-done {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  padding: 44px 32px 36px;
  text-align: center;
}
.pub-done .ico {
  width: 66px; height: 66px; border-radius: 50%;
  background: #ecfdf5; color: #059669;
  display: grid; place-items: center;
  font-size: 32px; margin: 0 auto 18px;
}
.pub-done h2 { font-size: 23px; margin: 0 0 6px; }
.pub-done > p { color: var(--muted); font-size: 15px; margin: 0; }

@media (max-width: 575.98px) {
  .pub-head h1 { font-size: 21px; }
  .pub-done { padding: 32px 20px 28px; }
  .pub-done h2 { font-size: 19px; }
}

/* ------------------------------------------------------------
   METER LINGKARAN (kartu Pencapaian di dashboard)
   ------------------------------------------------------------ */
.meter { position: relative; flex: 0 0 74px; width: 74px; height: 74px; }
.meter svg { transform: rotate(-90deg); display: block; }
.meter-track {
  fill: none;
  stroke: var(--line-soft);
  stroke-width: 8;
}
.meter-bar {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray .6s ease;
}
.meter-val {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; line-height: 1;
  color: var(--ink); letter-spacing: -.02em;
}
.meter-val small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 1px; }
