/* 이용약관·개인정보 처리방침 모달 (가입/내 정보 등) */
.portal-legal-modal {
    border: none;
    padding: 0;
    margin: auto;
    width: min(92vw, 560px);
    max-height: min(86vh, 720px);
    background: transparent;
    color: #0f172a;
}

.portal-legal-modal::backdrop {
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
}

.portal-legal-modal__panel {
    display: flex;
    flex-direction: column;
    max-height: min(86vh, 720px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.35);
    overflow: hidden;
}

.portal-legal-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem 1.15rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    flex: 0 0 auto;
}

.portal-legal-modal__heading {
    min-width: 0;
}

.portal-legal-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: #0f172a;
}

.portal-legal-modal__meta {
    margin: 0.3rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.portal-legal-modal__close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    margin: -0.15rem -0.15rem 0 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.portal-legal-modal__close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.portal-legal-modal__close:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 1px;
}

.portal-legal-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.15rem 1.15rem;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #334155;
    text-align: left;
}

.portal-legal-modal__body > *:first-child {
    margin-top: 0;
}

.portal-legal-modal__body h1,
.portal-legal-modal__body h2,
.portal-legal-modal__body h3,
.portal-legal-modal__body h4 {
    margin: 1.25rem 0 0.5rem;
    color: #0f172a;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.portal-legal-modal__body h1 { font-size: 1.05rem; }
.portal-legal-modal__body h2 { font-size: 0.975rem; }
.portal-legal-modal__body h3,
.portal-legal-modal__body h4 { font-size: 0.9rem; }

.portal-legal-modal__body p {
    margin: 0 0 0.75rem;
}

.portal-legal-modal__body ul,
.portal-legal-modal__body ol {
    margin: 0 0 0.85rem;
    padding-left: 1.2rem;
}

.portal-legal-modal__body li {
    margin: 0.25rem 0;
}

.portal-legal-modal__body a {
    color: #0369a1;
    font-weight: 500;
    text-decoration: none;
}

.portal-legal-modal__body a:hover {
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.portal-legal-modal__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1rem;
    font-size: 0.8125rem;
}

.portal-legal-modal__body th,
.portal-legal-modal__body td {
    border: 1px solid #e2e8f0;
    padding: 0.45rem 0.55rem;
    text-align: left;
    vertical-align: top;
}

.portal-legal-modal__body th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 600;
}

.portal-legal-modal__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    padding: 0.75rem 1.15rem 0.9rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex: 0 0 auto;
}

.portal-legal-modal__fullpage {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #0369a1;
    text-decoration: none;
}

.portal-legal-modal__fullpage:hover {
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.portal-legal-modal__done {
    margin-left: auto;
    padding: 0.45rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 55%, #0369a1 100%);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 12px -4px rgba(2, 132, 199, 0.5);
}

.portal-legal-modal__done:hover {
    filter: brightness(1.04);
}

.portal-legal-modal__done:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

@media (max-width: 520px) {
    .portal-legal-modal {
        width: min(96vw, 560px);
        max-height: min(90vh, 720px);
    }

    .portal-legal-modal__panel {
        max-height: min(90vh, 720px);
        border-radius: 12px;
    }
}
