@font-face {
  font-family: "Pretendard";
  src: url("/static/Pretendard-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("/static/Pretendard-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-top: #f5f0e6;
  --bg-bottom: #d6e6f5;
  --card: #ffffff;
  --ink: #1e2a33;
  --muted: #5f6d7a;
  --accent: #1c5b92;
  --accent-strong: #0f3d6e;
  --accent-soft: #6ea2c8;
  --gold: #f0b55e;
  --shadow: 0 18px 40px rgba(15, 32, 45, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-blur {
  position: fixed;
  inset: -20% 0 0 0;
  background: radial-gradient(circle at 20% 20%, rgba(240, 181, 94, 0.28), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(30, 91, 146, 0.22), transparent 40%),
    radial-gradient(circle at 40% 70%, rgba(108, 173, 214, 0.2), transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: float 14s ease-in-out infinite;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

.hero {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 64px auto 32px;
  padding: 0 24px;
  text-align: left;
}

.hero__badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(28, 91, 146, 0.12);
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 13px;
}

.hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.2;
}

.hero p {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto 60px;
  padding: 0 24px 40px;
  display: grid;
  gap: 28px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.card__header h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.card__header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.card__header img {
  width: 84px;
  height: auto;
}

.tag {
  background: rgba(240, 181, 94, 0.2);
  color: #8d5a1d;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

label span {
  font-weight: 600;
  color: var(--ink);
}

input,
select,
textarea {
  border-radius: 12px;
  border: 1px solid #d9e2ec;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fdfdfd;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(110, 162, 200, 0.2);
}

label.wide {
  grid-column: span 2;
}

.score-section {
  margin-top: 20px;
  padding: 18px;
  background: rgba(28, 91, 146, 0.06);
  border-radius: 16px;
}

.score-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.score-header h3 {
  margin: 0;
  font-size: 18px;
}

.score-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  font-family: inherit;
}

button.primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 8px 16px rgba(28, 91, 146, 0.25);
}

button.ghost {
  background: #f3f6f9;
  color: var(--muted);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  font-size: 13px;
  color: var(--muted);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 18px;
}

.chart-box,
.editor-box {
  background: #f8fafc;
  border-radius: 16px;
  padding: 18px;
  min-height: 280px;
}

.chart-box h4,
.editor-box h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

#chart-preview {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: white;
  display: none;
}

#report-text {
  width: 100%;
  min-height: 280px;
  resize: vertical;
}

.footer {
  text-align: center;
  padding: 30px 12px 50px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 960px) {
  .grid.two,
  .grid.five {
    grid-template-columns: 1fr;
  }

  label.wide {
    grid-column: span 1;
  }

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

  .card__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .hero {
    margin-top: 40px;
  }

  .card {
    padding: 20px;
  }
}
