/* Sinsin Health 웹 프로토타입의 화면 스타일을 정의한다. */
:root {
  color-scheme: light;
  --ink: #16202f;
  --muted: #657289;
  --line: #dce4ea;
  --page: #f6f8f5;
  --panel: #ffffff;
  --green: #138a63;
  --mint: #dff4e8;
  --coral: #f06f5f;
  --amber: #e4a72f;
  --blue: #3267b1;
  --shadow: 0 18px 44px rgba(31, 45, 64, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a,
button,
input,
select {
  font: inherit;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin-inline: auto;
  padding: 30px 0 54px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: 30px;
  align-items: center;
  min-height: 520px;
  padding: 22px 0 26px;
}

.eyebrow,
.panel-kicker {
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 720px;
  margin: 12px 0 18px;
  font-size: clamp(2.25rem, 4.6vw, 4.35rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-text {
  max-width: 620px;
  margin: 0;
  color: #405169;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-action,
.secondary-action,
.exercise-form button,
.shop-list button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
}

.primary-action,
.exercise-form button {
  background: var(--ink);
  color: #ffffff;
}

.secondary-action {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.hero-media {
  overflow: hidden;
  border: 1px solid rgba(220, 228, 234, 0.95);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  align-items: start;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.insight-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(31, 45, 64, 0.06);
}

.insight-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.insight-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.28;
}

article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(31, 45, 64, 0.07);
  padding: 20px;
}

.level-panel {
  grid-row: span 2;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.panel-heading strong {
  color: var(--ink);
  font-size: 1.3rem;
}

.level-panel h2 {
  margin: 10px 0 16px;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.16;
  letter-spacing: 0;
}

.exp-track,
.guild-track {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: #edf2f5;
}

.exp-track span,
.guild-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--coral));
  transition: width 220ms ease;
}

.exp-row,
.guild-level {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.exp-row {
  grid-template-columns: 1fr auto;
}

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

.stat-grid div {
  min-height: 104px;
  border: 1px solid #e5ecf1;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 16px;
}

.stat-grid dt {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.stat-grid dd {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 1.52rem;
  font-weight: 900;
}

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

.exercise-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.exercise-form input,
.exercise-form select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
}

.proof-field input {
  min-height: auto;
  border-style: dashed;
  padding: 11px 12px;
}

.proof-field span {
  color: var(--green);
  font-size: 0.82rem;
  line-height: 1.4;
}

.full-field,
.exercise-form button {
  grid-column: 1 / -1;
}

.system-message {
  min-height: 46px;
  margin: 14px 0 0;
  border-radius: 8px;
  background: var(--mint);
  color: #0d684d;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.quest-list,
.leaderboard,
.badge-list,
.shop-list,
.history-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.quest-item,
.leaderboard li,
.badge-list span,
.history-item {
  display: grid;
  gap: 8px;
  border: 1px solid #e5ecf1;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 13px;
}

.quest-title,
.leaderboard li,
.history-title {
  color: var(--ink);
  font-weight: 900;
}

.quest-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.mini-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #edf2f5;
}

.mini-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.leaderboard {
  padding-left: 0;
  list-style: none;
}

.leaderboard li {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.rank-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--green);
  font-size: 0.86rem;
}

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

.badge-list span {
  min-height: 54px;
  align-content: center;
  color: var(--ink);
  font-weight: 900;
}

.shop-list button {
  width: 100%;
  border-color: #e5ecf1;
  background: #fbfcfd;
  color: var(--ink);
}

.quest-claim,
.text-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.quest-claim.ready {
  border-color: transparent;
  background: var(--green);
  color: #ffffff;
}

.quest-claim:disabled {
  cursor: default;
  opacity: 0.58;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.history-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 16px;
  font-weight: 800;
  line-height: 1.5;
}

.shop-list button.purchased {
  border-color: var(--green);
  background: var(--mint);
  color: #0d684d;
}

.mobile-quick-nav {
  display: none;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
  padding: 30px 0 54px;
}

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

.admin-header h1 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 16px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 24px rgba(31, 45, 64, 0.06);
}

.admin-login h2 {
  margin: 8px 0 0;
  font-size: 1.45rem;
  line-height: 1.22;
}

.admin-login-form {
  display: grid;
  gap: 10px;
}

.admin-login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.admin-login-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 800;
}

.admin-login-form button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 900;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-secure[hidden],
.admin-login[hidden] {
  display: none;
}

.admin-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(31, 45, 64, 0.06);
}

.admin-stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(31, 45, 64, 0.06);
}

.review-topline,
.review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.review-topline strong {
  font-size: 1.08rem;
}

.review-status {
  border-radius: 999px;
  background: #f3f7f5;
  color: var(--green);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 900;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.review-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 900;
}

.review-actions button[data-action="approve"] {
  border-color: transparent;
  background: var(--green);
  color: #ffffff;
}

.review-actions button[data-action="reject"] {
  border-color: transparent;
  background: var(--coral);
  color: #ffffff;
}

.admin-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 20px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .hero,
  .dashboard-grid,
  .insight-strip,
  .admin-grid,
  .admin-header,
  .admin-login {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .level-panel {
    grid-row: auto;
  }
}

@media (max-width: 560px) {
  body {
    padding-bottom: 76px;
  }

  .app-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 16px;
  }

  .hero {
    gap: 18px;
    padding-top: 6px;
  }

  .hero h1 {
    font-size: 2.18rem;
  }

  .hero-text {
    font-size: 0.98rem;
    line-height: 1.62;
  }

  .hero-actions a {
    flex: 1 1 150px;
  }

  article {
    padding: 16px;
  }

  .exercise-form,
  .stat-grid,
  .badge-list {
    grid-template-columns: 1fr;
  }

  .exp-row {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .verify-panel .panel-heading,
  .quest-panel .panel-heading,
  .guild-panel .panel-heading {
    flex-direction: row;
    align-items: center;
  }

  .mobile-quick-nav {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid rgba(220, 228, 234, 0.95);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(31, 45, 64, 0.18);
    padding: 8px;
    backdrop-filter: blur(12px);
  }

  .mobile-quick-nav a {
    display: grid;
    place-items: center;
    min-height: 42px;
    border-radius: 8px;
    background: #f3f7f5;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 900;
  }

  .mobile-quick-nav a:first-child {
    background: var(--green);
    color: #ffffff;
  }
}
