:root {
  --c-bg: #f7f5f0;
  --c-surface: #ffffff;
  --c-primary: #1a1a2e;
  --c-accent: #4f5fcf;
  --c-accent2: #c0392b;
  --c-text: #1a1a2e;
  --c-muted: #6b7280;
  --c-border: #ddd8cf;
  --c-selected: #eef0fb;
  --c-error: #dc2626;

  /* 레포트 전용 */
  --rpt-ink: #0f1923;
  --rpt-rule: #d4cfc6;
  --rpt-accent: #1a1a2e;
  --rpt-bg: #ffffff;
  --rpt-sidebar: #f4f2ee;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow: 0 2px 16px rgba(0, 0, 0, .08);

  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  --serif: var(--font-sans);
  --mono:       var(--font-sans);

  --ink: #1a1612;
  --ink-2: #3d342c;
  --ink-3: #6b5d52;
}


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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  overflow-x: hidden;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ── 스크린 ── */
.screen {
  display: none;
  min-height: 100vh;
  animation: fadeUp .4s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.center-v {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

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

.btn-lg {
  font-size: 1.05rem;
  padding: 16px 44px;
}

.btn-sm {
  font-size: .82rem;
  padding: 8px 18px;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--c-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79, 95, 207, .3);
}

.btn-secondary {
  background: var(--c-surface);
  color: var(--c-primary);
  border: 1.5px solid var(--c-border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--c-accent);
  color: var(--c-accent);
}



/* ══ INFO ══ */
#screen-info {
  padding: 60px 0 80px;
}

.landing-header {
  text-align: center;
  margin-bottom: 48px;
}

.landing-eyebrow {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: .72rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
}

.landing-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(4rem, 10vw, 5.2rem);
  font-style: italic;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 0 0 16px;
}

.landing-sub {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink-2);
  letter-spacing: .02em;
}

.landing-rule {
  width: 48px;
  height: 1px;
  background: var(--ink-3);
  margin: 24px auto;
}

.landing-intro {
  max-width: 540px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.7;
}

.info-form {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 36px;
  box-shadow: var(--shadow);
}

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

.form-group>label {
  display: block;
  font-size: .92rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 7px;
  letter-spacing: .02em;
}

.req {
  color: var(--c-error);
}

.label-sub {
  font-size: .72rem;
  color: var(--c-muted);
  font-weight: 400;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--c-border);
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: .95rem;
  color: var(--c-text);
  background: var(--c-bg);
  outline: none;
  transition: border-color .18s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--c-accent);
  background: #fff;
}

.form-error {
  display: block;
  font-size: .75rem;
  color: var(--c-error);
  margin-top: 4px;
  min-height: 1.1em;
}

.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 2px solid var(--c-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .18s;
  font-size: .85rem;
  font-weight: 500;
  background: var(--c-bg);
}

.radio-btn:has(input:checked) {
  border-color: var(--c-accent);
  background: var(--c-selected);
  color: var(--c-accent);
  font-weight: 700;
}

.radio-btn input[type="radio"],
.radio-btn input[type="checkbox"] {
  display: none;
}

/* ══ SURVEY ══ */
#screen-survey {
  padding: 0;
}

.survey-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 240, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
  padding: 12px 20px;
}

.survey-header-inner {
  max-width: 680px;
  margin: 0 auto;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: .76rem;
  color: var(--c-muted);
  margin-bottom: 6px;
}

.progress-track {
  height: 5px;
  background: var(--c-border);
  border-radius: 100px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--c-accent), var(--c-accent2));
  border-radius: 100px;
  transition: width .35s ease;
}

.survey-body {
  padding: 36px 20px 100px;
  max-width: 680px;
  margin: 0 auto;
}

#question-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}

#question-list.slide-in {
  animation: slideQ .25s cubic-bezier(.25, .46, .45, .94);
}

@keyframes slideQ {
  from {
    opacity: 0;
    transform: translateY(20px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.question-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 36px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.question-item.answered {
  opacity: 0.45;
  transform: scale(0.98);
}

.question-item.focused {
  opacity: 1;
  border-color: var(--c-accent);
  box-shadow: 0 4px 20px rgba(79, 95, 207, .18);
  transform: scale(1);
}

.q-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.q-number {
  font-size: .78rem;
  font-weight: 700;
  color: var(--c-muted);
  letter-spacing: .06em;
}

.q-text {
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--c-primary);
  font-weight: 600;
  margin-bottom: 28px;
}

/* Linear Scale */
.q-linear-scale {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  padding: 0 5%;
}

.q-linear-scale::before {
  content: '';
  position: absolute;
  top: 14px;
  /* Center of the circle (30px / 2 = 15 - border = roughly 14px) */
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--c-border);
  z-index: 0;
}

.scale-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: 1;
  width: 60px;
}

