/* ========================================
   모바일 우선 (Mobile-First) CSS
   디자인2 (따뜻한 주황) - 2025-01-19
   ======================================== */

/* ========================================
   1. 기본 설정 (모바일 기본)
   ======================================== */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    word-break: keep-all;
    overflow-x: hidden;
    font-size: 0.95rem;
    color: #111827;
}

/* ========================================
   2. 헤더 - 모바일 앱 스타일
   ======================================== */

header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    padding: 1rem;
}

/* 로고 영역 */
header .wiggle {
    font-size: 2rem;
    display: inline-block;
}

header .brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f59e0b;
}

header .brand-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
}

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
    transition: transform 0.2s;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

/* 모바일 메뉴 */
#mobileMenu a {
    transition: all 0.2s;
}

#mobileMenu a:active {
    transform: scale(0.98);
    opacity: 0.8;
}

/* 데스크탑 네비게이션 */
.desktop-nav a {
    transition: color 0.2s;
}

.desktop-nav a:hover {
    color: #f59e0b !important;
}

/* ========================================
   3. Hero 섹션 - 동영상 + 패러랙스 (모바일)
   ======================================== */

.hero-section {
    padding: 0;
    margin: 0;
    position: relative;
    overflow: hidden;
}

/* 동영상 최적화 */
#heroVideo,
#heroFallbackImage {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 히어로 콘텐츠 패러랙스 */
#heroContent {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* 오버레이 부드러운 전환 */
.hero-overlay {
    will-change: background;
}

/* 히어로 이미지 반응형 */
@media (max-width: 768px) {
    .hero-section > div {
        height: 350px !important;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hero-section > div {
        height: 450px !important;
    }
    
    .hero-title {
        font-size: 2.25rem !important;
    }
}

@media (min-width: 1025px) {
    .hero-section > div {
        height: 500px !important;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
}

/* 환영 배지 */
.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.welcome-badge .text {
    font-size: 0.9rem;
    font-weight: 700;
}

/* Hero 제목 */
.hero-title {
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    animation: slide-up 0.6s ease;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero 설명 */
.hero-description {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
}

/* 신뢰 지표 */
.trust-indicators {
    animation: fade-in 0.8s ease 0.3s both;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    font-size: 1rem;
}

.rating-text {
    font-size: 0.9rem;
    font-weight: 700;
}

.user-count {
    font-size: 0.85rem;
}

.user-count strong {
    font-weight: 700;
}

/* ========================================
   4. 계산기 카드 - 모바일 최적화
   ======================================== */

.calculator-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.15);
    padding: 1.25rem;
    margin: 1rem;
}

/* Step Indicator */
.step-indicator {
    margin-bottom: 1.5rem;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.step-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6b7280;
}

.step-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f59e0b;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 1rem;
    transition: width 0.3s ease;
}

/* ========================================
   5. 폼 요소 - 터치 최적화
   ======================================== */

/* 라벨 */
.form-label {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.85rem;
    line-height: 1.5;
}

.form-label i {
    font-size: 1.15rem;
    color: #f59e0b;
    margin-right: 0.5rem;
}

.required-mark {
    color: #ef4444;
    margin-left: 0.25rem;
}

/* 라디오 버튼 카드 */
.radio-card {
    position: relative;
    margin-bottom: 0.75rem;
}

/* 라디오 카드 그리드 컨테이너 */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

/* 모바일: 3열 그리드 (작은 항목용) */
.radio-grid-2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
    gap: 0.25rem;
}

.radio-card input[type="radio"]:checked + .radio-card-content {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
    transform: translateY(-2px);
}

.radio-card-content:active {
    transform: scale(0.98);
}

/* 라디오 아이콘 */
.radio-icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #f59e0b;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-radius: 50%;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.radio-card input[type="radio"]:checked + .radio-card-content .radio-icon {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    transform: scale(1.05);
}

/* 라디오 텍스트 */
.radio-text {
    flex: 1;
}

.radio-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.15rem;
    line-height: 1.2;
}

.radio-card input[type="radio"]:checked + .radio-card-content .radio-title {
    color: #f59e0b;
}

.radio-description {
    font-size: 0.6rem;
    color: #6b7280;
    line-height: 1.3;
}

.radio-card input[type="radio"]:checked + .radio-card-content .radio-description {
    color: #92400e;
}

/* 체크박스 카드 */
.checkbox-card {
    position: relative;
    margin-bottom: 1rem;
}

.checkbox-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-card-content {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 80px;
}

.checkbox-card input[type="checkbox"]:checked + .checkbox-card-content {
    border-color: #f59e0b;
    background: #fff7ed;
}

.checkbox-card-content:active {
    transform: scale(0.98);
}

/* Select 드롭다운 */
select {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.1rem;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    background: white;
    color: #111827;
    cursor: pointer;
    transition: all 0.2s ease;
}

select:focus {
    outline: none;
    border-color: #f59e0b;
    background: #fff7ed;
}

/* ========================================
   6. 버튼 - 모바일 네이티브 스타일
   ======================================== */

/* 주 버튼 (Primary) */
.btn-primary {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.btn-primary i {
    margin-right: 0.5rem;
}

/* 플로팅 버튼 */
.floating-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.5);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
}

.floating-btn:active {
    transform: scale(0.9);
}

.floating-btn i {
    font-size: 1.5rem;
}

.floating-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.6rem;
    border-radius: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ========================================
   7. 정보 박스
   ======================================== */

.info-box {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.1);
}

