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

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  max-width: 100vw;
  margin: 0 auto;
  padding: 1rem;
  background: #020617;
  color: #e5e7eb;
}

/* 페이지 컨테이너 */
.page {
  max-width: 960px;
  margin: 0 auto;
}

/* 히어로 */
.hero {
  text-align: left;
  padding: 1.75rem 1.5rem;
  background: radial-gradient(circle at top left, #4f46e5, #020617);
  color: #f9fafb;
  border-radius: 18px;
  margin-bottom: 1.75rem;
  box-shadow: 0 18px 45px rgba(15,23,42,0.8);
}
.hero h1 {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.hero-sub {
  font-size: 0.98rem;
  opacity: 0.9;
  margin-bottom: 0.8rem;
}
.hero-list {
  list-style: none;
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}
.hero-list li::before {
  content: "• ";
  color: #a5b4fc;
}

/* 공용 대시보드 링크 (히어로 안/대시보드 헤더 둘 다) */
.dash-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #a5b4fc;
  text-decoration: none;
}
.dash-link:hover {
  text-decoration: underline;
}

/* 섹션 타이틀 */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.section-desc {
  font-size: 0.9rem;
  color: #cbd5f5;
  margin-bottom: 1rem;
}

/* 입력 폼 */
.input-section {
  max-width: 100%;
  margin-top: 1.5rem;
}
.input-group {
  margin-bottom: 1.2rem;
  background: #020617;
  padding: 1.1rem 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(15,23,42,0.8);
  border: 1px solid #1f2937;
}
.input-group label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  color: #e5e7eb;
}
.input-group small {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #4b5563;
  border-radius: 8px;
  font-size: 16px;
  background: #020617;
  color: #e5e7eb;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus,
select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.4);
  background: #020617;
}

button {
  width: 100%;
  min-height: 52px;
  margin-top: 0.25rem;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  box-shadow: 0 12px 30px rgba(22,163,74,0.55);
}
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}
button:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(22,163,74,0.45);
}

/* 결과 섹션 */
.result-section {
  margin: 2.2rem auto 1rem;
  max-width: 960px;
}
.result-card {
  background: #020617;
  padding: 1.8rem 1.5rem;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15,23,42,0.9);
  text-align: left;
  border: 1px solid #1f2937;
}
#risk-level {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}
.risk-bar {
  width: 100%;
  height: 10px;
  background: #111827;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.9rem 0 1.1rem;
}
.risk-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #22c55e;
  transition: width 0.5s ease, background 0.3s ease;
}
.summary-text {
  font-size: 0.95rem;
  color: #e5e7eb;
  margin-bottom: 0.5rem;
}
.advice-text {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 0.9rem;
}
.disclaimer {
  font-size: 0.75rem;
  color: #6b7280;
}

/* 위험도별 색상 */
.low #risk-level { color: #22c55e; }
.medium #risk-level { color: #f97316; }
.high #risk-level { color: #ef4444; }
.low #risk-fill { background: #22c55e; }
.medium #risk-fill { background: #f97316; }
.high #risk-fill { background: #ef4444; }

/* 푸터 */
footer {
  text-align: center;
  padding: 2rem 0 2.5rem;
  color: #6b7280;
  font-size: 0.8rem;
}

/* 데스크톱 레이아웃 */
@media (min-width: 1024px) {
  body {
    padding: 3rem 2rem 3.5rem;
  }
  .page {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: start;
  }
  .hero {
    padding: 2.2rem 2rem;
  }
  .input-section {
    margin-top: 0;
  }
  .result-card {
    padding: 2.1rem 2rem;
  }
}

/* ===== Dashboard 전용 ===== */

.dash-body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #020617;
  color: #e5e7eb;
}

.dash-header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.8rem 1rem 0.5rem;
}
.dash-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.dash-header p {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 0.6rem;
}

/* 대시보드 그리드 */
.dash {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.5rem 1rem 3rem;
  display: grid;
  grid-template-columns: 2fr 3fr;
  grid-template-rows: auto auto;
  gap: 1.5rem;
}

/* 공통 카드 */
.card {
  background: #020617;
  border-radius: 16px;
  border: 1px solid #1f2933;
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}
.card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

/* 1) 요약 카드 */
.card-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-summary .score {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0.1rem;
}
.card-summary .rank {
  font-size: 0.95rem;
  color: #a5b4fc;
  margin-bottom: 0.6rem;
}
.card-summary .mini {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* 2) 트렌드 카드 */
.card-trend .chart-placeholder {
  height: 160px;
  border-radius: 12px;
  border: 1px dashed #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
  padding: 0 1rem;
}

/* 3) 오늘 추천 모드 */
.card-mode ul {
  list-style: disc;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}
.card-mode li + li {
  margin-top: 0.35rem;
}

/* 4) 강화하면 좋은 부분 */
.card-focus .focus-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  column-gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.focus-label {
  font-size: 0.85rem;
  color: #cbd5f5;
}
.focus-bar {
  height: 8px;
  border-radius: 999px;
  background: #111827;
  position: relative;
  overflow: hidden;
}
.focus-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: left;
}
.focus-low::after {
  background: #ef4444;
  transform: scaleX(0.35);
}
.focus-mid::after {
  background: #f97316;
  transform: scaleX(0.6);
}
.focus-high::after {
  background: #22c55e;
  transform: scaleX(0.85);
}
.focus-text {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: #9ca3af;
}

/* 푸터 */
.dash-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
  font-size: 0.8rem;
  color: #6b7280;
}

/* 반응형 */
@media (max-width: 768px) {
  .dash {
    grid-template-columns: 1fr;
  }
}

.check-row {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #e5e7eb;
}
.check-row input {
  margin-right: 0.4rem;
}
