body, html {
    font-family: 'Noto Sans KR', sans-serif;
    height: 100%;
    margin: 0;
    overflow: hidden; /* 초기 로딩 중 스크롤 방지 */
    background-color: #000;
}

/* 로딩이 끝나고 메인 콘텐츠가 나타날 때 body에 추가될 클래스 */
body.splash-loaded {
    overflow: auto; /* 스크롤 허용 */
}

/* ========================================
   Splash Screen Styles
   ======================================== */

/* 스플래시 스크린 컨테이너 */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    background-image: url('/intro/images/new_start_back.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
}

/* 스플래시 스크린 페이드아웃 */
#splash-screen.fade-out {
    opacity: 0 !important;
    visibility: hidden;
}

/* 로고 뒤의 검은색 오버레이 */
#splash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

/* 오버레이 페이드아웃 */
#splash-overlay.fade-out-logo-bg {
    opacity: 0 !important;
}

/* 로고 이미지 (모바일 기본) */
#splash-logo {
    max-width: 400px;
    max-height: 120px;
    width: auto;
    height: auto;
    opacity: 0;
    transform: scale(0.8);
}

/* PC 환경 로고 크기 */
@media (min-width: 790px) {
    #splash-logo {
        max-width: 800px;
        max-height: 250px;
    }
}

/* 로고 페이드인 */
#splash-logo.logo-fade-in {
    opacity: 1;
    transform: scale(1);
}

/* 로고 페이드아웃 */
#splash-logo.logo-fade-out {
    opacity: 0;
    transform: scale(1.2);
}

/* ========================================
   Main Content Styles
   ======================================== */

#main-content {
    display: block;
    min-height: 100vh;
    background-image: url('/intro/images/new_start_back.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(5px);
    transform: scale(1.05);
    transition: filter 1.5s ease-out, transform 1.5s ease-out;
    opacity: 0;
    transition: opacity 0.5s ease-out, filter 1.5s ease-out, transform 1.5s ease-out;
}

/* 메인 콘텐츠 활성화 */
#main-content.active-content {
    filter: blur(0px);
    transform: scale(1);
    opacity: 1;
}

/* ========================================
   Page Layout Styles
   ======================================== */

.main {
    position: relative;
    color: white;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 35px;
}

.dim {
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    z-index: 100;
    opacity: 0.85;
    background-color: rgb(0, 0, 0);
    z-index: 1;
    pointer-events: none; /* 배경 어둡게만 하고 클릭은 통과 */
}

.logo {
    position: fixed;
    top: 0;
    left: 16px;
    z-index: 2;
    margin-top: 15px;
}

.logo img {
    height: 50px;
}

.login {
    position: fixed;
    top: 0;
    right: 16px;
    color: red;
    z-index: 2;
    font-size: 20px;
    font-weight: bold;
}

.m-div {
    width: 100%;
    height: 90%;
    position: fixed;
    z-index: 5;
    top: 10%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.middle {
    width: 670px;
    max-width: 90%;
    position: relative;
    text-align: center;
    z-index: 3;
    margin: 0 auto;
}

.footer {
    width: 95%;
    position: fixed;
    bottom: 1px;
    left: 50%;
    transform: translate(-50%);
    text-align: center;
    z-index: 3;
}

.logo-text {
    color: red;
    font-size: 1.2em;
}

.text1 {
    font-size: 22px;
    font-weight: 600;
}

.text2 {
    font-size: 30px;
    color: red;
    font-weight: 900;
}

.text3 {
    font-size: 16px;
    color: rgb(255, 254, 254);
}

.text4 {
    font-size: 12px;
    color: rgb(255, 254, 254);
}

/* ========================================
   Button Styles
   ======================================== */

.red__btn, .line__btn, .info__btn {
    display: inline-block;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    border-radius: 5px;
}

.red__btn {
    width: 110px;
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    background-color: #e5001c;
    padding: 15px;
}

.line__btn {
    width: 110px;
    font-size: 14px;
    font-weight: 400;
    border: 1px solid #e5001c;
    color: #e5001c;
    padding: 15px;
}

.info__btn {
    width: 100px;
    font-size: 12px;
    font-weight: 400;
    color: #ffffff;
    padding: 5px;
}

/* ========================================
   Terms Popup Styles (약관 팝업)
   ======================================== */

.terms-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.terms-overlay.active {
    opacity: 1;
}

.terms-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 1px solid #333;
    border-radius: 12px;
    width: 70%;
    max-width: 800px;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease-in-out;
}

