/* === CSS Variables === */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --border: #1f2937;
  --radius: 4px;
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 200ms ease;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden {
  display: none !important;
}

/* === Hero === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-image: url('https://images.unsplash.com/photo-1614064548237-096f735f344f?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&q=80&w=1400');
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,14,26,0.92) 0%, rgba(10,14,26,0.78) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 64px 24px;
  max-width: 640px;
}

.hero-label {
  display: inline-block;
  font-size: 14px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-meta {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* === Buttons === */
.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  background: var(--accent);
  color: #0a0e1a;
  border-radius: var(--radius);
  transition: background var(--transition), transform var(--transition);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  min-height: 44px;
  transition: border-color var(--transition), background var(--transition);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(6,182,212,0.08);
}

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

.btn-external {
  text-align: center;
}

/* === Pain Section === */
.pain-section {
  padding: 80px 0;
  background: var(--bg-secondary);
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
}

.pain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.pain-card {
  padding: 32px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color var(--transition);
}

.pain-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.pain-card:hover {
  border-color: var(--accent);
}

.pain-num {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.pain-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.pain-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* === Assessment === */
.assessment-section {
  padding: 64px 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.assessment-section .container {
  max-width: 640px;
}

.progress-bar-wrapper {
  margin-bottom: 48px;
}

.progress-track {
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.axis-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(6,182,212,0.12);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
}

.question-area {
  margin-bottom: 40px;
}

.question-text {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 28px;
}

.options-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  position: relative;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  min-height: 52px;
  display: flex;
  align-items: center;
}

.option-card:hover {
  border-color: var(--accent);
  background: rgba(6,182,212,0.05);
}

.option-card.selected {
  border-color: var(--accent);
  background: rgba(6,182,212,0.12);
}

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

.option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.nav-area {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

/* === Results === */
.results-section {
  padding: 64px 0;
}

.results-section .container {
  max-width: 720px;
}

/* Score Card */
.score-card {
  text-align: center;
  margin-bottom: 48px;
  padding: 48px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.score-gauge {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: var(--bg-card);
  stroke-width: 8;
}

.gauge-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 553;
  stroke-dashoffset: 553;
  transition: stroke-dashoffset 1.2s ease;
}

.score-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score-max {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-secondary);
}

.score-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Radar */
.radar-wrapper {
  text-align: center;
  margin-bottom: 48px;
}

.radar-svg {
  max-width: 400px;
  width: 100%;
  height: auto;
}

/* Axis Details */
.axis-details {
  display: grid;
  gap: 12px;
  margin-bottom: 48px;
}

.axis-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.axis-row-label {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
}

.axis-row-score {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: right;
}

.axis-row-bar {
  flex: 2;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.axis-row-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* Regulation */
.regulation-section {
  margin-bottom: 48px;
}

.subsection-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}

.regulation-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reg-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius);
  margin-right: 8px;
}

.reg-tag-n2sf {
  background: rgba(6,182,212,0.15);
  color: var(--accent);
}

.reg-tag-isms {
  background: rgba(245,158,11,0.15);
  color: var(--warning);
}

.regulation-item {
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
}

/* Roadmap */
.roadmap-section {
  margin-bottom: 48px;
}

.roadmap-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roadmap-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.roadmap-priority {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  height: fit-content;
}

.roadmap-priority.high { background: rgba(239,68,68,0.15); color: var(--danger); }
.roadmap-priority.mid { background: rgba(245,158,11,0.15); color: var(--warning); }
.roadmap-priority.low { background: rgba(16,185,129,0.15); color: var(--success); }

.roadmap-body h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.roadmap-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Result Actions */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Footer === */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

/* === Animations === */
[data-animate] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 767px) {
  .hero-title {
    font-size: 32px;
  }

  .hero-desc {
    font-size: 15px;
  }

  .pain-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 24px;
  }

  .question-text {
    font-size: 18px;
  }

  .score-number {
    font-size: 36px;
  }

  .score-max {
    font-size: 16px;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .btn-primary,
  .result-actions .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Print */
@media print {
  .hero, .pain-section, .assessment-section, .footer, .btn-copy, .btn-retry, .btn-external {
    display: none;
  }

  .results-section {
    display: block !important;
  }

  .results-section .hidden {
    display: block !important;
  }
}
