/* ===================================================================
   CBT REKRUTMEN RS - MODERN HOSPITAL DESIGN SYSTEM
   Theme: Medical Enterprise (Deep Navy, Pure Slate, Teal/Cyan & Emerald)
   Font: Plus Jakarta Sans / Inter
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-dark: #0f172a;
  --bg-dark-card: #1e293b;

  --primary: #0284c7;        /* Hospital Medical Cyan/Blue */
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-border: #bae6fd;

  --secondary: #0d9488;      /* Teal/Clinical */
  --secondary-hover: #0f766e;
  --secondary-light: #ccfbf1;

  --accent-emerald: #10b981;  /* Success / Answered */
  --accent-emerald-light: #d1fae5;
  --accent-amber: #f59e0b;    /* Flagged / Ragu-ragu */
  --accent-amber-light: #fef3c7;
  --accent-rose: #f43f5e;     /* Danger / Urgent */
  --accent-rose-light: #ffe4e6;
  --accent-purple: #8b5cf6;
  --accent-purple-light: #ede9fe;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  --border-light: #e2e8f0;
  --border-card: rgba(226, 232, 240, 0.8);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ===================================================================
   UTILITIES & TYPOGRAPHY
   =================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-medis {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-nonmedis {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-success {
  background: var(--accent-emerald-light);
  color: #065f46;
}

.badge-warning {
  background: var(--accent-amber-light);
  color: #92400e;
}

.badge-danger {
  background: var(--accent-rose-light);
  color: #9f1239;
}

.badge-secondary {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #0369a1 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--text-main);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  color: #fff;
}

.btn-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
}

.btn-amber:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
}

.btn-rose {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #fff;
}

.btn-rose:hover {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* ===================================================================
   CARDS & CONTAINERS
   =================================================================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-md);
  padding: 24px;
  transition: var(--transition);
}

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  border-color: #cbd5e1;
}

/* ===================================================================
   APP TOPBAR / NAVBAR
   =================================================================== */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.brand-text h1 {
  font-size: 1.15rem;
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===================================================================
   LANDING & FORM REGISTRATION
   =================================================================== */
.hero-section {
  padding: 50px 0 30px;
  text-align: center;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 32px;
}

.formasi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.formasi-card {
  position: relative;
  background: #ffffff;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.formasi-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.1);
  transform: translateY(-2px);
}

.formasi-card.active {
  border-color: var(--primary);
  background: #f0f9ff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.formasi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.formasi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* ===================================================================
   CBT EXAM INTERFACE (LIVE TEST)
   =================================================================== */
.cbt-topbar {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.cbt-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
}

.cbt-candidate-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cbt-avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #0284c7, #0d9488);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.cbt-timer-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 8px 18px;
  border-radius: var(--radius-full);
}

.cbt-timer-label {
  font-size: 0.78rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.cbt-timer-digits {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
}

.cbt-timer-digits.urgent {
  color: #f43f5e;
  animation: pulse-danger 1s infinite alternate;
}

@keyframes pulse-danger {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.06); opacity: 0.85; }
}

.cbt-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  max-width: 1440px;
  margin: 24px auto;
  padding: 0 24px;
  align-items: start;
}

/* Question Box */
.question-container {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  padding: 32px;
  position: relative;
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.question-badge {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.question-text {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 30px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: #ffffff;
  cursor: pointer;
  transition: var(--transition);
}

.option-item:hover {
  border-color: #0284c7;
  background: #f8fafc;
}

.option-item.selected {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

.option-radio {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}

.option-item.selected .option-radio {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.option-label {
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--text-main);
  padding-top: 3px;
}

/* Exam Controls */
.cbt-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

/* Sidebar Navigation Palette */
.palette-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  padding: 24px;
  position: sticky;
  top: 96px;
}

.palette-header {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.palette-btn {
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  background: #f8fafc;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.palette-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.palette-btn.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.4);
  font-weight: 700;
}

.palette-btn.answered {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.palette-btn.flagged {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #ffffff;
}

.palette-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

/* ===================================================================
   ANTI-CHEAT WARNING MODAL
   =================================================================== */
.cheat-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cheat-modal-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

.cheat-modal {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  border: 2px solid #f43f5e;
}

.cheat-icon {
  width: 64px;
  height: 64px;
  background: #ffe4e6;
  color: #f43f5e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
}

/* ===================================================================
   ADMIN DASHBOARD & TABLES
   =================================================================== */
.admin-sidebar {
  width: 260px;
  background: #0f172a;
  color: #fff;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.admin-content {
  margin-left: 260px;
  padding: 32px;
  min-height: 100vh;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.stat-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin: 6px 0 2px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #ffffff;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.custom-table th {
  background: #f8fafc;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border-light);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: #f8fafc;
}

/* ===================================================================
   SCORECARD & CERTIFICATE PRINT
   =================================================================== */
.score-card-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  max-width: 720px;
  margin: 40px auto;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.score-badge-status {
  display: inline-block;
  padding: 8px 24px;
  border-radius: var(--radius-full);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin: 20px 0;
}

.score-badge-status.pass {
  background: #dcfce7;
  color: #15803d;
  border: 2px solid #86efac;
}

.score-badge-status.fail {
  background: #ffe4e6;
  color: #be123c;
  border: 2px solid #fda4af;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .no-print, .cbt-topbar, .admin-sidebar, .btn, .palette-card {
    display: none !important;
  }
  .admin-content {
    margin-left: 0;
    padding: 0;
  }
  .score-card-box {
    box-shadow: none;
    border: 1px solid #000;
    margin: 0;
    max-width: 100%;
  }
}

@media (max-width: 992px) {
  .cbt-layout {
    grid-template-columns: 1fr;
  }
  .palette-card {
    position: static;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .admin-content {
    margin-left: 0;
    padding: 20px;
  }
}
