/* 공통 스타일 및 색상 변수 설정 */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
}

/* 상단 헤더 스타일 */
.site-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.15rem;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
}

.btn-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.hamburger-bar {
    width: 24px;
    height: 2px;
    background-color: var(--text-dark);
    border-radius: 2px;
}

.nav-right-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    color: var(--primary);
    background-color: #eef2ff;
}

/* 드롭다운 메뉴 스타일 */
.dropdown {
    position: relative;
}

.dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.dropdown.is-open .chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    width: 240px;
    padding: 8px;
    margin-top: 8px;
    z-index: 10;
}

.dropdown.is-open .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

.dropdown-item .title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.dropdown-item .desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-list-back {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: background-color 0.2s;
}

.btn-list-back:hover {
    background-color: #f1f5f9;
}

/* 메인 콘텐츠 영역 (비교 계산기는 양쪽 카드를 배치하기 위해 폭을 조금 더 넓게 설정) */
main {
    max-width: 960px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.page-desc {
    font-size: 1rem;
    color: var(--text-muted);
}

.intro-seo-section {
    background-color: #ffffff;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

/* 예적금 비교 전용 2단 그리드 레이아웃 */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.calc-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* 상품 A / 상품 B 상단 뱃지 스타일 */
.card-header-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.badge-a {
    background-color: #eef2ff;
    color: var(--primary);
}

.badge-b {
    background-color: #e0f2fe;
    color: #0284c7;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    background-color: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-wrapper .unit {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: normal;
}

.calc-btn-container {
    text-align: center;
    margin-bottom: 32px;
}

.calc-btn {
    width: 100%;
    max-width: 400px;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calc-btn:hover {
    background-color: var(--primary-hover);
}

/* 비교 결과 테이블 스타일 */
.result-section {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-top: 24px;
}

.result-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: right;
    padding: 12px 16px;
    border-bottom: 2px solid #e2e8f0;
}

.comparison-table th:first-child {
    text-align: left;
}

.comparison-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    text-align: right;
}

.comparison-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.highlight-winner {
    color: var(--primary);
    font-weight: 700;
}

/* 하단 정보 가이드 섹션 스타일 */
.guide-section {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-top: 40px;
}

.guide-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.guide-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.guide-section p {
    margin-bottom: 12px;
    color: var(--text-muted);
}

.guide-section ul {
    margin-left: 20px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.guide-section li {
    margin-bottom: 6px;
}

.faq-box {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

/* 푸터 스타일 */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 60px;
    background-color: #ffffff;
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
}

/* 모바일 반응형 처리 (화면이 작아지면 2단 카드가 1단으로 세로 정렬) */
@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .btn-hamburger {
        display: flex;
    }

    .nav-right-group {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--card-bg);
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid #e2e8f0;
    }

    .nav-right-group.is-open {
        display: flex;
    }

    .main-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .nav-item {
        padding: 10px 12px;
    }

    .btn-list-back {
        justify-content: center;
        margin-top: 8px;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background-color: #f8fafc;
        margin-top: 4px;
        padding-left: 12px;
    }
}
