/* Programming Benchmark Tool: Design System, Aesthetic: Dark Lab */

:root {
  --bg: #0d0f12;
  --bg-2: #141720;
  --bg-3: #1c2030;
  --border: #272c3a;
  --border-2: #333a4e;
  --text: #e2e6f0;
  --text-2: #8890a8;
  --text-3: #555e72;
  --accent: #4cf0a8;
  --accent-2: #3acf8e;
  --accent-dim: #1a3d2e;
  --red: #f04c6a;
  --red-dim: #3d1520;
  --yellow: #f0c84c;
  --yellow-dim: #3d2e10;
  --blue: #4ca8f0;
  --blue-dim: #0f2840;
  --radius: 8px;
  --radius-lg: 14px;
  --mono: "DM Mono", "Fira Code", monospace;
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "DM Serif Display", Georgia, serif;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.7);
}

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

html {
  font-size: 15px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
}

/* Shared backgrounds */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(76, 240, 168, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 240, 168, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(
    ellipse,
    rgba(76, 240, 168, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.finish-glow {
  background: radial-gradient(
    ellipse,
    rgba(76, 240, 168, 0.1) 0%,
    transparent 70%
  );
}

/* Typography */
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
}
em {
  font-style: italic;
  color: var(--accent);
}
strong {
  font-weight: 500;
}

/* Utility badges */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--border-2);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

/* INTRO PAGE */
.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1.5rem 6rem;
  min-height: 100vh;
}

.intro-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
}

.intro-header {
  margin-bottom: 2.5rem;
}

.intro-title {
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  line-height: 1.05;
  margin-bottom: 1rem;
  color: var(--text);
}

.intro-subtitle {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 440px;
}

/* Info cards */
.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.info-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-card strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text);
}

.info-card p {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 2px;
}

.lang-footnote {
  font-size: 0.72rem;
  color: var(--text-3);
  font-family: var(--mono);
  margin-top: 0.5rem;
}

.consent-footnote {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 0.5rem;
  opacity: 0.8;
}

/* AI phase breakdown */
.phase-breakdown {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.phase-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0.6rem;
  border-radius: var(--radius);
  text-align: center;
}

.phase-full {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
}
.phase-hint {
  background: var(--yellow-dim);
  border: 1px solid var(--yellow);
}
.phase-none {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
}

.phase-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
}

.phase-full .phase-label {
  color: var(--accent);
}
.phase-hint .phase-label {
  color: var(--yellow);
}

.phase-desc {
  font-size: 0.72rem;
  color: var(--text-2);
}

.phase-divider {
  color: var(--text-3);
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Form */
.form-error {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}

.start-form {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.8rem;
}
.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.75rem;
  font-family: var(--mono);
}

.form-label-note {
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
}

/* Radio cards */
.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.radio-option {
  cursor: pointer;
}
.radio-option input[type="radio"] {
  display: none;
}

.radio-box {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 2px;
  padding: 1rem 1rem 0.85rem;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition:
    border-color 0.15s,
    background 0.15s;
}

.radio-option input:checked + .radio-box {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.radio-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.radio-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  display: block;
}

.radio-desc {
  font-size: 0.78rem;
  color: var(--text-2);
  display: block;
}

/* Years of experience grid */
.years-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.years-option {
  cursor: pointer;
}
.years-option input[type="radio"] {
  display: none;
}

.years-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.5rem;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-2);
  text-align: center;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}

.years-option input:checked + .years-box {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Frequency grid */
.freq-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

/* AI tools checkbox grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.tool-option {
  cursor: pointer;
}
.tool-option input[type="checkbox"] {
  display: none;
}

.tool-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.5rem;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-2);
  text-align: center;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}

.tool-option input:checked + .tool-box {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Confidence scale */
.confidence-scale {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.scale-row {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
}

.confidence-scale > div:first-of-type {
  display: flex;
  gap: 0.75rem;
}

.scale-option {
  cursor: pointer;
}
.scale-option input[type="radio"] {
  display: none;
}

.scale-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--text-2);
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}

.scale-option input:checked + .scale-box {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-3);
  font-family: var(--mono);
  padding: 0 2px;
}

/* Language grid */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.lang-option {
  cursor: pointer;
}
.lang-option input[type="radio"] {
  display: none;
}

.lang-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0.9rem 0.5rem;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-2);
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
  text-align: center;
}

.lang-logo {
  font-size: 1.6rem;
}

.lang-option input:checked + .lang-box {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Checkbox */
.consent-group .form-label {
  display: none;
}

.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
  display: none;
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-2);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.checkbox-option input:checked + .checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-option input:checked + .checkbox-box::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0px;
  width: 7px;
  height: 11px;
  border: 2px solid var(--bg);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.checkbox-text {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* Start / submit button */
.btn-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.95rem 2rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
  margin-top: 1.5rem;
}

.btn-start:hover {
  background: var(--accent-2);
}
.btn-start:active {
  transform: scale(0.98);
}

.intro-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.intro-footer p {
  font-size: 0.78rem;
  color: var(--text-3);
  text-align: center;
}

/* FINISH PAGE */
.page-finish {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.finish-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  text-align: center;
}

.finish-checkmark {
  margin-bottom: 1.5rem;
  animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.check-path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw-check 0.6s 0.4s ease forwards;
}

@keyframes draw-check {
  to {
    stroke-dashoffset: 0;
  }
}

.finish-title {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  animation: fade-up 0.5s 0.2s ease both;
}

.finish-subtitle {
  color: var(--text-2);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  animation: fade-up 0.5s 0.3s ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
  animation: fade-up 0.5s 0.4s ease both;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-icon {
  font-size: 1.3rem;
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-2);
  text-align: center;
}

.finish-message {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  animation: fade-up 0.5s 0.5s ease both;
}

.btn-restart {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.9rem;
  transition:
    background 0.15s,
    color 0.15s;
  animation: fade-up 0.5s 0.6s ease both;
}

.btn-restart:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Survey form on finish page */
.survey-form {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: left;
  animation: fade-up 0.5s 0.5s ease both;
}

.survey-textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  resize: vertical;
  line-height: 1.6;
  transition: border-color 0.15s;
}

.survey-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.survey-textarea::placeholder {
  color: var(--text-3);
}

/* Responsive */
@media (max-width: 600px) {
  .info-cards {
    grid-template-columns: 1fr;
  }
  .radio-group {
    grid-template-columns: 1fr;
  }
  .lang-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .years-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .freq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .finish-title {
    font-size: 2.2rem;
  }
  .phase-breakdown {
    flex-direction: column;
  }
  .phase-divider {
    transform: rotate(90deg);
  }
}
