/* Exition 공통 UI 패턴 — 모든 도구 페이지에서 일관된 에러·재진단·공유 스타일.

   사용:
     <link rel="stylesheet" href="/static/common-ui.css" />

   적용 대상:
     - #error 또는 .err — 폼 에러 메시지
     - .retry-tool-btn — 결과 하단 "다시 진단하기" 버튼 (도구별로 추가)
*/

/* 에러 메시지 — 모든 도구 페이지에서 동일한 강조 스타일 */
#error,
.err {
  background: rgba(255, 122, 138, 0.10);
  border: 1px solid rgba(255, 122, 138, 0.55);
  border-left-width: 3px;
  color: #ffb1bd;
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.55;
}

#error:empty,
.err:empty {
  display: none !important;
}

/* "다시 진단하기" 버튼 — 결과 화면 하단에서 폼으로 부드럽게 복귀 */
.retry-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 20px auto 0;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--text, #e8e8f0);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.retry-tool-btn:hover {
  border-color: var(--gold, #d4a857);
  color: var(--gold, #d4a857);
  background: rgba(212, 168, 87, 0.05);
}

.retry-tool-row {
  display: flex;
  justify-content: center;
  margin: 24px 0 8px;
}

/* 접근성 — 라디오/체크박스 라벨이 input을 가리는 경우(display:none 패턴) 키보드 포커스 표시.
   ex: <label><input type="radio" .../>옵션</label> 형태에서 input이 :focus-visible이면
   감싸는 label에 또렷한 outline을 표시. */
input[type="radio"]:focus-visible + span,
input[type="radio"]:focus-visible,
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-2, #7afcff);
  outline-offset: 2px;
}

/* 숨겨진 input(display:none)을 감싸는 label은 직접 outline */
label:has(input[type="radio"]:focus-visible),
label:has(input[type="checkbox"]:focus-visible) {
  outline: 2px solid var(--accent-2, #7afcff);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 일반 버튼·링크의 키보드 포커스 강조 */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-2, #7afcff);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   결과 페이지 공통 컴포넌트 — 모든 도구에서 같은 톤·구조로 일관성 확보.
   ============================================================ */

/* 1) "이 결과 어떻게 읽나" 안내 카드 — 도구 결과 페이지에서 사용자가 결과 해석법을 알도록.
      사용: <div class="result-help-card"><div class="rh-title">📍 이 결과를 어떻게 읽나요</div>
            <div class="rh-body"><p>...</p></div></div> */
.result-help-card {
  background: rgba(212, 168, 87, 0.04);
  border: 1px solid var(--gold-soft, rgba(212, 168, 87, 0.55));
  border-left-width: 3px;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 18px 0;
}
.result-help-card .rh-title {
  font-weight: 700;
  color: var(--gold, #d4a857);
  font-size: 14px;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}
.result-help-card .rh-body {
  color: var(--text, #e8e8f0);
  font-size: 13.5px;
  line-height: 1.75;
}
.result-help-card .rh-body p { margin: 6px 0; }
.result-help-card .rh-body b { color: var(--gold, #d4a857); }
.result-help-card .rh-body ul { padding-left: 18px; margin: 6px 0; }
.result-help-card .rh-body li { margin: 4px 0; }

/* 2) 공통 면책 footer — 모든 도구 결과 페이지 하단에 동일한 톤으로.
      사용: <div class="result-footer-note">...</div> + <div class="result-biz-info">...</div> */
.result-footer-note {
  margin-top: 40px;
  color: var(--dim, #8a8aa0);
  font-size: 11.5px;
  line-height: 1.7;
  text-align: center;
}
.result-footer-note b { color: var(--text, #e8e8f0); }
.result-footer-note .rfn-strong {
  font-weight: 700;
  color: var(--text, #e8e8f0);
}
.result-biz-info {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #1f1f33);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--dim, #8a8aa0);
}
.result-biz-info b { color: var(--text, #e8e8f0); }
.result-biz-info a {
  color: var(--dim, #8a8aa0);
  text-decoration: none;
}
.result-biz-info a:hover { color: var(--gold, #d4a857); }

/* 3) 공유 카드 공통 스타일 — 도구마다 색상은 다르더라도 구조 일관 */
.result-share-card {
  background: rgba(122, 252, 255, 0.04);
  border: 1px solid rgba(122, 252, 255, 0.30);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 24px 0 18px;
}
.result-share-card .rsh-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-2, #7afcff);
  margin-bottom: 6px;
}
.result-share-card .rsh-desc {
  color: var(--dim, #8a8aa0);
  font-size: 12.5px;
  line-height: 1.65;
  margin-bottom: 10px;
}
.result-share-card .rsh-preview {
  background: var(--bg, #07070d);
  border: 1px solid var(--line, #1f1f33);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text, #e8e8f0);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}
.result-share-card .rsh-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.result-share-card .rsh-btn {
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--line, #1f1f33);
  color: var(--text, #e8e8f0);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.result-share-card .rsh-btn:hover {
  border-color: var(--accent-2, #7afcff);
  color: var(--accent-2, #7afcff);
}
.result-share-card .rsh-btn.primary {
  background: var(--accent-2, #7afcff);
  border-color: var(--accent-2, #7afcff);
  color: #07070d;
}
.result-share-card .rsh-btn.primary:hover {
  filter: brightness(1.08);
  color: #07070d;
}
.result-share-card .rsh-btn.copied {
  background: var(--good, #7affc6);
  border-color: var(--good, #7affc6);
  color: #0a3320;
}

/* 4) 작은 용어 풀이 — 매칭·시대·카르마처럼 사주 외 도구도 전문 용어를 풀어주기.
      사용: <details class="result-glossary"><summary>📚 용어 풀이</summary>
            <div class="rg-body"><p>...</p></div></details> */
.result-glossary {
  background: var(--bg-2, #0e0e1a);
  border: 1px solid var(--line, #1f1f33);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 18px 0;
}
.result-glossary summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--gold, #d4a857);
  font-size: 13px;
  letter-spacing: 0.2px;
  list-style: none;
}
.result-glossary summary::-webkit-details-marker { display: none; }
.result-glossary summary::after {
  content: " ▾";
  color: var(--dim, #8a8aa0);
  font-weight: 400;
}
.result-glossary[open] summary::after { content: " ▴"; }
.result-glossary .rg-body {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text, #e8e8f0);
}
.result-glossary .rg-body p { margin: 6px 0; }
.result-glossary .rg-body b { color: var(--gold, #d4a857); }

