/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a56db;
    --primary-hover: #1648c0;
    --primary-light: #eff4ff;
    --bg: #ffffff;
    --bg-secondary: #f8faff;
    --bg-tertiary: #f1f5f9;
    --text: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ──────────────────────────────
   버튼
────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 86, 219, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 14px;
}

.btn-lg {
    padding: 18px 48px;
    font-size: 18px;
    border-radius: var(--radius-lg);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    margin-top: 16px;
    font-family: inherit;
}

.btn-text:hover {
    color: var(--text);
}

/* ──────────────────────────────
   헤더
────────────────────────────── */
.header {
    border-bottom: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* ──────────────────────────────
   히어로
────────────────────────────── */
.hero {
    text-align: center;
    padding: 100px 32px 120px;
    background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(26, 86, 219, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 58px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.5px;
    color: var(--text);
    margin-bottom: 20px;
    position: relative;
}

.hero-desc {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 48px;
    position: relative;
}

.search-box {
    display: flex;
    max-width: 640px;
    margin: 0 auto 20px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 4px 24px rgba(26, 86, 219, 0.15);
}

.search-box input {
    flex: 1;
    padding: 18px 24px;
    border: none;
    outline: none;
    font-size: 17px;
    font-family: inherit;
    color: var(--text);
    background: transparent;
}

.search-box .btn {
    border-radius: 0;
    padding: 18px 32px;
    font-size: 16px;
}

.search-hint {
    font-size: 15px;
    color: var(--text-secondary);
}

.search-hint a {
    color: var(--primary);
    font-weight: 500;
}

.search-hint a:hover {
    text-decoration: underline;
}

/* ──────────────────────────────
   공통 섹션
────────────────────────────── */
.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.categories,
.how-to {
    padding: 80px 0;
}

.categories h2,
.how-to h2 {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -1px;
    text-align: center;
    margin-bottom: 12px;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 48px;
}

/* ──────────────────────────────
   카테고리 그리드
────────────────────────────── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg);
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
}

.category-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    font-size: 40px;
}

.category-card strong {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.category-card span {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ──────────────────────────────
   이용 방법
────────────────────────────── */
.how-to {
    background: var(--bg-secondary);
}

.how-to h2 {
    margin-bottom: 48px;
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    flex: 1;
    text-align: center;
    padding: 40px 24px;
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    border-radius: 50%;
    margin-bottom: 16px;
}

.step h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.step p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.step-arrow {
    font-size: 28px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* ──────────────────────────────
   퀴즈 배너
────────────────────────────── */
.quiz-banner {
    background: linear-gradient(135deg, #1a56db 0%, #3b82f6 100%);
    padding: 80px 0;
}

.quiz-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.quiz-content h2 {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.quiz-content p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 18px;
}

.quiz-banner .btn-primary {
    background: #fff;
    color: var(--primary);
    flex-shrink: 0;
    white-space: nowrap;
}

.quiz-banner .btn-primary:hover {
    background: #f0f5ff;
}

/* ──────────────────────────────
   지원사업 목록 페이지
────────────────────────────── */
.programs-page {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 32px;
    gap: 48px;
    align-items: flex-start;
}

.filter-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

.filter-sidebar h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-item {
    display: block;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-secondary);
    transition: all 0.15s;
    font-weight: 500;
}

.filter-item:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.filter-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

.programs-list {
    flex: 1;
    min-width: 0;
}

.programs-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 32px;
}

.programs-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.programs-count {
    font-size: 16px;
    color: var(--text-secondary);
}

.program-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.program-card {
    padding: 32px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg);
    transition: all 0.2s;
}

.program-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.program-tags {
    margin-bottom: 12px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.tag-blue {
    background: #eff4ff;
    color: #1a56db;
}

.tag-pink {
    background: #fdf2f8;
    color: #9d174d;
}

.tag-green {
    background: #f0fdf4;
    color: #166534;
}

.tag-purple {
    background: #f5f3ff;
    color: #5b21b6;
}

.tag-orange {
    background: #fff7ed;
    color: #9a3412;
}

.tag-teal {
    background: #f0fdfa;
    color: #0f766e;
}

.tag-gray {
    background: #f9fafb;
    color: #374151;
}

.tag-indigo {
    background: #eef2ff;
    color: #3730a3;
}

.program-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.program-card>p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.program-meta {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ──────────────────────────────
   퀴즈 페이지
────────────────────────────── */
.quiz-page {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f0f5ff 0%, #fff 60%);
    padding: 60px 24px;
}

.quiz-container {
    width: 100%;
    max-width: 640px;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.4s ease;
}

#progress-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.quiz-question h1 {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 16px;
}

.quiz-question h2 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 32px;
}

.quiz-question p {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.quiz-option {
    padding: 20px 24px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 17px;
    font-weight: 500;
    text-align: left;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: var(--text);
}

.quiz-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(4px);
}

/* 퀴즈 결과 */
.quiz-result h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.quiz-result>p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.result-item {
    padding: 24px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg);
}

