:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-hover: #243044;
  --border: #2d3a4f;
  --text: #e8edf4;
  --text-muted: #8b9cb3;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --success: #22c55e;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.12), transparent);
  color: var(--text);
  line-height: 1.5;
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.header {
  text-align: left;
  margin-bottom: 2rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  display: block;
  width: 74px;
  height: auto;
  margin: 0;
  filter: invert(1) hue-rotate(180deg) saturate(1.2);
}

.header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.question-text {
  margin: 0 0 1.5rem;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.55;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border: none;
  padding: 0;
  margin: 0;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.option:hover {
  background: var(--surface-hover);
  border-color: #3d4f6a;
}

.option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.option-radio {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  position: relative;
}

.option.selected .option-radio {
  border-color: var(--accent);
}

.option.selected .option-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--accent);
  border-radius: 50%;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  gap: 0.75rem;
}

.btn {
  padding: 0.7rem 1.35rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:not(:disabled):hover {
  filter: brightness(1.08);
}

.btn-primary:not(:disabled):active {
  transform: scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.results-card {
  text-align: center;
}

.results-score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--success);
  margin: 0.5rem 0;
  letter-spacing: -0.03em;
}

.results-label {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.results-detail {
  text-align: left;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.results-detail summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.answer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(45, 58, 79, 0.5);
}

.answer-row:last-child {
  border-bottom: none;
}

.error-card {
  text-align: center;
  color: #f87171;
}

.intro-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.intro-desc {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.intro-meta {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.resume-banner {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.resume-banner p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.question-dimension {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.save-hint {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.results-note {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--success);
}

.score-section {
  margin-bottom: 1.5rem;
  text-align: left;
}

.score-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.score-table {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.score-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.score-row:last-child {
  border-bottom: none;
}

.score-code {
  font-weight: 700;
  color: var(--accent);
}

.score-name {
  color: var(--text-muted);
}

.score-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-weight: 600;
  color: var(--text);
}

.score-total {
  font-size: 0.95rem;
}

.score-avg {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.inference-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  vertical-align: middle;
}

.intro-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.field input {
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s;
}

.field input::placeholder {
  color: #5c6d85;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-error {
  margin: 0;
  font-size: 0.875rem;
  color: #f87171;
}

.intro-actions {
  margin-top: 0.25rem;
  justify-content: stretch;
}

.intro-actions .btn-primary {
  width: 100%;
}

.welcome-card {
  text-align: left;
}

.welcome-section-title {
  margin: 1rem 0 0.45rem;
  font-size: 1rem;
  font-weight: 700;
}

.welcome-list {
  margin: 0 0 0.9rem;
  padding-left: 1.15rem;
  color: var(--text-muted);
}

.welcome-list li {
  margin-bottom: 0.45rem;
}

.results-participant {
  margin: 0.5rem 0 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.results-participant strong {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 480px) {
  .app {
    padding: 1.25rem 1rem 2rem;
  }

  .card {
    padding: 1.25rem;
  }

  .question-text {
    font-size: 1.05rem;
  }
}