.scale-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c-surface);
  border: 3px solid var(--c-border);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-option:hover .scale-circle {
  border-color: var(--c-accent);
  transform: scale(1.1);
}

.scale-option.selected .scale-circle {
  background: var(--c-accent);
  border-color: var(--c-accent);
  box-shadow: 0 0 0 5px rgba(79, 95, 207, .2);
  transform: scale(1.1);
}

.scale-label {
  font-size: 0.75rem;
  color: var(--c-muted);
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  word-break: keep-all;
}

.scale-option.selected .scale-label {
  color: var(--c-accent);
  font-weight: 700;
}

.survey-nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.survey-nav .btn-primary {
  padding: 12px 36px;
}

/* ══════════════════════════════════════════════════════════
   REPORT STYLES
══════════════════════════════════════════════════════════ */
#screen-result {
  background: #e8e4de;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* 액션 바 */
.report-action-bar {
  background: var(--c-primary);
  color: #fff;
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 200;
}

.report-action-bar .container {
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.report-action-title {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  opacity: .8;
}

.report-action-btns {
  display: flex;
  gap: 8px;
}

/* PDF 페이지 — 브라우저에서 보여지는 용 */
#report-root {
  max-width: 850px;
  margin: 28px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 20px;
}

.pdf-page {
  background: var(--rpt-bg);
  border-radius: 4px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, .18);
  overflow: hidden;
  /* A4 비율 유지 */
  aspect-ratio: 210 / 297;
  display: flex;
  flex-direction: column;
}

.page-inner {
  flex: 1;
  padding: 36px 44px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 레터헤드 */
.rpt-letterhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rpt-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--rpt-ink);
  letter-spacing: .04em;
}

.rpt-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.rpt-meta-right span {
  font-size: .68rem;
  color: var(--c-muted);
}

.rpt-badge {
  background: var(--rpt-ink);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 2px 8px;
  border-radius: 2px;
}

.rpt-divider {
  height: 2px;
  background: var(--rpt-ink);
  margin-bottom: 10px;
  position: relative;
}

.rpt-divider::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 80px;
  height: 1px;
  background: var(--rpt-ink);
  opacity: .3;
}

/* 수검자 정보 */
.rpt-subject-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--rpt-rule);
  margin-bottom: 14px;
}

