/**
 * TrustNow Session Policy / Step-up UI
 * 접두사 tn-session- / tn-stepup- 로 사이트 전역 스타일과 분리
 */

/* ---- 공통 페이지 래퍼 (redirect / result) ---- */
.tn-stepup-page,
.tn-sp-page {
  box-sizing: border-box;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  color: #0f172a;
}

.tn-stepup-page__title,
.tn-sp-page__title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 1rem;
  line-height: 1.3;
}

/* ---- 상태: info / warning / danger / success ---- */
.tn-stepup--info {
  color: #1e40af;
}
.tn-stepup--warning {
  color: #92400e;
}
.tn-stepup--danger {
  color: #991b1b;
}
.tn-stepup--success {
  color: #166534;
}

/* ---- 상단 배너 ---- */
.tn-session-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

.tn-session-banner--info {
  background: #eff6ff;
  color: #1e40af;
  border-bottom: 1px solid #bfdbfe;
}

.tn-session-banner--warning {
  background: #fffbeb;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
}

.tn-session-banner--danger {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
}

.tn-session-banner--success {
  background: #f0fdf4;
  color: #166534;
  border-bottom: 1px solid #bbf7d0;
}

.tn-session-banner__text {
  flex: 1;
  min-width: 12rem;
}

.tn-session-banner__op {
  font-size: 0.75rem;
  opacity: 0.88;
  font-family: ui-monospace, monospace;
}

/* ---- 모달 오버레이 / 박스 ---- */
.tn-stepup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.55);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.tn-stepup-modal {
  max-width: 28rem;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.tn-stepup-modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.tn-stepup-modal__body {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #334155;
}

.tn-stepup-modal__meta {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: #64748b;
}

/* ---- 운영자 상세 ---- */
.tn-stepup-detail {
  margin: 0 0 1rem;
}

.tn-stepup-detail__pre {
  margin: 0;
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  overflow: auto;
  max-height: 10rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- 버튼 행 ---- */
.tn-stepup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
}

.tn-stepup-modal .tn-stepup-actions {
  justify-content: flex-end;
}

/* ---- 버튼 / 링크 ---- */
.tn-stepup-btn {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  box-sizing: border-box;
  text-align: center;
}

.tn-stepup-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.tn-stepup-btn--primary {
  background: #2563eb;
  color: #fff;
}

.tn-stepup-btn--primary:hover {
  background: #1d4ed8;
}

.tn-stepup-btn--secondary {
  background: #e2e8f0;
  color: #334155;
}

.tn-stepup-btn--secondary:hover {
  background: #cbd5e1;
}

.tn-stepup-btn--small {
  padding: 0.25rem 0.65rem;
  font-size: 0.8125rem;
}

.tn-stepup-btn:disabled,
.tn-stepup-btn--disabled-policy {
  opacity: 0.55;
  cursor: not-allowed;
}

.tn-stepup-link {
  color: #2563eb;
  text-decoration: underline;
  font-size: 0.875rem;
  cursor: pointer;
}

.tn-stepup-link:hover {
  color: #1d4ed8;
}

.tn-stepup-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ---- redirect / result 본문 ---- */
.tn-stepup-msg {
  margin: 0 0 1rem;
  line-height: 1.55;
  font-size: 0.9375rem;
  color: #334155;
}

.tn-stepup-msg--muted {
  font-size: 0.875rem;
  color: #64748b;
}

.tn-stepup-msg--error {
  color: #b91c1c;
}

.tn-stepup-result-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.75rem;
  line-height: 1.35;
}

/* ---- 하위 호환: 기존 tn-sp-* ---- */
.tn-sp-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.55);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.tn-sp-modal {
  max-width: 28rem;
  width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.tn-sp-btn {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

.tn-sp-btn--primary {
  background: #2563eb;
  color: #fff;
}

.tn-sp-btn--secondary {
  background: #e2e8f0;
  color: #334155;
}

.tn-sp-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
}

.tn-sp-banner--info {
  background: #eff6ff;
  color: #1e40af;
  border-bottom: 1px solid #bfdbfe;
}

.tn-sp-banner--warn {
  background: #fffbeb;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
}

.tn-sp-banner--danger {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
}

.tn-sp-link {
  color: #2563eb;
  text-decoration: underline;
  font-size: 0.875rem;
}

@media (max-width: 480px) {
  .tn-stepup-page,
  .tn-sp-page {
    padding: 1rem 0.75rem 2rem;
  }

  .tn-stepup-modal {
    padding: 1.15rem;
  }
}
