:root {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-hero: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e5e5e5;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --army: #333333;
  --army-light: #ffffff;
  --gold: #888888;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --nav-h: 64px;
}

[data-theme='dark'] {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-hero: #0a0a0a;
  --text: #f5f5f5;
  --text-muted: #aaaaaa;
  --border: #2a2a2a;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--nav-h);
  height: auto;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0.55rem 1.5rem;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.nav-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.04rem;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
}

.nav-brand-ko {
  display: block;
  font-weight: 800;
  font-size: 1.28rem;
  color: var(--text);
  letter-spacing: -0.04em;
  white-space: nowrap;
  line-height: 1.1;
}

.nav-brand-en {
  display: block;
  font-weight: 500;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1.1;
}

.nav-brand:hover { text-decoration: none; }
.nav-brand:hover .nav-brand-ko { color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); text-decoration: none; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-theme {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.btn-theme:hover { background: var(--bg); border-color: var(--text-muted); }

.btn-theme svg { width: 18px; height: 18px; }

.btn-login {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  background: var(--accent);
  color: #fff !important;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s;
}

.btn-login:hover { background: var(--accent-hover); text-decoration: none !important; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.user-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.btn-logout {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-logout:hover { border-color: var(--text-muted); color: var(--text); text-decoration: none; }

/* ── Hero ── */
.hero {
  background: var(--bg-hero);
  color: var(--text);
  padding: 5rem 1.5rem 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  display: none;
}

.hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  color: rgba(255,255,255,0.85);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 2rem;
}

.hero-welcome {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e40af;
}

[data-theme='dark'] .hero-welcome {
  background: #1e293b;
  border-color: #334155;
  color: #93c5fd;
}

.hero-btns {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: #fff;
  color: #111 !important;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none !important;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  text-decoration: none !important;
}

.btn-outline {
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff !important;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  transition: background 0.15s;
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  text-decoration: none !important;
}

/* ── Sections ── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}

.card:hover { transform: translateY(-2px); }

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ── Legal pages ── */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.legal h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.legal .updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.legal h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.75rem 0 0.6rem;
  color: #111111;
}

[data-theme='dark'] .legal h2 {
  color: #ffffff;
}

.legal h1,
.legal p,
.legal li {
  color: var(--text);
}

.legal > p:first-of-type,
.legal p {
  font-size: 0.94rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.75;
}

.legal li {
  font-size: 0.94rem;
  color: var(--text);
  margin-bottom: 0.55rem;
  line-height: 1.7;
}

.legal ul {
  padding-left: 1.25rem;
  margin-bottom: 0.85rem;
}

.legal code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.legal strong {
  color: var(--text);
  font-weight: 700;
}

.legal-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.65;
}

.legal-table th {
  background: #f3f4f6;
  color: #111111;
  font-weight: 700;
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.legal-table td {
  padding: 0.8rem 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.legal-table tbody tr:last-child td {
  border-bottom: none;
}

.legal-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

[data-theme='dark'] .legal-table-wrap {
  border-color: #2a2a2a;
  background: #141414;
}

[data-theme='dark'] .legal-table th {
  background: #1f1f1f;
  color: #ffffff;
  border-color: #2a2a2a;
}

[data-theme='dark'] .legal-table td {
  border-color: #2a2a2a;
  color: #e8e8e8;
}

[data-theme='dark'] .legal-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.12);
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem 2.5rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: left;
  max-width: 1100px;
  margin: 0 auto;
}

[data-theme='dark'] .footer-links a {
  color: var(--text-muted);
}

[data-theme='dark'] .footer-links a:hover {
  color: var(--text);
}

[data-theme='dark'] .footer-link-privacy {
  color: var(--text) !important;
}

[data-theme='dark'] .footer-copy {
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-bottom: 1rem;
  list-style: none;
  padding: 0;
}

.footer-links li {
  display: flex;
  align-items: center;
}

.footer-links li:not(:last-child)::after {
  content: '|';
  margin: 0 0.65rem;
  color: #bbb;
  font-weight: 300;
}

.footer-links a {
  color: #444;
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
  color: #111;
}

.footer-link-info {
  color: #2563eb !important;
}

.footer-link-privacy {
  font-weight: 700 !important;
  color: #333 !important;
}

[data-theme='dark'] .footer-links a {
  color: var(--text-muted);
}

[data-theme='dark'] .footer-link-privacy {
  color: var(--text) !important;
}

.footer-notice {
  margin-bottom: 0.35rem;
  line-height: 1.6;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── OAuth result page ── */
.auth-result-wrap {
  min-height: calc(100vh - var(--nav-h) - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.auth-result-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  text-align: center;
  box-shadow: var(--shadow);
}

.auth-result-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
}

.auth-result-ok .auth-result-icon {
  background: #dcfce7;
  color: #15803d;
}

.auth-result-fail .auth-result-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.auth-result-card h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.65rem;
}

.auth-result-card p {
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.auth-result-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem !important;
}

.auth-result-home {
  display: inline-flex;
  margin-top: 1.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none !important;
}

.auth-result-home:hover {
  background: var(--accent-hover);
  text-decoration: none !important;
}

@media (max-width: 900px) {
  .nav {
    padding: 0.5rem 1rem;
  }

  .nav-inner {
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .nav-links {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
  }

  .nav-actions {
    margin-left: auto;
  }

  .user-chip span {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn-login {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
  }

  .hero {
    padding: 3rem 1.25rem 2.5rem;
  }

  .hero h1 {
    font-size: clamp(1.65rem, 6vw, 2.25rem);
  }

  .hero p {
    font-size: 0.95rem;
  }

  .section {
    padding: 2.5rem 1.25rem;
  }

  .legal {
    padding: 2rem 1.25rem 3.5rem;
  }

  .legal h1 {
    font-size: 1.45rem;
  }

  .footer {
    padding: 1.5rem 1.25rem 2rem;
  }

  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .footer-links li:not(:last-child)::after {
    content: none;
  }
}

@media (max-width: 480px) {
  .nav-brand-en {
    font-size: 0.58rem;
  }

  .btn-logout {
    display: none;
  }

  .user-chip {
    font-size: 0.78rem;
  }
}
