/* ===== 기본 설정 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;800&display=swap');

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f0f2f5;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Skip Navigation ===== */
.skip-nav {
    position: absolute;
    top: -100%;
    left: 16px;
    background: #6366f1;
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.3s ease;
}

.skip-nav:focus {
    top: 0;
}

/* ===== 헤더 ===== */
header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    padding: 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 10px;
    position: relative;
}

.nav-menu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* ===== 히어로 섹션 ===== */
.hero {
    text-align: center;
    padding: 5rem 0 3rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero h2 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    line-height: 1.3;
}

.hero p {
    font-size: 1.15rem;
    color: #64748b;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ===== 계산기 카드 그리드 ===== */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.calc-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #a78bfa, #ec4899);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.calc-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.calc-card:hover::before {
    opacity: 1;
}

.calc-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    background: linear-gradient(135deg, #f0f0ff, #fdf2f8);
    width: 64px;
    height: 64px;
    line-height: 64px;
    text-align: center;
    border-radius: 16px;
}

.calc-card h3 {
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.calc-card p {
    color: #64748b;
    margin-bottom: 1.25rem;
    line-height: 1.7;
    font-size: 0.92rem;
}

.features {
    list-style: none;
    margin-bottom: 1.5rem;
    margin-top: auto;
}

.features li {
    color: #475569;
    padding: 6px 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.9rem;
}

.features li:before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #6366f1;
    font-weight: 700;
    font-size: 0.85rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 10px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    background: linear-gradient(135deg, #5558e6, #7c4fe0);
}

/* ===== 계산기 페이지 ===== */
.calculator-page {
    background: #fff;
    border-radius: 24px;
    padding: 3rem;
    margin: 3rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.calculator-page h2 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.calculator-page .subtitle {
    color: #64748b;
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #334155;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f8fafc;
    color: #1e293b;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.input-hint {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 6px;
    padding-left: 2px;
}

.calc-button {
    width: 100%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    margin-top: 0.5rem;
}

.calc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.calc-button:active {
    transform: translateY(0);
}

/* ===== 결과 섹션 ===== */
.result-section {
    margin-top: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #fafafe 0%, #f5f3ff 50%, #fdf2f8 100%);
    border-radius: 20px;
    display: none;
    border: 1px solid rgba(99, 102, 241, 0.08);
}

.result-section.show {
    display: block;
    animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 8px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease;
}

.result-item:hover {
    transform: scale(1.01);
}

.result-label {
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
}

.result-value {
    color: #6366f1;
    font-size: 1.15rem;
    font-weight: 700;
}

.result-highlight {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    color: white;
    padding: 2rem;
    border-radius: 18px;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.25);
    position: relative;
    overflow: hidden;
}

.result-highlight::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.result-highlight .label {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

.result-highlight .value {
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 8px;
    letter-spacing: -0.5px;
}

/* ===== 상세 테이블 ===== */
.detail-table {
    margin-top: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.detail-table h3 {
    font-weight: 700;
}

.detail-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.detail-table th {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #475569;
}

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

.detail-table tbody tr {
    transition: background 0.2s ease;
}

.detail-table tbody tr:hover {
    background: #f8fafc;
}

/* ===== 정보 섹션 ===== */
.info-section {
    margin: 3rem 0;
    padding: 3rem;
    background: white;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.info-section h2 {
    text-align: center;
    color: #1e293b;
    margin-bottom: 2.5rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.info-content-text {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.info-content-text > p {
    color: #475569;
    line-height: 1.9;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.info-content-text h3 {
    color: #1e293b;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.info-content-text h4 {
    color: #334155;
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

.info-content-text p {
    color: #475569;
    line-height: 1.9;
    font-size: 0.93rem;
    margin-bottom: 0.75rem;
}

.guide-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.5rem;
}

.guide-list li {
    color: #475569;
    padding: 10px 0 10px 1.5rem;
    position: relative;
    line-height: 1.8;
    font-size: 0.93rem;
    border-bottom: 1px solid #f8fafc;
}

.guide-list li:last-child {
    border-bottom: none;
}

.guide-list li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: #6366f1;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.5;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.info-item {
    padding: 1.5rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: #f0f0ff;
    border-color: rgba(99, 102, 241, 0.15);
}

.info-item h4 {
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 700;
}

.info-item p {
    color: #64748b;
    line-height: 1.7;
    font-size: 0.9rem;
}

/* ===== FAQ 섹션 ===== */
.faq-section {
    margin: 3rem 0;
    padding: 3rem;
    background: white;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.faq-section h2 {
    color: #1e293b;
    margin-bottom: 2rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.faq-item {
    margin-bottom: 0;
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 0;
    transition: background 0.2s ease;
}

.faq-item:first-of-type {
    border-radius: 12px 12px 0 0;
}

.faq-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.faq-item:hover {
    background: #f8fafc;
}

.faq-item h4 {
    color: #1e293b;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.95rem;
}

.faq-item p {
    color: #64748b;
    line-height: 1.8;
    font-size: 0.9rem;
}

/* ===== 법적 페이지 (개인정보처리방침, 이용약관, 소개) ===== */
.legal-page {
    background: #fff;
    border-radius: 24px;
    padding: 3rem;
    margin: 3rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.legal-page h2 {
    color: #1e293b;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.legal-updated {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.legal-content h3 {
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.legal-content h3:first-child {
    margin-top: 0;
}

.legal-content p {
    color: #475569;
    line-height: 1.9;
    font-size: 0.93rem;
    margin-bottom: 0.75rem;
}

.legal-content ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.legal-content ul li {
    color: #475569;
    padding: 8px 0 8px 1.5rem;
    position: relative;
    line-height: 1.8;
    font-size: 0.93rem;
}

.legal-content ul li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: #6366f1;
    font-weight: 700;
    font-size: 1.2rem;
}

.legal-content a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.legal-content a:hover {
    text-decoration: underline;
}

/* ===== 푸터 ===== */
footer {
    background: #0f172a;
    color: #94a3b8;
    text-align: center;
    padding: 2.5rem 0;
    margin-top: 4rem;
}

footer p {
    margin: 4px 0;
    font-size: 0.85rem;
    line-height: 1.7;
}

.footer-links {
    margin-bottom: 1.5rem;
}

.footer-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-divider {
    color: #475569;
    margin: 0 12px;
    font-size: 0.85rem;
}

.footer-disclaimer {
    max-width: 700px;
    margin: 0 auto 1rem;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #64748b;
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
    header nav {
        height: 60px;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .nav-menu {
        gap: 0.25rem;
    }

    .nav-menu a {
        font-size: 0.78rem;
        padding: 6px 10px;
    }

    .hero {
        padding: 3rem 0 2rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .calculator-page {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .result-highlight .value {
        font-size: 1.6rem;
    }

    .detail-table {
        font-size: 0.85rem;
    }

    .info-section,
    .faq-section {
        padding: 2rem 1.5rem;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .legal-page {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.5rem;
    }

    .calculator-page {
        padding: 1.5rem 1.2rem;
        margin: 2rem 0;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .result-value {
        font-size: 1.05rem;
    }

    .legal-page {
        padding: 1.5rem 1.2rem;
        margin: 2rem 0;
    }
}

/* ===== SPA 페이지 전환 ===== */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* 네비게이션 활성 상태 */
.nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15);
}

/* 카드 클릭 커서 */
.calc-card[data-goto] {
    cursor: pointer;
}

/* ===== 모바일 햄버거 메뉴 ===== */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 200;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1rem;
        gap: 0.25rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu a {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* ===== 스크롤바 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== 셀렉션 ===== */
::selection {
    background: rgba(99, 102, 241, 0.2);
    color: #1e293b;
}
