/* =========================================================================
   Tema "Crimson Terang" — palet terang dengan aksen merah crimson.
   Merah #9E1B1E · Merah tua #7A1215 · Emas #D97706 · Latar #F8FAFC
   Inter (teks) + Plus Jakarta Sans (judul). Semua aturan di-scope ke body.theme-crimson.
   Nama & logo yang tampil berasal dari workspace, bukan dari tema.
   ========================================================================= */
body.theme-crimson {
  --tc-red: #9E1B1E;
  --tc-red-dark: #7A1215;
  --tc-red-soft: #FDF2F2;
  --tc-red-line: rgba(158, 27, 30, .18);
  --tc-gold: #D97706;
  --tc-amber: #F59E0B;
  --tc-ink: #0F172A;
  --tc-bg: #F8FAFC;
  --panel: #FFFFFF;
  --line: #E2E8F0;
  --green: #9E1B1E;
  --text: #0F172A;
  --muted: #64748B;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(15, 23, 42, .12);
  color-scheme: light;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  color: var(--tc-ink);
  background:
    radial-gradient(at 10% 0%, rgba(158, 27, 30, .08) 0, transparent 38rem),
    radial-gradient(at 95% 5%, rgba(217, 119, 6, .07) 0, transparent 30rem),
    var(--tc-bg);
}
body.theme-crimson::before { display: none; }
body.theme-crimson h1, body.theme-crimson h2, body.theme-crimson h3, body.theme-crimson .brand,
body.theme-crimson .public-brand, body.theme-crimson legend {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}
body.theme-crimson ::selection { background: var(--tc-red); color: #fff; }
body.theme-crimson a { color: var(--tc-red); }
body.theme-crimson a:hover { color: var(--tc-red-dark); }

/* ---- Navigasi & brand ---- */
body.theme-crimson .app-nav {
  background: rgba(255, 255, 255, .95);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  backdrop-filter: blur(12px);
}
body.theme-crimson .brand, body.theme-crimson .public-brand { color: var(--tc-ink); letter-spacing: -.02em; }
body.theme-crimson .brand span:last-child, body.theme-crimson .public-brand { font-weight: 800; }
body.theme-crimson .brand-mark {
  background: linear-gradient(135deg, var(--tc-red), var(--tc-red-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(158, 27, 30, .25);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 900;
}
body.theme-crimson .nav-link { color: #475569; }
body.theme-crimson .nav-link:hover { color: var(--tc-red); }

/* ---- Teks ---- */
body.theme-crimson .eyebrow { color: var(--tc-red); }
body.theme-crimson .muted, body.theme-crimson .page-head p, body.theme-crimson .field-help,
body.theme-crimson .public-intro, body.theme-crimson .public-question small,
body.theme-crimson .form-progress-meta, body.theme-crimson th { color: var(--muted); }
body.theme-crimson .page-head h1, body.theme-crimson .public-card h1 { color: var(--tc-ink); letter-spacing: -.025em; line-height: 1.12; }
body.theme-crimson .auth-card h1 { letter-spacing: -.025em; }

/* ---- Kartu ---- */
body.theme-crimson .glass, body.theme-crimson .card,
body.theme-crimson .builder-sidebar, body.theme-crimson .workspace-card {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

/* ---- Tombol ---- */
body.theme-crimson .btn, body.theme-crimson button,
body.theme-crimson .btn-add-q, body.theme-crimson button.btn-save-main {
  background: var(--tc-red) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px -6px rgba(158, 27, 30, .45) !important;
}
body.theme-crimson .btn:hover, body.theme-crimson button:hover,
body.theme-crimson .btn-add-q:hover, body.theme-crimson button.btn-save-main:hover {
  background: var(--tc-red-dark) !important;
}
body.theme-crimson .btn.secondary, body.theme-crimson button.secondary,
body.theme-crimson button.q-btn-icon, body.theme-crimson .workspace-view-switch button.view-btn,
body.theme-crimson .builder-tab-btn {
  background: #fff !important;
  color: #334155 !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}
body.theme-crimson .btn.secondary:hover, body.theme-crimson button.secondary:hover,
body.theme-crimson button.q-btn-icon:hover, body.theme-crimson .builder-tab-btn:hover {
  background: var(--tc-red-soft) !important;
  color: var(--tc-red) !important;
  border-color: var(--tc-red-line) !important;
}
body.theme-crimson button.btn-delete, body.theme-crimson .btn-delete,
body.theme-crimson button.q-btn-icon.del:hover, body.theme-crimson .btn-cancel-edit {
  background: #FEF2F2 !important; color: #B91C1C !important; border: 1px solid #FECACA !important; box-shadow: none !important;
}
body.theme-crimson .link-danger { background: none !important; color: #B91C1C !important; box-shadow: none !important; }

/* ---- Input ---- */
body.theme-crimson input, body.theme-crimson textarea, body.theme-crimson select {
  background: #fff;
  color: var(--tc-ink);
  border: 1px solid #CBD5E1;
}
body.theme-crimson input::placeholder, body.theme-crimson textarea::placeholder { color: #94A3B8; }
body.theme-crimson input:focus, body.theme-crimson textarea:focus, body.theme-crimson select:focus {
  border-color: var(--tc-red);
  box-shadow: 0 0 0 4px rgba(158, 27, 30, .10);
}
body.theme-crimson select option { background: #fff; color: var(--tc-ink); }
body.theme-crimson .field label, body.theme-crimson .label, body.theme-crimson .auth-card label { color: #334155; }
body.theme-crimson .check input, body.theme-crimson .choice input { accent-color: var(--tc-red); }

/* ---- Status, pill, tabel, notifikasi ---- */
body.theme-crimson .status { background: #F1F5F9; color: #475569; }
body.theme-crimson .status.published { background: #ECFDF5; color: #047857; }
body.theme-crimson .status.published::before { background: #10B981; box-shadow: none; }
body.theme-crimson .pill, body.theme-crimson .q-badge { background: #F1F5F9; color: #475569; }
body.theme-crimson .q-badge.type, body.theme-crimson .metric-pill { background: var(--tc-red-soft); color: var(--tc-red); }
body.theme-crimson .q-badge.req { background: #FFFBEB; color: #B45309; }
body.theme-crimson th, body.theme-crimson td { border-bottom-color: var(--line); }
body.theme-crimson .error { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
body.theme-crimson .success-notice { background: #ECFDF5; border-color: #A7F3D0; color: #047857; }

/* ---- Builder ---- */
body.theme-crimson .builder-tabs { background: #fff; border-color: var(--line); }
body.theme-crimson .builder-tab-btn.active {
  background: var(--tc-red) !important; color: #fff !important; border-color: var(--tc-red) !important;
  box-shadow: 0 6px 16px -6px rgba(158, 27, 30, .5) !important;
}
body.theme-crimson .question-item, body.theme-crimson .q-item, body.theme-crimson .parameter-item,
body.theme-crimson .parameter-score, body.theme-crimson .preview-question, body.theme-crimson .preview-opt-item {
  background: #fff; border-color: var(--line);
}
body.theme-crimson .q-item:hover { background: #F8FAFC; border-color: var(--tc-red-line); }
body.theme-crimson .q-item.active { background: var(--tc-red-soft); border-color: var(--tc-red); box-shadow: 0 0 0 1px var(--tc-red); }
body.theme-crimson .q-num, body.theme-crimson .question-index { background: var(--tc-red-soft); color: var(--tc-red); }
body.theme-crimson .q-item.active .q-num { background: var(--tc-red); color: #fff; }
body.theme-crimson .q-label, body.theme-crimson .preview-q-title, body.theme-crimson .collapsible-box summary { color: var(--tc-ink); }
body.theme-crimson .q-item:hover .q-label { color: var(--tc-red); }
body.theme-crimson .workspace-view-switch { background: #F1F5F9; }
body.theme-crimson .workspace-view-switch button.view-btn.active { background: var(--tc-red) !important; color: #fff !important; }
body.theme-crimson .collapsible-box, body.theme-crimson .parameter-add, body.theme-crimson .measurement-box,
body.theme-crimson .preview-card-clean, body.theme-crimson .preview-textarea-mock,
body.theme-crimson .preview-dropdown-mock, body.theme-crimson .preview-input-mock {
  background: #F8FAFC; border-color: var(--line);
}
body.theme-crimson .preview-screen { background: radial-gradient(circle at 80% 0, rgba(158, 27, 30, .06), transparent 16rem); }
body.theme-crimson .preview-opt-circle { border-color: var(--tc-red-line); }
body.theme-crimson .parameter-edit summary { color: var(--tc-red); }
body.theme-crimson .score-bar { background: #F1F5F9; }
body.theme-crimson .ai-generator { background: linear-gradient(145deg, #fff, var(--tc-red-soft)); border-color: var(--tc-red-line); }
/* Bar grafik laporan memakai warna inline hijau → ganti ke merah */
body.theme-crimson [style*="#4ade80"] { background: var(--tc-red) !important; }
body.theme-crimson [style*="linear-gradient(#4ade80"] { background: linear-gradient(var(--tc-red), var(--tc-red-dark)) !important; }
body.theme-crimson blockquote[style*="#4ade80"] { background: var(--tc-red-soft) !important; border-left-color: var(--tc-red) !important; }
body.theme-crimson [style*="rgba(255,255,255,.06)"] { background: #F1F5F9 !important; }

/* ---- Halaman login / daftar ---- */
body.theme-crimson .auth-card { border-top: 4px solid var(--tc-red); }
body.theme-crimson .auth-card h1 { color: var(--tc-ink); }

/* ---- Form publik ---- */
body.theme-crimson .public-shell { padding-top: 0; }
body.theme-crimson .public-brand {
  margin: 0 -18px 32px; padding: 18px; color: #fff;
  background:
    radial-gradient(at 15% 15%, rgba(158, 27, 30, .55) 0, transparent 55%),
    radial-gradient(at 85% 80%, rgba(217, 119, 6, .25) 0, transparent 50%),
    linear-gradient(135deg, #0F172A 0%, #1E1B24 50%, #2A0B0E 100%);
  border-radius: 0 0 20px 20px;
}
body.theme-crimson .public-brand .brand-mark { background: #fff; color: var(--tc-red); box-shadow: none; }
body.theme-crimson .public-card { border-top: 4px solid var(--tc-red); }
body.theme-crimson .public-card .eyebrow {
  display: inline-block; background: var(--tc-red-soft); color: var(--tc-red);
  padding: 4px 10px; border-radius: 999px;
}
body.theme-crimson .public-question { background: #fff; border-color: var(--line); }
body.theme-crimson .public-question legend { color: var(--tc-ink); }
body.theme-crimson .choice { background: #fff; border-color: var(--line); }
body.theme-crimson .choice:hover { background: var(--tc-red-soft); border-color: var(--tc-red-line); }
body.theme-crimson .likert-row { border-bottom-color: var(--line); }
body.theme-crimson .success-mark { background: var(--tc-red-soft); color: var(--tc-red); }
body.theme-crimson .form-progress-track { background: #F1F5F9; }
body.theme-crimson .form-progress-track div { background: linear-gradient(90deg, var(--tc-red), var(--tc-amber)); }
body.theme-crimson .payment-banner {
  background: linear-gradient(135deg, var(--tc-red-soft), #FFFBEB) !important;
  border-color: var(--tc-red-line) !important;
}
body.theme-crimson .payment-banner strong { color: var(--tc-red); }

@media (max-width: 600px) {
  body.theme-crimson .public-brand { margin: 0 -12px 22px; }
}