.terms-overlay.active .terms-modal {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.terms-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #2a2a2a;
    position: relative;
    flex-shrink: 0;
}

.terms-modal-header h3 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.terms-modal-content {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    color: #ddd;
    font-size: 14px;
    line-height: 1.8;
}

/* 스크롤바 커스텀 */
.terms-modal-content::-webkit-scrollbar {
    width: 8px;
}

.terms-modal-content::-webkit-scrollbar-track {
    background: #0a0a0a;
    border-radius: 10px;
}

.terms-modal-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.terms-modal-content::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.terms-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #2a2a2a;
    text-align: center;
    flex-shrink: 0;
}

.terms-close-btn-bottom {
    padding: 12px 40px;
    background: #2a2a2a;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.terms-close-btn-bottom:hover {
    background: #3a3a3a;
}

/* ========================================
   Login Modal Styles (로그인 모달)
   ======================================== */

.login-modal-overlay {
    display: none;
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    backdrop-filter: blur(8px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 50px 0 150px 0;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.login-modal-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.login-modal {
    position: relative;
    margin: 0 auto;
    background: linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 1px solid #333;
    border-radius: 12px;
    width: calc(100% - 40px);
    max-width: 420px;
    padding: 40px 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease-in-out, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-modal-overlay.active .login-modal {
    opacity: 1;
    transform: translateY(0);
}

.login-modal-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-modal-header h2 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.login-modal-header p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.login-form-group {
    margin-bottom: 20px;
}

.login-form-group label {
    display: block;
    color: #bbb;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.login-form-input {
    width: 100%;
    padding: 14px 16px;
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    font-family: 'Noto Sans KR', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login-form-input:focus {
    outline: none;
    border-color: #e5001c;
    background: #151515;
    box-shadow: 0 0 0 3px rgba(229, 0, 28, 0.1);
}

.login-form-input::placeholder {
    color: #555;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0 25px 0;
    font-size: 13px;
}

.login-remember {
    display: flex;
    align-items: center;
    color: #999;
    cursor: pointer;
}

.login-remember input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
}

.login-forgot {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.login-forgot:hover {
    color: #e5001c;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #e5001c 0%, #b8001a 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 0, 28, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, #ff001f 0%, #c9001d 100%);
    box-shadow: 0 6px 20px rgba(229, 0, 28, 0.4);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #2a2a2a;
}

.login-divider span {
    background: #1a1a1a;
    color: #666;
    padding: 0 15px;
    position: relative;
    font-size: 13px;
}

.login-signup {
    text-align: center;
    margin-top: 20px;
    color: #888;
    font-size: 14px;
}

.login-signup a {
    color: #e5001c;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.login-signup a:hover {
    color: #ff1f38;
}

.login-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.login-close-btn:hover {
    color: #fff;
}

/* ========================================
   회원가입 폼 스타일
   ======================================== */

.signup-agreement-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #2a2a2a;
}

.signup-checkbox-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 5px 0;
    padding: 3px 0;
}

.signup-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #ccc;
    font-size: 13px;
    flex: 1;
}

.signup-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.checkbox-text-bold {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.required-mark {
    color: #e5001c;
    font-weight: 600;
    font-size: 12px;
}

.optional-mark {
    color: #888;
    font-weight: 400;
    font-size: 12px;
}

.signup-divider {
    height: 1px;
    background: #333;
    margin: 8px 0;
}

.agreement-view-btn {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #444;
    border-radius: 4px;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Noto Sans KR', sans-serif;
    position: relative;
    z-index: 10;
}

.agreement-view-btn:hover {
    background: #2a2a2a;
    border-color: #666;
    color: #fff;
}

.login-links {
    text-align: center;
    margin-top: 15px;
    color: #888;
    font-size: 14px;
}

.login-links a {
    color: #e5001c;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: color 0.2s;
}

.login-links a:hover {
    color: #ff1f38;
}

/* ========================================
   유효성 검사 스타일
   ======================================== */

.validation-error {
    color: #ff4444;
    font-size: 12px;
    margin-left: 8px;
    font-weight: normal;
}

.validation-hint {
    color: #888;
    font-size: 11px;
    margin-top: 4px;
    margin-left: 2px;
}

.login-form-input.error {
    border-color: #ff4444 !important;
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.1);
    background-color: #1a1a1a !important;
}

.login-form-input.success {
    border-color: #44ff88 !important;
    box-shadow: 0 0 0 2px rgba(68, 255, 136, 0.1);
    background-color: #1a1a1a !important;
}

/* ========================================
   모달 스크롤바 스타일
   ======================================== */

.login-modal-overlay::-webkit-scrollbar {
    width: 10px;
}

.login-modal-overlay::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.login-modal-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.login-modal-overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   본인인증 진행 모달 스타일
   ======================================== */

#authInProgressModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10002; /* 다른 모달들보다 높게 */
    display: none;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

#authInProgressModal.active {
    opacity: 1;
    display: flex;
    pointer-events: auto;
}

