:root {
  --tri-bg: #f5f7fb;
  --tri-primary: #111827;
  --tri-muted: #6b7280;
  --tri-border: #e5e7eb;
  --tri-radius-lg: 24px;
  --tri-radius-md: 18px;
  --tri-shadow-lg: 0 30px 60px rgba(15, 23, 42, 0.18);
  --tri-shadow-md: 0 18px 40px rgba(15, 23, 42, 0.12);
  --tri-shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.08);
  --tri-ease: cubic-bezier(0.19, 1, 0.22, 1);
  --tri-maxw: 1100px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* ========== WRAPPER & HERO ========== */

.tri-wrapper {
  background: #ffffff;
  color: var(--tri-primary);
}

.tri-hero {
  padding: 72px 16px 80px;
  background: linear-gradient(180deg, #fee2e2 0%, #fffbeb 35%, #f5f7fb 80%);
  text-align: center;
}

.tri-hero-inner {
  max-width: 840px;
  margin: 0 auto;
}

.tri-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.08);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.85);
}

.tri-hero-duration {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tri-muted);
}

.tri-hero-title {
  margin: 4px 0 12px;
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.05;
  font-weight: 800;
}

.tri-hero-subtitle {
  margin: 0 auto 22px;
  max-width: 54rem;
  font-size: 16px;
  color: var(--tri-muted);
}

.tri-hero-subtitle strong {
  color: #111827;
}

.tri-hero-footnote {
  margin-top: 12px;
  font-size: 14px;
  color: var(--tri-muted);
}

/* ========== BUTTONS ========== */

.tri-btn-primary,
.tri-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px !important;
  padding: 12px 24px !important;
  border-width: 0 !important;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.16s var(--tri-ease), box-shadow 0.16s var(--tri-ease),
    background-color 0.16s var(--tri-ease), color 0.16s var(--tri-ease);
  line-height: 1.2;
}

.tri-btn-primary {
  background: #b91c1c !important;
  color: #ffffff !important;
  box-shadow: var(--tri-shadow-md) !important;
}

.tri-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--tri-shadow-lg) !important;
}

.tri-btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--tri-shadow-sm) !important;
}

.tri-btn-outline {
  background: #ffffff !important;
  color: #b91c1c !important;
  border: 2px solid rgba(15, 23, 42, 0.14) !important;
}

.tri-btn-outline:hover {
  background: #f9fafb !important;
}

.tri-btn-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ========== FORM SHELL ========== */
#tri-test {
  display: none;
}

.tri-test-shell {
  background: linear-gradient(180deg, #f5f7fb 0%, #f5f7fb 40%, #ffffff 100%);
  padding: 40px 16px 60px;
  margin-top: -12px;
}

.tri-test-inner {
  max-width: var(--tri-maxw);
  margin: 0 auto;
}

.tri-topbar {
  background: #111827;
  border-radius: 32px;
  padding: 18px 20px;
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--tri-shadow-sm);
  margin-bottom: 26px;
}

.tri-top-total {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.tri-top-time {
  margin: 4px 0 0;
  font-size: 13px;
  color: #e5e7eb;
}

.tri-progress-text {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #e5e7eb;
}

.tri-form {
  margin-top: 10px;
}

.tri-step {
  display: none;
  background: #ffffff;
  border-radius: 28px;
  padding: 26px 22px 26px;
  box-shadow: var(--tri-shadow-sm);
  min-height: 60vh;
}

.tri-step.is-active {
  display: block;
}

.tri-step-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.tri-step-desc {
  margin: 0 0 18px;
  text-align: center;
  font-size: 14px;
  color: var(--tri-muted);
}

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

/* ========== DATA DIRI CARD ========== */

.tri-q-card {
  background: radial-gradient(
        circle at top left,
        #fee2e2 0,
        #fffbeb 45%,
        #ffffff 90%
      )
      padding-box,
    #fecaca border-box;
  border-radius: 28px;
  border: 1px solid rgba(248, 113, 113, 0.6);
  padding: 22px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 24px 50px rgba(248, 113, 113, 0.25);
}

.tri-q-illus {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 24px;
  background: conic-gradient(from 210deg, #fee2e2, #fed7aa, #fef9c3, #fee2e2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

.tri-q-body h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
}

.tri-q-body p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--tri-muted);
}

.tri-input-wrap {
  position: relative;
  margin-top: 8px;
}

.tri-q-body input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 11px 16px;
  font-size: 14px;
  background: #fbfbff;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease,
    background-color 0.12s ease, transform 0.12s ease;
}

.tri-q-body input:focus {
  border-color: #b91c1c;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(185, 28, 28, 0.22),
    0 0 0 1.5px rgba(185, 28, 28, 0.4);
  transform: translateY(-1px);
}

/* ========== LIKERT QUESTIONS ========== */

.tri-subheading {
  margin: 22px 0 10px;
  font-size: 16px;
  font-weight: 700;
}

/* error */

