/* ============================================================
   web/common.css — 사용자 웹 공통 스타일
   모든 웹 페이지에 적용되는 기본 스타일을 정의한다.
   개별 모듈 CSS에는 해당 모듈 전용 클래스만 작성한다.
============================================================ */

/* ---------- CSS 변수 ---------- */
:root {
    --main-blue:       #0062FF;
    --trust-navy:      #0A1931;
    --bg-white:        #FFFFFF;
    --sub-light-gray:  #F7F9FC;
    --text-black:      #1A1A1A;
    --text-muted:      #666666;
    --border-gray:     #E5E7EB;  /* 범용 테두리 색상 */
}

/* ---------- 기본 body ---------- */
body {
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
                 system-ui, Roboto, "Helvetica Neue", "Segoe UI",
                 "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic",
                 "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-white);
    color: var(--text-black);
    line-height: 1.6;
    letter-spacing: -0.02em;
}

/* ---------- 줄바꿈 보조 ---------- */
.text-pretty {
    text-wrap: pretty;
    word-break: keep-all;
}
.keep-all {
    word-break: keep-all;
}

/* ---------- 로고 이미지 필터 ---------- */
/* 어두운 배경 위 로고: 흰색으로 반전 */
img.nav-logo-white { filter: brightness(0) invert(1) !important; }
/* 밝은 배경 위 로고: 원색 유지 (파란 색조) */
img.nav-logo-blue  { filter: hue-rotate(190deg) saturate(1.5) !important; }

/* ---------- 네비게이션 공통 ---------- */

/* 스크롤 후 헤더 배경 */
nav.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.08);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* 스크롤 후 공통적으로 다크 텍스트 전환 */
nav.scrolled .nav-link        { color: var(--trust-navy) !important; }
nav.scrolled .logo-text       { color: var(--trust-navy) !important; }
nav.scrolled .btn-nav-secondary {
    background-color: var(--trust-navy);
    border-color: var(--trust-navy);
    color: white;
}
nav.scrolled .nav-divider     { background-color: rgba(10, 25, 49, 0.2) !important; }
nav.scrolled .btn-login-text  { color: var(--trust-navy) !important; }
nav.scrolled #menu-toggle     { color: var(--trust-navy) !important; }

/* 네비게이션 링크 공통 */
.nav-link      { transition: color 0.2s; }
.logo-text     { transition: color 0.3s; }
.btn-login-text { background: none; border: none; cursor: pointer; }

/* ---------- 네비게이션 버튼 ---------- */
.btn-nav-primary {
    background: linear-gradient(135deg, #0062FF 0%, #004ecc 100%);
    color: white;
    padding: 0.5rem 0.9rem;
    border-radius: 9999px;
    font-weight: 800;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 98, 255, 0.2);
    transition: all 0.3s ease;
}
@media (min-width: 1280px) {
    .btn-nav-primary { font-size: 0.75rem; padding: 0.6rem 1.1rem; }
}

/* 다크 히어로 페이지의 보조 버튼 (반투명 흰색) */
.btn-nav-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 0.9rem;
    border-radius: 9999px;
    font-weight: 800;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}
@media (min-width: 1280px) {
    .btn-nav-secondary { font-size: 0.75rem; padding: 0.6rem 1.1rem; }
}

/* 라이트 배경 페이지의 보조 버튼 오버라이드 */
.btn-nav-secondary-light {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(10, 25, 49, 0.2);
    color: var(--trust-navy);
}

/* ---------- 모달 오버레이 ---------- */
.modal-overlay {
    background-color: rgba(10, 25, 49, 0.6);
    backdrop-filter: blur(4px);
}

/* ---------- 섹션 강조선 ---------- */
.section-title-line {
    width: 40px;
    height: 3px;
    background-color: var(--main-blue);
    margin-top: 1rem;
    border-radius: 2px;
}

/* ---------- 커스텀 스크롤바 ---------- */
.custom-scrollbar::-webkit-scrollbar       { width: 8px; }
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 99px;
    margin: 20px 0;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.15);
    border-radius: 99px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.25);
}

/* ---------- 애니메이션 ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.8s ease-out forwards; }

/* ---------- 패밀리사이트 드롭다운 (푸터) ---------- */
.family-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
    outline: none;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem;
}
.family-select:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ---------- 토스트 메시지 ---------- */
.custom-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    white-space: nowrap;
}
.custom-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.custom-toast.toast-success { background-color: #1e293b; }
.custom-toast.toast-error   { background-color: #ef4444; }

/* ---------- 폼 공통 ---------- */
.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    margin-left: 0.25rem;
}
.form-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    outline: none;
    transition: all 0.2s;
    font-weight: 700;
}
.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
