@font-face {
  font-family: "NanumSquare";
  src: url("./NanumSquareR.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "NanumSquare";
  src: url("./NanumSquareB.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "NanumSquare";
  src: url("./NanumSquareEB.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
}

:root {
  --bg: #eef4ff;
  --panel: rgba(248, 251, 255, 0.94);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --text: #172033;
  --muted: #62718c;
  --line: rgba(23, 32, 51, 0.10);
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
  --warm: #60a5fa;
  --danger: #dc2626;
  --shadow: 0 22px 50px rgba(37, 99, 235, 0.10);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "NanumSquare", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.24), transparent 26%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 30%),
    linear-gradient(180deg, #f7fbff 0%, #eef4ff 48%, #e0ebff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.18;
}

.page-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 14px 40px;
}

.app-shell {
  display: grid;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(14px);
}

.app-title {
  margin: 0 0 18px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.1;
  font-weight: 800;
  text-align: left;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(31, 38, 49, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input:focus {
  outline: 3px solid rgba(22, 95, 105, 0.14);
  border-color: var(--accent);
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.95rem;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}

.button.primary {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-strong);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.button.wide {
  width: 100%;
}

.text-button {
  padding: 6px 4px 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
}

.hidden,
[hidden] {
  display: none !important;
}

.survey-card {
  display: grid;
  gap: 16px;
}

.survey-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.survey-top h2,
.card-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.progress-pill {
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  font-weight: 700;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(31, 38, 49, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
  transition: width 180ms ease;
}

.question-guide {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.question-stage {
  min-height: 380px;
}

.question-item {
  display: grid;
  gap: 16px;
}

.question-number {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.question-word-grid {
  display: grid;
  gap: 12px;
}

.option-label {
  position: relative;
  display: block;
}

.option-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card {
  width: 100%;
  min-height: 84px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(31, 38, 49, 0.12);
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.option-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.option-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: var(--accent-strong);
  font-weight: 800;
}

.option-text {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: keep-all;
}

.option-check {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(31, 38, 49, 0.18);
  display: grid;
  place-items: center;
  color: transparent;
  font-weight: 900;
  flex: 0 0 auto;
}

.option-label input:checked + .option-card {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.14) 0%, rgba(255, 255, 255, 0.98) 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.12);
}

.option-label input:checked + .option-card .option-badge,
.option-label input:checked + .option-card .option-check {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.nav-actions,
.result-actions {
  display: grid;
  gap: 10px;
}

.nav-actions {
  grid-template-columns: 1fr 1fr;
}

.result-topline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-topline > div,
.score-box {
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.result-code {
  margin: 6px 0 0;
  font-size: clamp(1.25rem, 3.6vw, 1.9rem);
  font-weight: 800;
  word-break: keep-all;
}

.result-summary {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(96, 165, 250, 0.16));
  line-height: 1.7;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.admin-key-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: var(--muted);
  font-size: 0.88rem;
  text-transform: uppercase;
}

.score-box strong {
  display: block;
  margin-top: 6px;
  font-size: 1.8rem;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 16px 12px 32px;
  }

  .card {
    padding: 18px;
    border-radius: 24px;
  }

  .nav-actions,
  .result-actions,
  .result-topline,
  .score-grid,
  .admin-summary-grid,
  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .option-card {
    min-height: 76px;
    padding: 14px 15px;
  }

  .option-badge {
    width: 38px;
    height: 38px;
  }

  .option-text {
    font-size: 1rem;
  }
}
