/* 법적 문서 모달 스타일 */

/* 스피너 애니메이션 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* 모달 기본 구조 */
.legal-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.legal-modal.active {
    opacity: 1;
    visibility: visible;
}

/* 오버레이 (배경) */
.legal-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(11, 29, 58, 0.85);
    backdrop-filter: blur(4px);
}

/* 모달 컨테이너 */
.legal-modal-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 56rem; /* 896px */
    max-height: 90vh;
    margin: 1rem;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 
                0 10px 10px -5px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.legal-modal.active .legal-modal-container {
    transform: scale(1);
}

/* 모바일: 하단 시트 스타일 */
@media (max-width: 768px) {
    .legal-modal-container {
        max-width: 100%;
        max-height: 95vh;
        margin: 0;
        border-radius: 1.5rem 1.5rem 0 0;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(100%);
    }
    
    .legal-modal.active .legal-modal-container {
        transform: translateY(0);
    }
}

/* 모달 콘텐츠 */
.legal-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 90vh;
}

@media (max-width: 768px) {
    .legal-modal-content {
        max-height: 95vh;
    }
}

/* 모달 헤더 */
.legal-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #0B1D3A 0%, #1a3456 100%);
    color: white;
}

@media (max-width: 768px) {
    .legal-modal-header {
        padding: 1.25rem 1.5rem;
    }
}

.legal-modal-title-group {
    flex: 1;
    padding-right: 1rem;
}

.legal-modal-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: white;
}

.legal-modal-date {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* 닫기 버튼 */
.legal-modal-close-btn {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.legal-modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.legal-modal-close-btn:active {
    transform: scale(0.95);
}

/* 특별 안내 박스 */
.legal-modal-notice {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    margin: 1.5rem 2rem;
    background-color: #FEF3C7;
    border-left: 4px solid #F59E0B;
    border-radius: 0.5rem;
}

@media (max-width: 768px) {
    .legal-modal-notice {
        margin: 1rem 1.5rem;
    }
}

.legal-modal-notice p {
    margin: 0;
    font-size: clamp(0.813rem, 1.6vw, 0.938rem);
    line-height: 1.6;
    color: #78350F;
    font-weight: 500;
}

/* 모달 본문 */
.legal-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    line-height: 1.75;
}

@media (max-width: 768px) {
    .legal-modal-body {
        padding: 1.5rem;
    }
}

/* 스크롤바 스타일 */
.legal-modal-body::-webkit-scrollbar {
    width: 8px;
}

.legal-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.legal-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 법적 문서 콘텐츠 스타일 */
.legal-document {
    color: #1e293b;
}

.legal-document h3 {
    font-size: clamp(1.125rem, 2.2vw, 1.375rem);
    font-weight: 700;
    color: #0B1D3A;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.legal-document h3:first-child {
    margin-top: 0;
}

.legal-document h4 {
    font-size: clamp(1rem, 2vw, 1.125rem);
    font-weight: 600;
    color: #1e40af;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-document p {
    font-size: clamp(0.875rem, 1.75vw, 1rem);
    line-height: 1.8;
    color: #334155;
    margin-bottom: 1rem;
}

.legal-document .legal-intro {
    font-size: clamp(0.938rem, 1.88vw, 1.063rem);
    color: #475569;
    background-color: #f8fafc;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    border-left: 4px solid #3b82f6;
    margin-bottom: 1.5rem;
}

.legal-document ul,
.legal-document ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-document li {
    font-size: clamp(0.875rem, 1.75vw, 1rem);
    line-height: 1.8;
    color: #334155;
    margin-bottom: 0.5rem;
}

.legal-document .info-box {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.legal-document .info-box strong {
    display: block;
    color: #0c4a6e;
    font-size: clamp(1rem, 2vw, 1.125rem);
    margin-bottom: 0.75rem;
}

.legal-document .notice-box {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    font-size: clamp(0.875rem, 1.75vw, 1rem);
    line-height: 1.7;
    color: #78350f;
}

.legal-document .legal-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
    font-size: clamp(0.813rem, 1.63vw, 0.938rem);
    line-height: 1.7;
    color: #64748b;
}

.legal-document .legal-footer strong {
    display: block;
    color: #0B1D3A;
    font-size: clamp(1rem, 2vw, 1.125rem);
    margin-bottom: 0.5rem;
}

/* 푸터의 법적 문서 링크 스타일 */
.footer-legal-link {
    display: inline-block;
    color: #d1d5db;
    font-size: clamp(0.813rem, 1.63vw, 0.875rem);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal-link:hover {
    color: #F59E0B;
    text-decoration: underline;
}

/* 접근성 */
.legal-modal[aria-modal="true"] {
    /* 모달이 활성화되면 배경 요소와의 상호작용 방지 */
}

/* 화면 전환 애니메이션 최적화 */
@media (prefers-reduced-motion: reduce) {
    .legal-modal,
    .legal-modal-container,
    .legal-modal-close-btn {
        transition: none;
    }
}