.rpt-subject-field {
  flex: 1;
  padding: 7px 10px;
  border-right: 1px solid var(--rpt-rule);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rpt-subject-field:last-child {
  border-right: none;
}

.field-label {
  font-size: .58rem;
  color: var(--c-muted);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.field-value {
  font-size: .82rem;
  font-weight: 700;
  color: var(--rpt-ink);
}

/* 종합 지수 히어로 */
.rpt-score-hero {
  display: flex;
  gap: 24px;
  margin-bottom: 60px;
  align-items: flex-start;
}

.rpt-score-left {
  flex-shrink: 0;
  width: 140px;
  background: var(--rpt-ink);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rpt-score-label {
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: 6px;
}

.rpt-score-number {
  font-size: 3.8rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.rpt-score-grade {
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  opacity: .9;
}

.rpt-score-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 게이지 */
.rpt-gauge-wrap {
  border: 1px solid var(--rpt-rule);
  border-radius: var(--r-sm);
  padding: 24px 12px 28px;
  position: relative;
  margin-top: 10px;
}

.rpt-gauge-track {
  position: relative;
  height: 14px;
  border-radius: 100px;
  overflow: visible;
}

.rpt-gauge-segments {
  display: flex;
  height: 100%;
  border-radius: 100px;
  overflow: hidden;
}

.seg {
  height: 100%;
}

.rpt-gauge-needle {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 22px;
  background: var(--rpt-ink);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 1s cubic-bezier(.25, .46, .45, .94);
  z-index: 5;
}

.rpt-gauge-needle::before {
  content: '▲';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  color: var(--rpt-ink);
}

.g-lbl {
  position: absolute;
  top: -20px;
  transform: translateX(-50%);
  font-size: .58rem;
  color: var(--c-muted);
  white-space: nowrap;
}

.g-lbl[style*="left:0%"] {
  transform: translateX(0);
}

.g-lbl[style*="left:100%"] {
  transform: translateX(-100%);
}

.g-zone {
  position: absolute;
  bottom: -20px;
  transform: translateX(-50%);
  font-size: .58rem;
  color: var(--c-muted);
  white-space: nowrap;
}

/* 미니 바 차트 */
.rpt-mini-bars {
  border: 1px solid var(--rpt-rule);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-bar-label {
  font-size: .62rem;
  font-weight: 600;
  color: var(--c-muted);
  width: 30px;
  flex-shrink: 0;
}

.mini-bar-track {
  flex: 1;
  height: 6px;
  background: #f0ede8;
  border-radius: 100px;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 100px;
}

.mini-bar-score {
  font-size: .62rem;
  font-weight: 700;
  width: 26px;
  text-align: right;
  flex-shrink: 0;
}

/* AI 총평 박스 */
.rpt-section {
  margin-bottom: 18px;
}

.rpt-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-muted);
  border-left: 4px solid var(--rpt-ink);
  padding-left: 10px;
  margin-bottom: 12px;
}

.rpt-summary-box {
  background: var(--rpt-sidebar);
  border-radius: var(--r-sm);
  padding: 18px 20px;
}

.rpt-summary-box p {
  font-size: .92rem;
  line-height: 1.75;
  color: var(--rpt-ink);
}

/* ── 페이지 2 ── */
.rpt-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rpt-logo-sm {
  font-size: 1rem;
  font-weight: 700;
  color: var(--rpt-ink);
}

.rpt-name-sm {
  font-size: .85rem;
  color: var(--c-muted);
}

/* 카테고리 카드 */
.cat-card {
  margin-bottom: 24px;
  border: 1px solid var(--rpt-rule);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.cat-card-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cat-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-card-name {
  font-size: .78rem;
  font-weight: 700;
  color: var(--rpt-ink);
}

.cat-card-desc {
  font-size: .64rem;
  color: var(--c-muted);
}

.cat-card-index {
  font-size: .88rem;
  font-weight: 700;
}

.cat-card-bar-track {
  height: 4px;
  background: #f0ede8;
}

.cat-card-bar-fill {
  height: 100%;
}

.cat-card-analysis {
  padding: 12px 16px 14px;
  background: var(--rpt-sidebar);
}

.cat-card-analysis p {
  font-size: .8rem;
  line-height: 1.7;
  color: var(--rpt-ink);
}

/* ── 페이지 3, 4 ── */
.rpt-prophecy-box {
  background: #1a1a2e;
  border-radius: var(--r-sm);
  padding: 20px 22px;
}

.rpt-prophecy-box p {
  font-size: .92rem;
  line-height: 1.78;
  color: #e8e4de;
}

.rpt-advice-box {
  background: var(--rpt-sidebar);
  border-left: 5px solid var(--rpt-ink);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 18px 20px;
}

.rpt-advice-box p {
  font-size: .92rem;
  line-height: 1.72;
  color: var(--rpt-ink);
}

.page-footer {
  display: none;
  margin-top: auto;
  padding-top: 20px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--c-muted);
}

body.pdf-capture .page-footer {
  display: block;
}

.rpt-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--rpt-rule);
}

.rpt-footer p {
  font-size: .62rem;
  color: var(--c-muted);
  text-align: center;
}

/* AI 로딩 */
.ai-loading {
  font-size: .8rem;
  color: var(--c-muted);
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-loading::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

.ai-loading-sm {
  font-size: .72rem;
  color: var(--c-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-loading-sm::before {
  content: '';
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

.ai-error {
  font-size: .78rem;
  color: var(--c-error);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 반응형 ── */
@media (max-width: 640px) {
  .page-inner {
    padding: 20px 18px;
  }

  .rpt-score-hero {
    flex-direction: column;
  }

  .rpt-score-left {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .container {
    padding: 0 16px;
  }

  .info-form {
    padding: 24px 16px;
  }

  .radio-group {
    flex-direction: column;
  }

  .survey-nav {
    flex-direction: column;
  }

  .survey-nav .btn {
    width: 100%;
  }

  /* Mobile Survey Scale */
  .question-item {
    padding: 28px 16px;
  }

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

  .q-linear-scale {
    padding: 0 2%;
  }

  .q-linear-scale::before {
    top: 11px;
    left: 8%;
    right: 8%;
  }

  .scale-option {
    width: 44px;
    gap: 6px;
  }

  .scale-circle {
    width: 24px;
    height: 24px;
    border-width: 2px;
  }

  .scale-label {
    font-size: 0.65rem;
  }
}

/* ── 인쇄 숨김 ── */
@media print {
  .no-print {
    display: none !important;
  }
}