.info-box i {
    color: #f59e0b;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.info-box .text {
    font-size: 0.85rem;
    color: #78350f;
    line-height: 1.6;
}

.info-box a {
    color: #f59e0b;
    text-decoration: underline;
    font-weight: 600;
}

/* ========================================
   8. Footer
   ======================================== */

footer {
    background: #1f2937;
    color: white;
    padding: 2rem 1rem;
    margin-top: 3rem;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.footer-brand .emoji {
    font-size: 1.5rem;
}

.footer-brand .name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fbbf24;
}

.footer-subtitle {
    font-size: 1rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.footer-link {
    color: #9ca3af;
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

.footer-link a {
    color: #fbbf24;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-link a:hover {
    color: #f59e0b;
}

.footer-copyright {
    font-size: 0.95rem;
    color: #6b7280;
}

/* ========================================
   9. 애니메이션
   ======================================== */

@keyframes wiggle {
    0%, 100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

.wiggle {
    animation: wiggle 1.5s ease-in-out infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   10. 데스크탑 (768px 이상)
   ======================================== */

@media (min-width: 768px) {
    /* 컨테이너 최대 너비 */
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    /* 헤더 - 데스크탑 네비게이션 표시 */
    .desktop-nav {
        display: block !important;
    }
    
    .mobile-menu-btn {
        display: none !important;
    }
    
    #mobileMenu {
        display: none !important;
    }
    
    header .wiggle {
        font-size: 2.5rem;
    }
    
    header .brand-name {
        font-size: 1.5rem;
    }
    
    /* Hero */
    .hero-section {
        padding: 4rem 2rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-description {
        font-size: 1.25rem;
    }
    
    .trust-indicators {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }
    
    /* 계산기 카드 */
    .calculator-card {
        max-width: 800px;
        margin: 2rem auto;
        padding: 3rem;
    }
    
    /* 라디오 그리드 - 데스크탑 4열 (서비스 형태용) */
    .radio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }
    
    /* 라디오 그리드 2열 - 데스크탑 5열 */
    .radio-grid-2 {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.75rem;
    }
    
    /* 라디오 카드 - 데스크탑에서 약간 큰 크기 */
    .radio-card-content {
        min-height: 70px;
        padding: 0.75rem 0.5rem;
    }
    
    .radio-icon {
        width: 2rem;
        height: 2rem;
        font-size: 1.25rem;
    }
    
    .radio-title {
        font-size: 0.8rem;
    }
    
    .radio-description {
        font-size: 0.6rem;
    }
    
    /* 플로팅 버튼 - 텍스트 추가 */
    .floating-btn {
        width: auto;
        height: auto;
        padding: 1rem 1.5rem;
        border-radius: 3rem;
    }
    
    .floating-btn-text {
        display: inline;
        margin-left: 0.5rem;
        font-size: 1rem;
        font-weight: 700;
    }
}

/* ============================================================
   모바일 UI 패치 — 2026-09-14
   히어로 압축 / 하단 고정 CTA / 터치 타깃 / iOS 자동확대 방지
   ============================================================ */
@media (max-width: 768px) {

    /* 가로 스크롤 방지 */
    html, body { overflow-x: hidden; }
    img, video, table { max-width: 100%; }

    /* 1) 히어로 압축 — 첫 화면에 계산기 첫 문항이 보이도록 */
    .hero-section > div { height: 230px !important; }
    .hero-title { font-size: 1.6rem !important; }
    .hero-description { font-size: 0.95rem !important; margin-bottom: 1rem !important; }
    .welcome-badge { margin-bottom: 0.6rem !important; }
    .trust-indicators { padding: 0.55rem 1rem !important; }
    .trust-indicators span { font-size: 0.78rem !important; }

    /* 2) 하단 고정 CTA */
    .mo-sticky-cta {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 190;
        padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
        background: rgba(255,255,255,0.96);
        backdrop-filter: blur(8px);
        border-top: 1px solid #f1f5f9;
        box-shadow: 0 -2px 14px rgba(0,0,0,.07);
    }
    .mo-sticky-cta button {
        width: 100%; min-height: 54px;
        font-size: 1.05rem; font-weight: 700;
        border: none; border-radius: 0.85rem; cursor: pointer;
        color: #fff;
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
        display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    }
    .mo-sticky-cta button:active { transform: scale(0.99); }

    /* 폼 안의 원래 버튼은 숨겨 중복 제거 */
    .calc-submit-inline { display: none !important; }

    /* 하단 고정 요소에 콘텐츠가 가리지 않도록 여백 */
    body { padding-bottom: 88px; }

    /* 3) 플로팅 상담 버튼 — sticky CTA 위로 */
    .floating-btn {
        bottom: calc(88px + env(safe-area-inset-bottom)) !important;
        right: 1rem !important;
        width: 54px !important; height: 54px !important;
    }
    .floating-btn i { font-size: 1.25rem !important; }

    /* 4) 터치 타깃 확보 */
    .radio-card-content { min-height: 68px; }
    .checkbox-card-content { min-height: 56px; display: flex; align-items: center; }
    footer a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 0.35rem; }

    /* 5) iOS 입력 자동 확대 방지 (16px 미만이면 확대됨) */
    input[type="text"], input[type="tel"], input[type="email"],
    input[type="number"], select, textarea { font-size: 16px !important; }
    select { min-height: 48px; }

    /* 6) 가독성 */
    .radio-title { font-size: 0.92rem; }
    .radio-description { font-size: 0.75rem; }
    .info-box .text { line-height: 1.5; }
}

@media (min-width: 769px) {
    .mo-sticky-cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
