:root {
  color-scheme: light;
  --brand: #0b4da2;       /* 기관 브랜드(공공기관 톤) */
  --brand-deep: #08315f;
  --ink: #1f2937;
  --sub: #6b7280;
  --line: #e5e7eb;
  --bg: #f5f6f8;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font-family: "Pretendard", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
}
a { color: inherit; text-decoration: none; }

/* 상단 유틸 바 */
.util { background: var(--brand-deep); color: #cdd9ec; font-size: 12px; }
.util .wrap { max-width: 1160px; margin: 0 auto; padding: 7px 24px; display: flex; justify-content: flex-end; gap: 18px; }
.util a:hover { color: #fff; }

/* 메인 네비 */
.nav { background: #fff; border-bottom: 1px solid var(--line); }
.nav .wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 68px; display: flex; align-items: center; gap: 36px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .mark { font-weight: 800; font-size: 21px; color: var(--brand); letter-spacing: -0.4px; }
.brand .tag { font-size: 11px; color: #9aa3af; }
.menu { display: flex; gap: 28px; font-size: 15px; font-weight: 600; color: #374151; }
.menu a:hover { color: var(--brand); }
.nav .spacer { flex: 1; }
button.cta {
  appearance: none; border: 0; cursor: pointer; white-space: nowrap;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 700;
  padding: 11px 20px; border-radius: 8px; box-shadow: 0 2px 6px rgba(11,77,162,.25);
}
button.cta:hover { background: #0a4490; }
button.cta:disabled { opacity: .6; cursor: progress; }

/* 히어로 */
.hero { background: linear-gradient(110deg, #0b4da2 0%, #0a3f86 55%, #072b5e 100%); color: #fff; }
.hero .wrap { max-width: 1160px; margin: 0 auto; padding: 64px 24px 72px; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.hero h1 { margin: 0 0 14px; font-size: 34px; line-height: 1.32; font-weight: 800; letter-spacing: -0.6px; }
.hero p { margin: 0 0 28px; font-size: 16px; line-height: 1.7; color: #d6e2f4; max-width: 520px; }
.hero .cta-lg { font-size: 16px; padding: 15px 30px; background: #fff; color: var(--brand); box-shadow: 0 8px 24px rgba(0,0,0,.18); display: inline-flex; align-items: center; gap: 8px; }
.hero .status { margin-top: 14px; font-size: 13px; color: #bcd0ee; min-height: 18px; }
.hero .art { font-size: 116px; line-height: 1; filter: drop-shadow(0 12px 24px rgba(0,0,0,.25)); }

/* 카테고리 */
.cats { max-width: 1160px; margin: -28px auto 0; padding: 0 24px; position: relative; z-index: 2; }
.cats .row { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px -16px rgba(0,0,0,.2); display: grid; grid-template-columns: repeat(6, 1fr); }
.cats .cell { padding: 20px 8px; text-align: center; border-right: 1px solid var(--line); }
.cats .cell:last-child { border-right: 0; }
.cats .cell .ic { font-size: 26px; }
.cats .cell .lb { margin-top: 8px; font-size: 13px; font-weight: 600; color: #374151; }

/* 과정 섹션 */
section.courses { max-width: 1160px; margin: 56px auto; padding: 0 24px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.sec-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.sec-head .more { margin-left: auto; font-size: 13px; color: var(--sub); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card .thumb { height: 124px; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.card .body { padding: 14px 15px 16px; }
.card .badge { display: inline-block; font-size: 11px; font-weight: 700; color: var(--brand); background: #eaf1fb; padding: 3px 8px; border-radius: 5px; }
.card .ti { margin: 9px 0 6px; font-size: 15px; font-weight: 700; line-height: 1.4; color: #1f2937; }
.card .meta { font-size: 12px; color: var(--sub); }

/* 푸터 */
footer { background: #1b2330; color: #9aa6b6; font-size: 12px; margin-top: 40px; }
footer .wrap { max-width: 1160px; margin: 0 auto; padding: 28px 24px; line-height: 1.8; }

/* 인증 상태 */
#auth-area .who { color: #fff; font-weight: 700; }
#auth-area .who small { color: #9fb3d4; font-weight: 400; }

/* 로그인 모달 (기관 자체 — 위젯 iframe 과 무관) */
.login-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: center; justify-content: center; z-index: 1000; }
.login-backdrop.open { display: flex; }
.login-box { background: #fff; width: 380px; max-width: calc(100vw - 32px); border-radius: 14px; padding: 28px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.4); }
.login-box h3 { margin: 0 0 4px; font-size: 19px; }
.login-box .desc { margin: 0 0 20px; font-size: 13px; color: var(--sub); line-height: 1.6; }
.login-box label { display: block; font-size: 12px; font-weight: 700; color: #374151; margin: 0 0 6px; }
.login-box select, .login-box input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; margin-bottom: 14px; background: #fff; }
.login-box .keys { font-size: 11px; color: #9aa3af; background: #f6f8fb; border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; line-height: 1.7; }
.login-box .keys b { color: #374151; }
.login-box .actions { display: flex; gap: 8px; }
.login-box button { flex: 1; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; border: 0; }
.login-box .ghost { background: #fff; border: 1px solid var(--line); color: #374151; }
.login-box .primary { background: var(--brand); color: #fff; }
.login-box .err { color: #dc2626; font-size: 12px; min-height: 16px; margin-bottom: 8px; }

/* ── 아키텍처 인스펙터 (FAB + 패널) — iframe(z≈2.1e9) 위에 떠야 함 ── */
.insp-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 2147483600;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: #111827; color: #fff; font-size: 22px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center;
}
.insp-fab:hover { background: #000; }
.insp-panel {
  position: fixed; right: 22px; bottom: 88px; z-index: 2147483500;
  width: 380px; max-width: calc(100vw - 44px); max-height: calc(100vh - 130px);
  background: #0f172a; color: #e5e7eb; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.5); display: none; flex-direction: column;
  font-size: 12px;
}
.insp-panel.open { display: flex; }
.insp-panel .head { padding: 14px 16px; border-bottom: 1px solid #1e293b; display: flex; align-items: center; gap: 8px; }
.insp-panel .head b { font-size: 13px; }
.insp-panel .head .reset { margin-left: auto; background: #1e293b; border: 0; color: #94a3b8; font-size: 11px; padding: 5px 9px; border-radius: 6px; cursor: pointer; }
.insp-panel .body { overflow-y: auto; }

/* 3티어 다이어그램 */
.tiers { display: flex; align-items: stretch; gap: 6px; padding: 16px; background: #0b1220; }
.tier { flex: 1; border: 1px solid #283449; border-radius: 9px; padding: 10px 8px; text-align: center; transition: all .25s; background: #111c2f; }
.tier .tt { font-size: 10px; color: #64748b; }
.tier .nm { font-size: 12px; font-weight: 700; margin-top: 2px; color: #cbd5e1; }
.tier.active { border-color: #38bdf8; background: #0c2a3f; box-shadow: 0 0 0 2px rgba(56,189,248,.25); }
.tier.active .nm { color: #7dd3fc; }
.arrow { align-self: center; color: #475569; font-size: 14px; }
.arrow.active { color: #38bdf8; }
.widget-chip { margin: 0 16px 12px; padding: 8px 10px; border: 1px dashed #334155; border-radius: 8px; text-align: center; color: #94a3b8; background: #0b1220; transition: all .25s; }
.widget-chip.active { border-color: #38bdf8; color: #7dd3fc; }

/* 단계 아코디언 */
.stages { padding: 6px 12px 14px; }
.stage { border-top: 1px solid #1e293b; }
.stage-h { display: flex; align-items: center; gap: 8px; padding: 10px 4px; cursor: pointer; }
.stage-h .dot { width: 8px; height: 8px; border-radius: 50%; background: #334155; flex-shrink: 0; }
.stage.done .dot { background: #22c55e; }
.stage.active .dot { background: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.25); }
.stage-h .nm { font-weight: 600; color: #cbd5e1; }
.stage-h .ct { margin-left: auto; color: #64748b; font-size: 11px; }
.stage-h .cv { color: #475569; transition: transform .2s; }
.stage.open .stage-h .cv { transform: rotate(90deg); }
.stage-evs { display: none; padding: 0 4px 8px; }
.stage.open .stage-evs { display: block; }
.ev { background: #0b1220; border: 1px solid #1e293b; border-radius: 7px; padding: 8px 10px; margin-bottom: 6px; }
.ev .l1 { display: flex; gap: 6px; align-items: center; }
.ev .mth { font-weight: 700; color: #fbbf24; }
.ev .st { margin-left: auto; font-weight: 700; }
.ev .st.ok { color: #22c55e; } .ev .st.bad { color: #f87171; }
.ev .u { color: #93c5fd; word-break: break-all; margin-top: 4px; font-size: 11px; }
.ev .x { color: #64748b; margin-top: 4px; font-size: 11px; line-height: 1.5; }
.ev .path { color: #38bdf8; font-size: 10px; margin-top: 4px; }

/* 인스펙터 — 백엔드 호출이 nginx(DMZ)를 거쳤는지 표시 */
.ev .dmz { margin-top: 4px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; display: inline-block; }
.ev .dmz.ok { background: rgba(34,197,94,0.16); color: #22c55e; }
.ev .dmz.bad { background: rgba(248,113,113,0.16); color: #f87171; }