.auth-modal-content {
    background: linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 40px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.2s ease-out;
}

#authInProgressModal.active .auth-modal-content {
    transform: scale(1);
}

.auth-spinner {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 4px solid rgba(229, 0, 28, 0.2);
    border-top-color: #e5001c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.auth-modal-title {
    color: #fff;
    font-size: 22px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.auth-modal-message {
    color: #bbb;
    font-size: 15px;
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.auth-cancel-btn {
    width: 100%;
    background: #2a2a2a;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease;
}

.auth-cancel-btn:hover {
    background: #3a3a3a;
}

/* ========================================
   Animations
   ======================================== */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive Design (반응형)
   ======================================== */

/* PC 환경 */
@media (min-width: 790px) {
    .web {
        display: block;
    }
    .mobile {
        display: none;
    }
    .c-pc {
        display: block;
    }
    .c-mo {
        display: none;
    }
}

/* 모바일 환경 */
@media (max-width: 791px) {
    .web {
        display: none;
    }
    .mobile {
        display: block;
        width: 100%;
    }
    h1 {
        font-size: 1.2em;
    }
    .login {
        font-size: 0.6em;
    }
    .middle {
        width: 90%;
        max-width: 90%;
        position: relative;
        text-align: center;
        z-index: 3;
        margin: 0 auto;
    }
    .text1 {
        font-size: 14px;
        font-weight: 500;
    }
    .c-pc {
        display: none;
    }
    .c-mo {
        display: block;
    }
}

/* 약관 모달 모바일 */
@media (max-width: 768px) {
    .terms-modal {
        width: 90%;
        max-width: none;
        max-height: 90vh;
    }

    .terms-modal-header {
        padding: 20px;
    }

    .terms-modal-header h3 {
        font-size: 18px;
    }

    .terms-modal-content {
        padding: 20px;
        font-size: 13px;
    }

    .terms-modal-footer {
        padding: 15px 20px;
    }
}

/* 로그인 모달 모바일 */
@media (max-width: 480px) {
    .login-modal {
        padding: 30px 25px;
        max-width: 90%;
    }

    .login-modal-header h2 {
        font-size: 24px;
    }

    .login-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
