/* ==========================================================================
   Kraepelin Test - DISC Matched Modern Design System
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --accent: #0d9488;
  --accent-p: #3b82f6;
  --accent-k: #f43f5e;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --dark-color: #0f172a;
  --card-bg: rgba(255, 255, 255, 0.95);
  --border-radius: 16px;
  --text-main: #1e293b;
  --text-muted: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background-color: #f1f5f9;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Kraepelin Active Test Engine Styles
   ========================================================================== */

.test-container {
  max-width: 680px;
  margin: 24px auto;
  padding: 0 16px;
  width: 100%;
}

.test-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.test-header-bar {
  background: #f8fafc;
  padding: 16px 22px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.column-pill {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
  display: inline-flex;
  align-items: center;
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: #1e293b;
  background: #ffffff;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid #cbd5e1;
  transition: all 0.25s ease;
}

.timer-box.timer-urgent {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  animation: pulse-danger 0.9s infinite alternate;
}

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

/* Number Column Presentation */
.kraepelin-board {
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 290px;
  position: relative;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.column-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.stack-number {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  font-weight: 800;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1.5px solid #e2e8f0;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stack-number.active-pair {
  border: 2.5px solid var(--primary);
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.22);
  transform: scale(1.04);
}

.stack-operator {
  font-size: 1.25rem;
  font-weight: 700;
  color: #94a3b8;
  margin: -6px 0;
  user-select: none;
}

.stack-preview {
  opacity: 0.35;
  transform: scale(0.85);
  border-style: dashed;
}

/* Modern Input Keypad */
.keypad-container {
  padding: 20px 24px 28px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}

.key-btn {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.key-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--primary);
  transform: translateY(-2px);
}

.key-btn:active,
.key-btn.pressed {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1d4ed8;
  color: #ffffff;
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.keypad-hint {
  text-align: center;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Floating Column Transition Overlay */
.transition-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.transition-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.transition-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.transition-subtitle {
  font-size: 0.95rem;
  color: #cbd5e1;
}

/* Metric / Result Badges */
.metric-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  text-align: center;
  transition: transform 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
}

.metric-score {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 4px 0;
  color: var(--primary);
}

.metric-category {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-sangat-baik,
.badge-baik-sekali {
  background: #dcfce7;
  color: #15803d;
}

.badge-baik {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-sedang {
  background: #fef3c7;
  color: #b45309;
}

.badge-kurang {
  background: #ffedd5;
  color: #c2410c;
}

.badge-kurang-sekali {
  background: #fee2e2;
  color: #b91c1c;
}
