/* =========================================================
   연세볼트치과 — Bolt Dental Clinic
   메인 히어로 (PC 우선 / 반응형)
   ========================================================= */

:root {
    --brand:       #1f53b0;
    --brand-dark:  #11337a;
    --brand-sky:   #3d7bd9;
    --ink:         #0d1b2a;
    --white:       #ffffff;
    --muted:       rgba(255, 255, 255, 0.78);
    --line:        rgba(255, 255, 255, 0.26);
    --gutter:      36px;
    --maxw:        1440px;
    --header-h:    96px;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
    margin: 0;
    background: #0a1730;
    color: var(--ink);
    line-height: 1.5;
    font-family: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
        system-ui, "Apple SD Gothic Neo", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- 헤더 ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 70;        /* 메뉴 오버레이(50)보다 위 — 평소 헤더 노출 */
    height: var(--header-h);
    display: flex;
    align-items: center;
    transition: background-color .3s ease, box-shadow .3s ease;
}
/* 스크롤 시: 흰 배경 + 어두운 글자/로고 */
.site-header.is-scrolled {
    background: #fff;
    box-shadow: 0 2px 14px rgba(17, 24, 39, .08);
}
.site-header.is-scrolled .site-header__inner { color: #1f2937; }
.site-header.is-scrolled .utilnav__user { color: #1f2937; }
.site-header.is-scrolled .hamburger--header span { background: #14305e; }
.site-header.is-scrolled .brand__img--light { opacity: 0; }
.site-header.is-scrolled .brand__img--dark { opacity: 1; }
/* 메뉴 오버레이 열림 시 헤더 숨김 */
body.menu-open .site-header {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.site-header__inner {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 24px var(--gutter);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    transition: color .3s ease;
}

.brand { position: relative; display: inline-flex; align-items: center; }
.brand__img { display: block; width: 160px; height: 48px; transition: opacity .3s ease; }
.brand__img--dark { position: absolute; inset: 0; opacity: 0; }

.utilnav__link, .utilnav__phone, .utilnav__user { font-size: 18px; font-weight: 600; }
.utilnav__link { opacity: 0.92; transition: opacity 0.2s; }
.utilnav__link:hover { opacity: 1; }
.utilnav__phone { letter-spacing: 0.01em; }
.utilnav__user { color: #fff; }
.utilnav__user strong { font-weight: 700; }

/* 헤더 햄버거 (모바일/태블릿 전용) */
.hamburger { display: none; }
.hamburger--header {
    margin-left: auto;
    width: 46px; height: 46px;
    flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px;
    background: transparent; border: 0; cursor: pointer;
}
.hamburger--header span {
    display: block; width: 26px; height: 2.5px;
    background: #fff; border-radius: 2px;
    transition: background-color .3s ease;
}

/* ---------- 히어로 ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    isolation: isolate;
}

/* 히어로 배경 사진 (assets/images/hero.webp).
   파일이 없을 경우 아래 그라데이션이 폴백으로 표시됩니다. */
.hero__bg {
    position: absolute; inset: 0; z-index: -2;
    background-color: #14305e;
    background-image:
        url('/assets/images/hero.webp'),
        linear-gradient(180deg, #6aa6ee 0%, #356fc6 36%, #14305e 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 히어로 배경 영상 (assets/videos/hero.mp4) — 무음 자동재생 루프, 이미지 위에 덮임
   살짝(6px) 블러 + 살짝 확대(블러로 가장자리가 비치지 않도록 덮음) */
.hero__video {
    position: absolute; inset: 0; z-index: -1;
    width: 100%; height: 100%; object-fit: cover;
    pointer-events: none;
    filter: blur(6px);
    transform: scale(1.06);
}
/* 좌측 카피 가독성용 옅은 스크림 */
.hero__scrim {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(100deg, rgba(8,18,40,.5) 0%, rgba(8,18,40,.2) 42%, rgba(8,18,40,0) 68%);
}

.hero__inner {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 620px;
    align-items: stretch;
    padding-top: var(--header-h);
    /* 좌측 정렬: 컨테이너(1440) 기준선까지 띄움. 우측 메가메뉴는 화면 끝까지 유지 */
    padding-left: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
}

/* 좌측 카피 */
.hero__lead {
    align-self: start;
    margin-top: 356.42px;          /* 헤더로부터의 간격 */
    color: #fff;
    max-width: 1040px;
    padding-right: var(--gutter);
}
.hero__title {
    margin: 0 0 19.08px;           /* 서브카피와의 갭 */
    font-size: 50px;
    line-height: 1.34;
    font-weight: 600;              /* SemiBold */
    letter-spacing: -0.02em;
}

/* 첫 진입 — 글자가 아래에서 모션블러로 한 글자씩 올라오는 등장 */
.hero__title .hero__word { display: inline-block; white-space: nowrap; }
.hero__title .hero__char {
    display: inline-block;
    animation: heroCharIn .9s cubic-bezier(.22, .68, .2, 1) both;
    animation-delay: calc(var(--ci) * 0.04s + 0.15s);
    will-change: transform, filter, opacity;
}
@keyframes heroCharIn {
    0%   { opacity: 0; transform: translateY(1.05em) scaleY(1.12); filter: blur(12px); }
    55%  { opacity: 1; filter: blur(3px); }
    100% { opacity: 1; transform: translateY(0) scaleY(1); filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
    .hero__title .hero__char { animation: none; }
}
.hero__subtitle {
    margin: 0 0 34px;
    font-size: 22px;
    font-weight: 400;              /* Regular */
    color: var(--muted);
}

/* 빠른 상담 버튼 */
.quicklinks { position: relative; display: inline-block; }
.quicklinks__tip {
    position: absolute; z-index: 10;          /* 최상단(front) */
    top: -38.04px; left: 29.5px;              /* 카톡상담 버튼(143px) 정중앙 정렬 + 6px 겹침 */
    width: 84px; height: 44.04px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #FFFFFF; color: #000C1E;
    font-size: 13px; font-weight: 700;       /* Bold 13px */
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.quicklinks__tip::after {                      /* 꼬리: 박스 중앙 */
    content: ""; position: absolute; left: 50%; bottom: -4px;
    width: 10px; height: 10px; background: #FFFFFF;
    transform: translateX(-50%) rotate(45deg);
}
.quicklinks__row { display: flex; flex-wrap: wrap; gap: 10px; }

.qbtn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    width: 143px; height: 56px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);   /* #FFFFFF 5% */
    border: 1px solid rgba(255, 255, 255, 0.2);   /* stroke #FFFFFF 20% */
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: #fff; font-size: 16px; font-weight: 700;
    transition: background 0.2s, transform 0.2s;
}
.qbtn:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }
.qbtn__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
}
.qbtn__icon img { width: 100%; height: 100%; display: block; }
.qbtn__label { font-size: 18px; font-weight: 500; }   /* Medium 18px */

/* ---------- 우측 메가 메뉴 ---------- */
.mega {
    align-self: stretch;          /* 헤더 아래부터 채우되, 아래 max-height로 셀 과도 확대 방지 */
    max-height: 950px;            /* 셀 높이 상한 → 큰 화면에서도 약 190px 비율 유지 */
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(150px, 1fr);
}

.mega__cell {
    position: relative;
    display: flex; flex-direction: column;
    padding: 24px;
    color: #fff;
    background: rgba(0, 0, 0, 0.12);   /* #000000 12% */
    transition: background 0.25s;
}
.mega__cell:hover { background: rgba(0, 0, 0, 0.32); }
.mega__title { font-size: 21.61px; font-weight: 700; letter-spacing: -0.01em; }   /* Bold */
.mega__desc {
    margin-top: 7px;                 /* 제목과의 갭 */
    font-size: 18px; line-height: 1.4; font-weight: 400;   /* Regular */
    color: var(--muted);
}
.mega__plus {
    margin-top: auto;                /* 셀 하단으로 밀착 */
    align-self: flex-end;            /* 우하단 */
    width: 24px; height: 24px; display: block;
    transition: transform 0.25s;
}
.mega__cell:hover .mega__plus { transform: rotate(90deg); }

/* 호버 시 보더가 칸을 타고 도는 트레인(빛이 테두리를 한 바퀴) 애니메이션 */
@property --mega-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.mega__cell::after {
    content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    padding: 2px; border-radius: inherit;
    background: conic-gradient(from var(--mega-angle),
        rgba(130, 180, 255, 0) 0deg, rgba(130, 180, 255, 0) 232deg,
        rgba(130, 180, 255, .55) 292deg, #dbeaff 330deg, rgba(130, 180, 255, 0) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity .3s ease;
}
.mega__cell:hover::after { opacity: 1; animation: megaTrain 1.5s linear infinite; }
@keyframes megaTrain { to { --mega-angle: 360deg; } }

/* 흰색 햄버거 박스 (메뉴 열기) */
.mega__menu {
    display: flex; align-items: center; justify-content: center;
    background: #fff; cursor: pointer;
    border: 0;
    transition: background 0.2s;
}
.mega__menu img { display: block; width: 43px; height: 37px; }
.mega__menu:hover { background: #f1f5ff; }

/* ---------- 전체 메뉴 오버레이 ---------- */
.menu-overlay {
    position: fixed; inset: 0; z-index: 50;
    visibility: hidden; opacity: 0;
    background: rgba(10, 22, 48, 0.55);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    overflow-y: auto;
    transition: opacity 0.3s, visibility 0.3s;
}
.menu-overlay.is-open { visibility: visible; opacity: 1; }
.menu-overlay__inner {
    width: 100%; max-width: var(--maxw); margin: 0 auto;
    min-height: 100%;
    padding: calc(var(--header-h) + 24px) var(--gutter) 48px;
    display: flex; flex-direction: column;
}
.menu-overlay__head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 26px;
}
.menu-overlay__brand { display: inline-flex; align-items: center; gap: 8px; opacity: 1; }
.menu-overlay__mark { height: 34px; width: auto; display: block; filter: brightness(0) invert(1); }
.menu-overlay__brand-name { font-size: 22px; font-weight: 500; line-height: 1; color: #fff; }
.menu-overlay__close {
    width: 48px; height: 48px; flex-shrink: 0;
    background: transparent; border: 0; color: #fff;
    font-size: 38px; font-weight: 300; line-height: 1; cursor: pointer;
}

.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-item {
    display: flex; align-items: center; justify-content: space-between;
    height: 85px; padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    color: #fff; font-size: 32px; font-weight: 700;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.14); }
.menu-item__arrow { display: inline-flex; align-items: center; color: rgba(255, 255, 255, 0.7); }
.menu-item__arrow svg { display: block; width: auto; height: 16px; }

.menu-section { margin: 44px 0 14px; color: rgba(255, 255, 255, 0.62); font-size: 15px; font-weight: 600; }

.menu-overlay__foot { margin-top: 44px; }
.menu-overlay__foot .quicklinks { margin-bottom: 30px; }
.menu-contact p { margin: 0 0 12px; color: #fff; font-size: 16px; line-height: 1.5; }
.menu-contact strong { font-weight: 700; }

/* =========================================================
   반응형
   ========================================================= */

/* 태블릿 이하 — 메가 숨기고 헤더 햄버거 노출, 카피 1열 */
@media (max-width: 1024px) {
    .hero__inner { grid-template-columns: 1fr; padding-bottom: 64px; }
    .hero__lead {
        align-self: center;
        margin: 0 auto 8px;
        padding: 0 32px;
        text-align: left;
    }
    /* 카테고리 카드(임플란트·수면임플란트·치과소개 등)를 모바일에서도 노출 */
    .mega {
        align-self: auto; max-height: none; margin: 0 auto;
        width: 100%; max-width: 620px; padding: 0 18px;
        gap: 10px; grid-auto-rows: minmax(92px, auto);
    }
    .mega__menu { display: none; }   /* 헤더 햄버거가 있으므로 카드 그리드에선 제외 */
    .mega__cell {
        background: rgba(8, 18, 40, .46); padding: 16px; border-radius: 12px;
        -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    }
    .mega__title { font-size: 17px; }
    .mega__desc { font-size: 12.5px; margin-top: 4px; }
    .mega__plus { width: 20px; height: 20px; }
    .hamburger--header { display: flex; }
}

/* 모바일 */
@media (max-width: 640px) {
    :root { --header-h: 64px; --gutter: 18px; }
    .site-header__inner { padding: 14px var(--gutter); }
    .brand__img { width: 120px; height: 36px; }
    .utilnav__link, .utilnav__user { display: none; }   /* 로그인·회원가입·계정은 메뉴에서 */
    .utilnav__phone { font-size: 15px; }

    .hero__lead { padding: 0 var(--gutter); }
    .hero__title { font-size: 27px; line-height: 1.32; margin-bottom: 16px; }
    .hero__subtitle { font-size: 14.5px; margin-bottom: 22px; }
    /* (히어로 빠른상담 버튼은 ≤768px에서 숨김 — 하단 고정 CTA로 대체) */

    /* 메뉴 오버레이 — 모바일 */
    .menu-grid { gap: 10px; }
    .menu-item { height: 62px; padding: 0 16px; font-size: 17px; }
    .menu-item__arrow svg { height: 13px; }
    .menu-overlay__mark { height: 30px; }
    .menu-overlay__brand-name { font-size: 20px; }
}

/* =========================================================
   모바일 하단 고정 CTA (카톡상담 / 네이버예약)
   ========================================================= */
.mcta { display: none; }
@media (max-width: 768px) {
    .mcta {
        display: grid; grid-template-columns: 1fr 1fr;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, .14);
    }
    .mcta__btn {
        display: flex; align-items: center; justify-content: center; gap: 8px;
        padding: 15px 8px; font-size: 15px; font-weight: 700; letter-spacing: -.01em;
    }
    .mcta__btn--kakao { background: #FEE500; color: #2a1c00; }
    .mcta__btn--naver { background: #03C75A; color: #fff; }
    .mcta__ico { width: 20px; height: 20px; display: inline-flex; }
    .mcta__ico img { width: 100%; height: 100%; display: block; }
    .mcta__btn--kakao .mcta__ico img { filter: brightness(0); }   /* 흰 아이콘 → 노란 배경엔 검정 */
    /* 하단 고정 카톡상담·네이버예약이 있으므로 히어로의 빠른상담 버튼은 모바일에서 숨김 */
    .quicklinks { display: none !important; }
    body { padding-bottom: 54px; }
}

/* =========================================================
   사이트 하단 푸터 (site-footer.php) — 전역
   ========================================================= */
.site-footer-b { background: #f3f5f8; border-top: 1px solid #e6e9ee; }
.site-footer-b__inner { max-width: 1100px; margin: 0 auto; padding: 36px 24px 44px; }
.site-footer-b__top {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding-bottom: 22px; border-bottom: 1px solid #e2e6eb; flex-wrap: wrap;
}
.site-footer-b__brand img { height: 38px; width: auto; display: block; opacity: .85; }
.site-footer-b__nav { display: flex; flex-wrap: wrap; gap: 22px; }
.site-footer-b__nav a { font-size: 15px; font-weight: 600; color: #4b5563; }
.site-footer-b__nav a:hover { color: var(--brand); }
.site-footer-b__info { margin-top: 20px; }
.site-footer-b__info p { margin: 0 0 8px; font-size: 13.5px; color: #8b96a3; line-height: 1.6; }
.site-footer-b__info strong { color: #4b5563; }
.site-footer-b__info .bar { margin: 0 8px; color: #cbd2da; }
.site-footer-b__copy { font-size: 13px; color: #aab2bc; }

/* =========================================================
   로그인 모달
   ========================================================= */
.modal { position: fixed; inset: 0; z-index: 100; visibility: hidden; }
.modal.is-open { visibility: visible; }
.modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.24);   /* #000000 24% */
    opacity: 0; transition: opacity 0.25s;
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal__dialog {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -46%);
    width: min(490px, calc(100vw - 32px));
    height: 403.58px;
    max-height: calc(100vh - 32px); overflow-y: auto;
    background: #fff; border-radius: 4px;
    padding: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    opacity: 0; transition: opacity 0.25s, transform 0.25s;
}
.modal.is-open .modal__dialog { opacity: 1; transform: translate(-50%, -50%); }
.modal__dialog--signup { height: auto; }   /* 회원가입은 내용 높이에 맞춤 */
.modal__logo { width: 150px; height: auto; margin-bottom: 7px; }
.modal__title { margin: 0 0 11px; font-size: 21.61px; font-weight: 700; color: #111827; }

.login-form,
.signup-form { display: flex; flex-direction: column; }
.login-form { gap: 10px; }
.signup-form { gap: 15px; }
.field { position: relative; }
.field input {
    width: 100%; height: 62.5px; padding: 0 24px;
    border: 1px solid #333D4B; border-radius: 8px;
    font-size: 16px; font-weight: 400; color: #111827; background: #fff;
    transition: border-color 0.2s;
}
.field input::placeholder { color: #E5E8EB; }
.field input:focus { outline: none; border-color: #333D4B; }
.field label {
    position: absolute; top: -7px; left: 12px;
    padding: 0 6px; background: #fff;
    font-size: 12px; font-weight: 400; color: #333D4B;
}
.login-form__submit {
    height: 47px; margin-top: 0;
    background: #333D4B; color: #fff;          /* 버튼 컬러 */
    border: 0; border-radius: 8px;
    font-size: 18px; font-weight: 600; cursor: pointer;   /* SemiBold 18px */
    transition: background 0.2s;
}
.login-form__submit:hover { background: #29313d; }

.login-form__signup {
    margin: 19.29px 0 0; text-align: center;               /* 버튼과의 간격 */
    font-size: 16px; font-weight: 400; color: #6b7280;     /* Regular 16px */
}
.login-form__signup a { color: #3182F6; }                  /* 동일 조건 + 파란색 */
#signup-modal .login-form__signup { color: #333D4B; }                 /* '계정이 있으신가요?' */
#signup-modal .login-form__signup a { color: #3182F6; text-decoration: underline; }   /* '로그인': 파란색 + 밑줄 */
#login-modal .login-form .field:first-of-type { margin-bottom: 5px; }  /* 아이디↔패스워드 = 폼갭10+5 = 15px */
#login-modal .login-form__submit { height: 42px; }                     /* 403.58px 고정 높이에 맞춰 보정 */
.login-form__privacy {
    display: block; margin-top: 2px; text-align: center;
    font-size: 16px; font-weight: 400; color: #B0B8C1;     /* Regular 16px */
}

/* 비밀번호 표시 토글 */
.field--pw input { padding-right: 52px; }
.field__eye {
    position: absolute; top: 50%; right: 16px; transform: translateY(-50%);
    width: 24px; height: 24px; padding: 0; border: 0;
    background: none; cursor: pointer; color: #B0B8C1;
    display: flex; align-items: center; justify-content: center;
}
.field__eye img { width: 24px; height: 24px; display: block; }
.field__eye .ico-eye { display: none; }
.field__eye.is-visible .ico-eye { display: block; }
.field__eye.is-visible .ico-eye-off { display: none; }

/* 개인정보처리방침 동의 체크박스 */
.signup-agree {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 18px 0; cursor: pointer;   /* 폼 갭 15px + margin 18px = 위·아래 33px */
}
.signup-agree input { position: absolute; opacity: 0; width: 0; height: 0; }
.signup-agree__box {
    width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
    border: 1.5px solid #cbd2da; background: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.signup-agree__box svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.signup-agree input:checked + .signup-agree__box {
    background: #333D4B; border-color: #333D4B;
}
.signup-agree input:checked + .signup-agree__box svg { opacity: 1; }
.signup-agree__text { font-size: 15px; color: #4b5563; }

/* 폼 상태 메시지 */
.form-msg { margin: 0; font-size: 13.5px; line-height: 1.45; white-space: pre-line; text-align: center; }
.form-msg:empty { display: none; }
.form-msg.is-error { color: #e11d48; }
.form-msg.is-success { color: #16a34a; }

@media (max-width: 480px) {
    .modal__dialog { padding: 24px 20px; }
}
