:root {
    --main-blue: #0f2d52;
    --point-blue: #2c5282;
    --soft-blue: #f8fafc;
    --accent-gold: #b39558;
    --text-dark: #1a202c;
    --text-gray: #718096;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

body { font-family: 'Noto Sans KR', sans-serif; color: var(--text-dark); word-break: keep-all; line-height: 1.6; background-color: #fff; overflow-x: hidden; }
a { text-decoration: none; transition: var(--transition); }

.navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
}

.main-header-logo {
    height: 32px;         /* 헤더 높이 밸런스에 맞춘 가장 이상적인 세로 크기 */
    width: auto;          /* 가로 비율 자동 유지 */
    object-fit: contain;
    transition: all 0.2s ease-in-out;
}

@media (max-width: 768px) {
    .main-header-logo {
        height: 28px;     /* 모바일 햄버거 메뉴와 높이 축을 맞추기 위해 콤팩트하게 축소 */
    }
}

/* Navigation (메인페이지와 동일 유지) */
.top-bar { background: #1a202c; color: rgba(255,255,255,0.7); font-size: 0.8rem; padding: 10px 0; letter-spacing: -0.02em; }
.navbar { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); padding: 15px 0; border-bottom: 1px solid rgba(0,0,0,0.05); z-index: 1030; }
.navbar-brand { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--main-blue); font-size: 1.8rem; letter-spacing: 1px; }
.nav-link { color: var(--text-dark); font-weight: 500; font-size: 1.05rem; margin: 0 15px; transition: color 0.3s ease; }
.nav-link:hover { color: var(--accent-gold); }

/* Hamburger & Overlay (모바일 보정본 적용) */
.navbar-toggler { border: none; padding: 10px; position: relative; width: 40px; height: 40px; z-index: 1100; }
.toggler-icon { width: 24px; height: 2px; background-color: var(--main-blue); display: block; position: relative; transition: 0.3s; }
.toggler-icon::before, .toggler-icon::after { content: ''; width: 24px; height: 2px; background-color: var(--main-blue); position: absolute; left: 0; transition: 0.3s; }
.toggler-icon::before { top: -8px; }
.toggler-icon::after { top: 8px; }
.navbar-toggler.active-close .toggler-icon { background: transparent; }
.navbar-toggler.active-close .toggler-icon::before { transform: rotate(45deg); top: 0; }
.navbar-toggler.active-close .toggler-icon::after { transform: rotate(-45deg); top: 0; }
.menu-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.5); z-index: 999; display: none; opacity: 0; transition: opacity 0.4s ease; }
.menu-overlay.show { display: block; opacity: 1; }