.tri-field-error {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

/* NAV BUTTONS */

.tri-nav {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* FEEDBACK */

.tri-feedback {
  margin-top: 12px;
  min-height: 18px;
}

.tri-error {
  margin: 0;
  font-size: 14px;
  color: #b91c1c;
}

.tri-loading {
  margin: 0;
  font-size: 14px;
  color: var(--tri-muted);
}

/* ========== LOADING OVERLAY ========== */

.tri-overlay-loading {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.tri-overlay-inner {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px 30px;
  box-shadow: var(--tri-shadow-lg);
  text-align: center;
  max-width: 320px;
}

.tri-overlay-inner p {
  margin-top: 12px;
  font-size: 14px;
  color: var(--tri-muted);
}

.tri-spinner {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 4px solid #e5e7eb;
  border-top-color: #b91c1c;
  animation: tri-spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes tri-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== HASIL (RESULT PAGE) ========== */

.tri-result-shell {
  padding: 80px 16px 100px;
  background: radial-gradient(
    circle at top,
    #f1f5f9 0,
    #f8fafc 40%,
    #ffffff 100%
  );
}

.tri-result-inner {
  max-width: 880px;
  margin: 0 auto;
}

.tri-result-hero {
  text-align: center;
  margin-bottom: 32px;
}

.tri-result-badge {
  display: inline-flex;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 10px;
  background: #ffffff;
}

.tri-result-hero h1 {
  margin: 0;
  font-size: 30px;
}

.tri-result-name {
  margin-top: 8px;
  color: var(--tri-muted);
}

.tri-result-layout {
  display: grid;
  gap: 22px;
}

/* score card + gauge */

.tri-result-score-card {
  border-radius: 32px;
  padding: 28px 22px 26px;
  background: linear-gradient(145deg, #ffffff, #eef2ff);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  border: 2px solid var(--tri-accent, #22c55e);
  text-align: center;
}

.tri-gauge-box {
  text-align: center;
  margin: 10px auto 8px;
}

.tri-gauge-svg {
  width: 260px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.tri-gauge-needle {
  transform-origin: 100px 110px;
}

.tri-gauge-score {
  font-size: 44px;
  font-weight: 800;
  color: #1e293b;
  margin-top: 12px;
}

.tri-gauge-label {
  font-size: 20px;
  font-weight: 600;
  color: #475569;
  margin-top: -4px;
}

.tri-result-desc {
  margin-top: 12px;
  font-size: 15px;
  color: #4b5563;
}

/* metrics */

.tri-result-panel {
  margin-top: 4px;
  padding: 22px 22px 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f9fafb, #fee2e2);
}

.tri-result-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.tri-result-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.tri-metric-item {
  padding: 10px 12px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.18);
}

.tri-metric-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.tri-metric-label {
  color: #4b5563;
}

.tri-metric-value {
  font-weight: 700;
  color: #0f172a;
}

.tri-metric-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.tri-metric-bar-inner {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #f97316, #ef4444);
}

/* actions */

.tri-result-actions {
  margin-top: 4px;
  padding: 24px;
  border-radius: 24px;
  background: #0f172a;
  color: #e5e7eb;
}

.tri-result-actions h2 {
  margin-top: 0;
  font-size: 18px;
  color: #ffffff;
}

.tri-result-actions-text {
  margin: 8px 0 14px;
  font-size: 14px;
  color: #cbd5f5;
}

.tri-quote {
  margin: 0 0 18px;
  font-size: 13px;
  color: #9ca3af;
  font-style: italic;
}

.tri-result-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* responsive */
@media (max-width: 1024px) {
  .tri-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .tri-grid {
    grid-template-columns: 1fr;
  }

  .tri-q-card {
    flex-direction: row;
  }
}

@media (max-width: 640px) {
  .tri-hero {
    padding-top: 54px;
    padding-bottom: 60px;
  }
  .tri-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .tri-step {
    padding: 20px 16px 20px;
  }
  .tri-q-card {
    flex-direction: row;
  }
}

/* ====== LIST SOAL ====== */

.tri-likert-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 1 blok soal */
.tri-q-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--tri-border);
  background: transparent;
}

/* teks soal di atas, rata kiri, bold */
.tri-q-text {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 10px;
}

.tri-q-number {
  font-weight: 700;
}

/* baris skala di bawah: Setuju | bulatan | Tidak setuju */
.tri-q-scale-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* label kiri & kanan */
.tri-q-scale-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.tri-q-scale-label-left {
  color: #16a34a; /* hijau */
}

.tri-q-scale-label-right {
  color: #7c3aed; /* ungu */
}

/* deretan bulatan 1–5 */
.tri-q-scale {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* sembunyikan radio asli */
.tri-q-scale input {
  display: none;
}

/* bulatan dasar */
.tri-q-scale span {
  border-radius: 999px;
  border: 2px solid #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  width: 36px;
  height: 36px;
  color: #4b5563;
  transition: all 0.18s ease;
}

/* ukuran bulatan bertahap (opsional, mirip contoh) */
.tri-q-scale label:nth-child(1) span,
.tri-q-scale label:nth-child(5) span {
  width: 44px;
  height: 44px;
}
.tri-q-scale label:nth-child(2) span,
.tri-q-scale label:nth-child(4) span {
  width: 40px;
  height: 40px;
}

/* warna border bertahap */
.tri-q-scale label:nth-child(1) span,
.tri-q-scale label:nth-child(2) span {
  border-color: #16a34a;
}
.tri-q-scale label:nth-child(3) span {
  border-color: #9ca3af;
}
.tri-q-scale label:nth-child(4) span,
.tri-q-scale label:nth-child(5) span {
  border-color: #7c3aed;
}

/* hover ringan */
.tri-q-scale span:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.35);
}

/* saat dipilih → bulatan hijau + teks putih + glow */
.tri-q-scale input:checked + span {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(22, 163, 74, 0.45);
}

/* kalau mau ada tanda centang di samping angka */
.tri-q-scale input:checked + span::after {
  content: "✓";
  font-size: 18px;
  margin-left: 3px;
}

/* error state (kalau belum diisi) */
.tri-field-error {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

@media (max-width: 640px) {
  .tri-q-scale-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tri-q-scale-label-right {
    margin-left: 0;
  }

  .tri-q-scale {
    order: 2;
  }
}