.result-item h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 10px 0 6px;
}

.result-item p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.result-actions {
    display: flex;
    gap: 12px;
}

/* ──────────────────────────────
   로그인 / 회원가입
────────────────────────────── */
.auth-body {
    background: #f5f5f7;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-layout {
    width: 100%;
    max-width: 400px;
    padding: 32px 24px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.auth-logo a {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.auth-card {
    width: 100%;
    background: #ffffff;
    border-radius: 20px;
    padding: 44px 40px;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.04),
        0 4px 12px rgba(0,0,0,0.06),
        0 16px 40px rgba(0,0,0,0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.6px;
    margin-bottom: 8px;
    color: #1d1d1f;
}

.auth-header p {
    font-size: 15px;
    color: #6e6e73;
    line-height: 1.5;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
    letter-spacing: 0.1px;
}

.form-group input {
    padding: 13px 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: #1d1d1f;
    background: #f5f5f7;
    outline: none;
    transition: background 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
}

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

.form-group input:focus {
    background: #ebebed;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.18);
}

.btn-full {
    width: 100%;
    margin-top: 8px;
    padding: 15px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    letter-spacing: -0.1px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    color: #aeaeb2;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5ea;
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: #6e6e73;
    margin-top: 20px;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-terms {
    font-size: 12px;
    color: #aeaeb2;
    text-align: center;
    line-height: 1.8;
    padding: 0 8px;
}

.auth-terms a {
    color: #6e6e73;
}

.auth-terms a:hover {
    text-decoration: underline;
}

/* ──────────────────────────────
   푸터
────────────────────────────── */
.footer {
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    padding: 48px 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    text-align: center;
}

.footer-logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
}

.footer-inner p {
    font-size: 14px;
    color: var(--text-tertiary);
    line-height: 1.8;
}

.footer-copy {
    margin-top: 8px;
}

/* ──────────────────────────────
   반응형
────────────────────────────── */
@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 16px 20px;
    }

    .hero {
        padding: 60px 20px 80px;
    }

    .hero h1 {
        font-size: 40px;
    }

    .hero-desc {
        font-size: 17px;
    }

    .search-box input {
        font-size: 15px;
        padding: 14px 18px;
    }

    .section-inner {
        padding: 0 20px;
    }

    .categories,
    .how-to {
        padding: 60px 0;
    }

    .categories h2,
    .how-to h2 {
        font-size: 30px;
    }

    .steps {
        flex-direction: column;
        gap: 12px;
    }

    .step-arrow {
        transform: rotate(90deg);
    }

    .quiz-content {
        flex-direction: column;
        text-align: center;
    }

    .quiz-content h2 {
        font-size: 26px;
    }

    .programs-page {
        flex-direction: column;
        padding: 32px 20px;
        gap: 32px;
    }

    .filter-sidebar {
        width: 100%;
        position: static;
    }

    .filter-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .quiz-question h1 {
        font-size: 32px;
    }

    .quiz-question h2 {
        font-size: 24px;
    }
}