/* cert.gna-biz.club — 공공기관 증명서 조회 시연 (app.css 토큰 위에 페이지 스타일) */

/* ── 로그인 ─────────────────────────────────────────── */
.cert-auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.cert-auth-card {
  width: 360px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 32px 28px;
  box-shadow: 0 8px 30px rgba(31, 41, 55, .08);
  display: flex; flex-direction: column; gap: 8px;
}
.cert-auth-card h1 {
  margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px;
}
.cert-auth-card h1 .bi { color: var(--primary); }
.cert-auth-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.cert-auth-card label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cert-auth-err {
  background: #fef2f2; color: var(--danger);
  border: 1px solid #fecaca; border-radius: 6px;
  padding: 8px 10px; font-size: 12px;
}
.cert-auth-submit { margin-top: 14px; justify-content: center; }
.cert-auth-card .foot { color: var(--muted-2); font-size: 11px; text-align: center; margin-top: 12px; }

/* ── 공통 ───────────────────────────────────────────── */
.cert-badge-demo {
  display: inline-block; vertical-align: middle;
  background: var(--warn); color: #fff;
  font-size: 10px; font-weight: 600; letter-spacing: .5px;
  padding: 2px 7px; border-radius: 10px;
}

/* ── 상단바 ─────────────────────────────────────────── */
.cert-shell { min-height: 100vh; display: flex; flex-direction: column; }
.cert-topbar {
  height: 52px; flex: 0 0 auto;
  background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
}
.cert-brand { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.cert-brand .bi { color: var(--primary); font-size: 18px; }
.cert-logout { display: flex; align-items: center; gap: 10px; margin: 0; }
.cert-user { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.cert-logout-btn {
  border: 1px solid var(--border); background: var(--panel);
  font-size: 12px; padding: 5px 10px; border-radius: 6px; cursor: pointer;
}
.cert-logout-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── 본문: 좌측 카탈로그 + 우측 패널 ────────────────── */
.cert-body {
  flex: 1; display: grid; grid-template-columns: 360px 1fr;
  gap: 16px; padding: 16px; align-items: start;
  max-width: 1280px; width: 100%; margin: 0 auto;
}
.cert-catalog {
  display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100vh - 84px); overflow-y: auto;
}
.cert-org {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
}
.cert-org-title {
  margin: 0 0 8px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
}
.cert-org-title .bi { color: var(--primary); }
.cert-org-count {
  margin-left: auto; background: var(--primary-soft); color: var(--primary);
  font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px;
}
.cert-svc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.cert-svc {
  width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent;
  border-radius: 6px; padding: 6px 9px;
  font-size: 12.5px; color: var(--text); cursor: pointer;
  transition: all .12s;
}
.cert-svc:hover { background: var(--bg); border-color: var(--border); }
.cert-svc.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* ── 우측 서비스 패널 ───────────────────────────────── */
.cert-panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 24px;
  position: sticky; top: 16px; min-height: 320px;
}
.cert-empty {
  color: var(--muted-2); font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 280px;
}
.cert-detail { display: flex; flex-direction: column; gap: 16px; }
.cert-detail-head { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.cert-detail-org { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.cert-detail-org .bi { color: var(--primary); }
.cert-detail-name { margin: 0; font-size: 17px; }
.cert-detail-notice {
  background: var(--primary-soft); color: var(--primary-2);
  border-radius: 6px; padding: 10px 12px; font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
}
.cert-detail-flow {
  border: 1px solid var(--border-soft); border-radius: 6px; padding: 12px 14px;
}
.cert-detail-flow-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.cert-detail-flow ol { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text); display: flex; flex-direction: column; gap: 4px; }

/* ── 모바일 ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .cert-body { grid-template-columns: 1fr; }
  .cert-catalog { max-height: none; }
  .cert-panel { position: static; }
}

/* ── 조회 실행 폼 / 결과 ────────────────────────────── */
.b-linked { background: #dcfce7; color: #15803d; }
.cert-exec-form {
  display: flex; flex-direction: column; gap: 10px;
  max-width: 420px;
}
.cert-field { display: flex; flex-direction: column; gap: 4px; }
.cert-field-label { font-size: 12px; color: var(--muted); }
.cert-field-check { flex-direction: row; align-items: center; gap: 7px; font-size: 12.5px; }
.cert-exec-btn { align-self: flex-start; margin-top: 4px; }
.cert-nostore-note { color: var(--muted-2); font-size: 11px; display: flex; align-items: center; gap: 5px; }
.cert-result-host { margin-top: 18px; }
.cert-result { display: flex; flex-direction: column; gap: 12px; }
.cert-result-status { border-radius: 6px; padding: 10px 12px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.cert-result-status.ok   { background: #dcfce7; color: #15803d; }
.cert-result-status.fail { background: #fef2f2; color: var(--danger); }
.cert-result-scroll { overflow-x: auto; }
.cert-result-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.cert-result-table th, .cert-result-table td {
  border: 1px solid var(--border-soft); padding: 6px 9px; text-align: left; vertical-align: top;
}
.cert-result-table > tbody > tr > th { background: var(--bg); width: 160px; font-weight: 600; color: var(--muted); }
.cert-result-sub { border-collapse: collapse; font-size: 12px; }
.cert-result-sub th, .cert-result-sub td { border: 1px solid var(--border-soft); padding: 4px 7px; }
.cert-result-sub th { background: var(--bg); font-weight: 600; color: var(--muted); }

/* ── step형(간편인증) 추가 ──────────────────────────── */
.cert-field-hint { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.cert-result-status.pending { background: #fef9c3; color: #854d0e; }
.cert-sign-btn { align-self: flex-start; }
.cert-pdf-dl { align-self: flex-start; text-decoration: none; }
select.input { height: 32px; }

/* ── 디버그 body 출력 ───────────────────────────────── */
.cert-debug { border: 1px dashed var(--warn); border-radius: 6px; padding: 8px 10px; background: #fffbeb; }
.cert-debug summary { font-size: 12px; font-weight: 600; color: #92400e; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.cert-debug-pre { margin: 8px 0 0; font-size: 11.5px; line-height: 1.5; overflow-x: auto; white-space: pre; color: #1f2937; }

/* ── 카탈로그 서비스 상태 뱃지 ─────────────────────── */
.cert-svc { display: flex; align-items: center; gap: 6px; }
.cert-svc-nm { flex: 1; min-width: 0; }
.cert-svc-tag { flex: 0 0 auto; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px; }
.cert-svc-tag.ok { background: #dcfce7; color: #15803d; }
.cert-svc-tag.failed { background: #fef2f2; color: var(--danger); }
.cert-svc-tag.cert { background: #fef3c7; color: #92400e; }

/* ── 상단바 우측 (간편인증 테스트 + 로그아웃) ───────── */
.cert-topbar-right { display: flex; align-items: center; gap: 10px; }
.cert-svc-tag.done { background: #16a34a; color: #fff; }

/* ── 주소 검색 버튼 ─────────────────────────────────── */
.cert-addr-btn {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid var(--primary); border-radius: 6px;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .12s;
}
.cert-addr-btn:hover { background: var(--primary); color: #fff; }
.cert-addr-btn .bi { font-size: 14px; }