@media (max-width: 991px) {
    .navbar-collapse { position: fixed; top: 0; right: -100%; width: 300px; height: 100vh; background: #fff; transition: var(--transition); padding: 80px 30px; box-shadow: -10px 0 30px rgba(0,0,0,0.1); z-index: 1000; overflow-y: auto; display: block !important; }
    .navbar-collapse.show { right: 0; }
    .nav-item { margin-bottom: 10px; border-bottom: 1px solid #f0f0f0; padding-bottom: 10px; }
    .nav-link { margin: 0; padding: 10px 0; font-size: 1.2rem; display: flex; align-items: center; justify-content: space-between; width: 100%; }
    .nav-link.dropdown-toggle::after { border: none; content: '\f107'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 1rem; color: var(--text-gray); margin-left: auto; transition: transform 0.3s ease; }
    .nav-link.dropdown-toggle.open-status::after { transform: rotate(180deg); }
    .dropdown-menu { border: none; background: #f9f9f9; padding: 15px; border-radius: 12px; margin-top: 10px; display: none; width: 100%; }
    .dropdown-item { padding: 8px 0; font-size: 0.95rem; display: block; }
}

@media (min-width: 992px) {
    .navbar-nav .dropdown-menu { display: block; opacity: 0; visibility: hidden; transform: translateY(15px); transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1); border: 1px solid rgba(0,0,0,0.05); border-top: 3px solid var(--accent-gold); box-shadow: 0 15px 35px rgba(0,0,0,0.1); border-radius: 0 0 12px 12px; padding: 15px 0; }
    .navbar-nav .nav-item:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
    .dropdown-item { padding: 10px 25px; font-size: 0.95rem; font-weight: 500; color: var(--text-gray); transition: 0.2s; }
    .dropdown-item:hover { background-color: var(--soft-blue); color: var(--main-blue); padding-left: 30px; }
}


/* Modern Buttons */
.btn-main {
    background: var(--accent-gold); color: #fff; padding: 14px 35px; border-radius: 4px;
    font-weight: 600; border: none; overflow: hidden; position: relative; z-index: 1; display: inline-block;
}
.btn-main:hover { color: #fff; transform: translateY(-3px); }
.btn-primary { background-color: var(--main-blue); border: none; padding: 10px 20px; border-radius: 8px; }

/* Quick Floating Menu */
.quick-nav {
    background: #fff; margin-top: -20px; position: relative; z-index: 20;
    border-radius: 15px; box-shadow: 0 15px 40px rgba(0,0,0,0.1); overflow: hidden;
}
.quick-icon-box {
    padding: 30px 15px; text-align: center; border-right: 1px solid #f0f0f0;
    transition: var(--transition);
}
.quick-icon-box:hover { background: var(--soft-blue); }
.quick-icon-box i { font-size: 2.8rem; color: var(--main-blue); margin-bottom: 15px; }
.quick-icon-box h6 { font-weight: 700; margin-bottom: 0; font-size: 1rem; }

/* Curriculum Schedule Section */
.section-padding { padding: 100px 0; }
.card-schedule {
    background: #fff; border: 3px solid #eee; border-radius: 20px;
    padding: 30px; transition: var(--transition); height: 100%;
    display: flex; flex-direction: column;
}
.card-schedule:hover { box-shadow: 0 20px 40px rgba(0,0,0,0.05); border-color: var(--accent-gold); }
.schedule-tag { font-family: 'Playfair Display', serif; color: var(--accent-gold); font-weight: 700; font-size: 0.9rem; margin-bottom: 10px; display: block; text-transform: uppercase; }
.schedule-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 25px; color: var(--main-blue); }

.schedule-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 0; border-top: 1px solid #f5f5f5;
}
.schedule-name { font-weight: 500; font-size: 1.05rem; }
.btn-apply {
    font-size: 0.85rem; padding: 6px 15px; border-radius: 6px;
    background: var(--soft-blue); color: var(--point-blue); font-weight: 600;
}
.btn-apply:hover { background: var(--point-blue); color: #fff; }

/* Consult Banner */
.consult-wrapper { background: #f1f5f9; padding: 60px 0; }
.consult-card {
    background: #fff; border-radius: 20px; padding: 40px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.consult-info i { font-size: 3rem; color: #fee500; margin-right: 25px; text-shadow: 1px 1px 1px rgba(0,0,0,0.1); }
.consult-text h4 { font-weight: 700; margin-bottom: 5px; }
.btn-kakao { background: #fee500; color: #3c1e1e; font-weight: 700; padding: 12px 30px; border-radius: 10px; }
.btn-tel { background: var(--main-blue); color: #fff; font-weight: 700; padding: 12px 30px; border-radius: 10px; margin-left: 10px; }

/* SMS Banner */
.sms-banner {
    background: var(--main-blue); border-radius: 30px; padding: 50px;
    background-image: radial-gradient(circle at top right, rgba(255,255,255,0.1), transparent);
}
.form-control-custom { height: 55px; border-radius: 12px 0 0 12px; border: none; padding-left: 25px; }
.btn-sms { height: 55px; border-radius: 0 12px 12px 0; background: var(--accent-gold); color: #fff; font-weight: 600; width: 120px; border: none; }

footer { background: #0f172a; color: #94a3b8; padding: 80px 0 40px; }
.footer-logo { font-family: 'Playfair Display', serif; color: #fff; font-size: 1.8rem; margin-bottom: 25px; }
.footer-contact { font-size: 1.8rem; color: var(--accent-gold); font-weight: 700; margin: 15px 0; }

@media (max-width: 991px) {
    .carousel-item { height: 500px; }
    .carousel-caption h2 { font-size: 2.2rem; }
    .consult-card { flex-direction: column; text-align: center; }
    .consult-info { flex-direction: column; margin-bottom: 20px; }
    .consult-info i { margin-right: 0; margin-bottom: 15px; }
    .btn-tel { margin-left: 0; margin-top: 10px; width: 100%; }
    .btn-kakao { width: 100%; }
}

/* ==========================================================
   1. 부모 창(배경) 스크롤 원천 차단 & 밀림 방지
   ========================================================== */
html.modal-open,
body.modal-open {
    overflow: hidden !important;
    position: fixed !important; /* iOS 및 모바일 브라우저에서 배경 스크롤을 완전히 잠급니다. */
    width: 100% !important;
    height: 100% !important;
}

/* 모달 활성화 시 우측 여백 생기거나 상단바 밀리는 현상 방지 */
body.modal-open,
body.modal-open .fixed-top,
body.modal-open .navbar-fixed-top,
body.modal-open .sticky-top,
body.modal-open .navbar {
    padding-right: 0px !important;
}

/* ==========================================================
   2. 모달 전체 영역 가속 스크롤 설정
   ========================================================== */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow-x: hidden;
    overflow-y: auto; /* 콘텐츠가 넘칠 때 모달 자체 스크롤 허용 */
    -webkit-overflow-scrolling: touch; /* iOS 모바일 기기 터치 가속 스크롤 */
}

/* ==========================================================
   3. 모바일 화면 최적화 (max-width: 576px)
   ========================================================== */
@media (max-width: 576px) {
    .modal-dialog {
        /* 모바일에서 좌우 여백을 최소화하고 화면 상단 근처에 배치 */
        margin: 0.5rem auto !important;
        max-width: calc(100% - 1rem); /* 좌우 0.5rem씩 여백 확보 */
    }

    .modal-dialog-centered {
        /* 모바일에서 수직 정중앙 정렬을 풀고 위에서부터 자연스럽게 흐르도록 설정 */
        display: flex !important;
        align-items: flex-start !important;
        min-height: none !important;
    }

    .modal-content {
        /* ⭐️ 핵심: 모바일 화면 높이를 벗어나지 않도록 최대 높이를 가두고 내부 스크롤 유도 */
        max-height: calc(100vh - 1rem) !important;
        overflow: hidden; /* 내부 스크롤 작동을 위해 바깥은 가둠 */
        display: flex;
        flex-direction: column;
        border-radius: 16px; /* 모바일 전용 라운딩 */
    }

    .modal-body {
        /* ⭐️ 핵심: 본문 영역이 넘치면 개별 스크롤바가 생기도록 처리 */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 20px 15px !important; /* 모바일 여백 축소 */
    }
}

/* ==========================================================
   4. PC 화면 최적화 (min-width: 576px 초과)
   ========================================================== */
@media (min-width: 575.98px) {
    .modal-dialog-centered {
        display: flex;
        align-items: center;
        min-height: calc(100% - 3.5rem);
    }
}

/* ==========================================================
   5. 스크롤바 모던 디자인 (선택사항)
   ========================================================== */
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}
.modal-body {
    scrollbar-width: thin;
}