:root {
    /* Color Palette based on PRD: 메인 컬러 네이비 블루(#1A56DB) */
    --primary: #1A56DB;
    --primary-light: #4c7ce6;
    --primary-dark: #123d9c;
    
    --bg-color: #F4F6F9;
    --surface: #FFFFFF;
    
    --text-main: #111827;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    --border: #E5E7EB;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #E2E8F0; /* PC 환경 시 배경 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* 스마트폰 목업 형태의 컨테이너 */
#app-wrapper {
    width: 100%;
    max-width: 414px; /* iPhone Max width */
    height: 100vh;
    max-height: 896px;
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

@media (min-width: 480px) {
    #app-wrapper {
        height: 850px;
        border-radius: 30px;
        border: 8px solid #333;
    }
}

.screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
    background-color: var(--bg-color);
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

/* =========================================
   1. 온보딩 스크린 (Onboarding)
========================================= */
#onboarding-screen {
    background-color: var(--surface);
}

.onboarding-slider {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    padding: 40px 24px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.slide.slide-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.slide-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.illustration {
    width: 240px;
    height: 240px;
    background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.illustration i {
    font-size: 80px;
    color: var(--primary);
}

/* 온보딩 카드 애니메이션 효과용 */
.mock-cards { position: relative; }
.mock-card {
    position: absolute;
    width: 140px; height: 180px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.5s;
}
.slide-active .mock-cards .mock-card:nth-child(1) { transform: rotate(-10deg) translateX(-30px); z-index: 1; background:#f8fafc;}
.slide-active .mock-cards .mock-card:nth-child(2) { transform: rotate(10deg) translateX(30px); z-index: 2; background:#f1f5f9; }
.slide-active .mock-cards .mock-card:nth-child(3) { transform: translateY(-20px); z-index: 3; border: 2px solid var(--primary); }

.slide-content {
    text-align: center;
    margin-bottom: 40px;
}

.slide-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 16px;
}

.slide-content h2 .highlight {
    color: var(--primary);
}

.slide-content p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

.onboarding-controls {
    padding: 24px;
    padding-bottom: 40px;
}

.indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.dot {
    width: 8px; height: 8px;
    border-radius: 4px;
    background-color: var(--border);
    transition: all 0.3s;
}

.dot.active {
    width: 24px;
    background-color: var(--primary);
}

.buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

btn {
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    border: none; outline: none;
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    padding: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 16px 24px;
    border-radius: 28px;
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
    transition: transform 0.2s, background-color 0.2s;
    border: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:active {
    transform: scale(0.96);
    background-color: var(--primary-dark);
}

.hidden { display: none !important; }

/* =========================================
   2. 홈 스크린 (대시보드)
========================================= */
#home-screen {
    background-color: var(--bg-color);
    overflow-y: auto;
}

.home-header {
    background: linear-gradient(135deg, var(--primary) 0%, #306cf0 100%);
    color: white;
    padding: 40px 24px 60px 24px; /* 아래쪽 여백을 주어 카드가 걸치도록 */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.user-greeting h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.nudge-text {
    font-size: 14px;
    opacity: 0.9;
}

.profile-icon {
    font-size: 32px;
    cursor: pointer;
}

/* 요약 카드 (글래스모피즘) */
.summary-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin: -35px 24px 24px 24px; /* 헤더에 걸치게 */
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.summary-item .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.summary-item .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.text-primary { color: var(--primary) !important; }

.divider {
    width: 1px;
    background-color: var(--border);
}

/* 홈 컨텐츠 */
.home-content {
    padding: 0 24px;
    padding-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.view-all {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

/* 노선도 프로세스 UI */
.process-map {
    background: white;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}

.process-node {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.node-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    flex-shrink: 0;
    z-index: 2;
}

.process-node.completed .node-icon {
    background-color: var(--primary);
    color: white;
}

.process-node.active .node-icon {
    background-color: var(--surface);
    border: 3px solid var(--primary);
    color: var(--primary);
}

.process-node.locked .node-icon {
    background-color: #F3F4F6;
    color: var(--text-light);
}

/* 펄스 애니메이션 (현재 진행중) */
.pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(26, 86, 219, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(26, 86, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 86, 219, 0); }
}

.process-line {
    width: 2px;
    height: 32px;
    background-color: var(--border);
    margin-left: 15px; /* node-icon 중앙 축 맞춤 */
}

.completed-line {
    background-color: var(--primary);
}

.node-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 5px;
}

.node-content h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}
.node-content p {
    font-size: 13px;
    color: var(--text-muted);
}
.process-node.locked p, .process-node.locked h3 { color: var(--text-light); }

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #E5E7EB;
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}
.progress-bar .fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
}

.action-btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background-color: #F3F4F6;
    color: var(--text-main);
    margin-top: 2px;
}

.action-btn.primary {
    background-color: var(--primary);
    color: white;
}

.action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 도구 그리드 */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tool-card {
    background: white;
    padding: 16px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:active {
    transform: translateY(2px);
    box-shadow: none;
}

.tool-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
}

.bg-blue { background-color: #3B82F6; }
.bg-green { background-color: #10B981; }
.bg-purple { background-color: #8B5CF6; }
.bg-orange { background-color: #F59E0B; }

.tool-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

/* =========================================
   하단 네비게이션
========================================= */
.bottom-nav {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 500;
    width: 60px;
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:active {
    opacity: 0.7;
}
