/*
 * 판매왕 약관·오류 화면 (terms/*.jsp, error/*.jsp) 공개 화면 톤.
 * - body.sm-ds-public.sm-info-page 에만 적용한다. 각 JSP 인라인 <style>은 그대로 두고 덮어쓴다.
 * - 회원가입 약관 모달(iframe) 안에서는 html.is-embedded 로 머리·푸터를 숨긴다.
 */
body.sm-ds-public.sm-info-page {
    margin: 0;
    background: var(--tp-canvas);
    color: var(--tp-text-default);
}

/* ── 머리: 시리즈 마크 + 판매왕 ── */
body.sm-info-page .sm-info-head {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 56px;
    background: var(--tp-surface);
    border-bottom: 1px solid var(--tp-border-default);
}
body.sm-info-page .sm-info-head__inner {
    display: flex;
    align-items: center;
    width: min(var(--tp-container-max), 100% - 48px);
    height: 100%;
    margin: 0 auto;
}
body.sm-info-page .sm-info-head__brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--tp-text-strong);
    font-size: var(--tp-font-size-title);
    font-weight: 800;
    text-decoration: none;
}
body.sm-info-page .sm-info-head__brand .sm-series-mark {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}
body.sm-info-page .sm-info-head__brand:focus-visible {
    outline: none;
    border-radius: var(--tp-radius-sm);
    box-shadow: var(--tp-focus-ring);
}

/* ── 약관 본문 카드 ── */
body.sm-info-page .terms-container {
    box-sizing: border-box;
    width: min(900px, 100% - 32px);
    max-width: none;
    min-height: 0;
    margin: 24px auto 0;
    padding: 32px 40px;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border-default);
    border-radius: var(--tp-radius-xl);
    box-shadow: var(--tp-shadow-xs);
}
body.sm-info-page .terms-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tp-border-default);
}
body.sm-info-page .terms-title {
    margin: 0 0 8px;
    color: var(--tp-text-strong);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
body.sm-info-page .terms-meta {
    color: var(--tp-text-muted);
    font-size: var(--tp-font-size-caption);
    line-height: var(--tp-line-height-caption);
}
body.sm-info-page .terms-content { padding: 0; }
body.sm-info-page .terms-content pre {
    color: var(--tp-text-default);
    font-size: var(--tp-font-size-body);
    line-height: 1.8;
}
body.sm-info-page .terms-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--tp-border-subtle);
}
body.sm-info-page .terms-section h2 {
    margin: 0 0 10px;
    color: var(--tp-text-strong);
    font-size: var(--tp-font-size-body-strong);
    font-weight: 700;
    line-height: var(--tp-line-height-body-strong);
}
body.sm-info-page .terms-section p,
body.sm-info-page .terms-section li {
    color: var(--tp-text-default);
    font-size: var(--tp-font-size-body);
    line-height: 1.75;
}
body.sm-info-page .terms-section strong { color: var(--tp-text-strong); }
body.sm-info-page .contact-box {
    margin-top: 24px;
    padding: 16px 18px;
    background: var(--tp-surface-muted);
    border: 1px solid var(--tp-border-subtle);
    border-radius: var(--tp-radius-lg);
    color: var(--tp-text-default);
    font-size: var(--tp-font-size-caption);
    line-height: 1.7;
}
body.sm-info-page .terms-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--tp-border-subtle);
}

/* ── 주요 버튼(닫기·돌아가기) ── */
body.sm-info-page .btn-close,
body.sm-info-page .btn-back,
body.sm-info-page .error-container .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 160px;
    height: 48px;
    min-height: 48px;
    padding: 0 24px;
    background: var(--tp-color-accent);
    border: 0;
    border-radius: var(--tp-radius-lg);
    box-shadow: var(--tp-shadow-accent);
    color: var(--tp-surface);
    font-size: var(--tp-font-size-body-strong);
    font-weight: 700;
    text-decoration: none;
    transition: background-color var(--tp-motion-fast);
}
body.sm-info-page .btn-close:hover,
body.sm-info-page .btn-back:hover,
body.sm-info-page .error-container .btn:hover { background: var(--tp-color-accent-hover); }
body.sm-info-page .btn-close:focus-visible,
body.sm-info-page .btn-back:focus-visible,
body.sm-info-page .error-container .btn:focus-visible {
    outline: none;
    box-shadow: var(--tp-focus-ring);
}

/* ── 오류 화면 ── */
body.sm-info-page .error-container {
    box-sizing: border-box;
    width: min(560px, 100% - 32px);
    max-width: none;
    min-height: calc(100vh - 56px - 160px);
    margin: 0 auto;
    padding: 64px 0 24px;
    background: transparent;
}
body.sm-info-page .error-code {
    margin-bottom: 16px;
    color: var(--tp-color-accent);
    font-size: 72px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
body.sm-info-page .error-code--server { color: var(--tp-status-danger-fg); }
body.sm-info-page .error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--tp-status-warning-bg);
    border-radius: var(--tp-radius-full);
}
body.sm-info-page .error-icon svg { width: 40px; height: 40px; }
body.sm-info-page .error-title {
    margin: 0 0 12px;
    color: var(--tp-text-strong);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.35;
}
body.sm-info-page .error-message {
    margin: 0 0 32px;
    color: var(--tp-text-muted);
    font-size: var(--tp-font-size-body-strong);
    line-height: 1.6;
}

@media (max-width: 767px) {
    body.sm-info-page .sm-info-head__inner { width: calc(100% - 40px); }
    body.sm-info-page .terms-container {
        width: calc(100% - 24px);
        margin-top: 12px;
        padding: 20px;
    }
    body.sm-info-page .terms-title { font-size: 20px; }
    body.sm-info-page .error-container { padding-top: 48px; }
    body.sm-info-page .error-code { font-size: 56px; }
    body.sm-info-page .error-title { font-size: 20px; }
}

/* ── 약관 모달(iframe) 안: 본문만 ── */
html.is-embedded body.sm-info-page { background: var(--tp-surface); }
html.is-embedded body.sm-info-page .sm-info-head,
html.is-embedded body.sm-info-page .sm-footer { display: none; }
html.is-embedded body.sm-info-page .terms-container {
    width: 100%;
    margin: 0;
    padding: 24px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
