/* 기본 카드 스타일 */
.main-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.explanation-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-top: 1.5rem;
    border: 1px solid #f1f5f9;
}

/* 헤더 스타일 */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-icon-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.header-icon {
    font-size: 2rem;
}

.header-title {
    font-size: 1.875rem;
    font-weight: bold;
    color: #1f2937;
    margin: 0;
}

.header-subtitle {
    color: #6b7280;
    margin: 0;
    font-size: 1rem;
}

/* 섹션 스타일 */
.calc-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.5rem;
}

/* 입력 그룹 - 반응형 개선 */
.input-group {
    margin-bottom: 1.5rem;
}

.input-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.input-label {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.5;
    text-align: left;
}

.input-field, .select-field {
    max-width: 280px;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    height: 48px;
    box-sizing: border-box;
}

.input-field:focus, .select-field:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-field.small {
    max-width: 120px;
}

/* 부양가족 섹션 개선 */
.family-section {
    background: #fafbff;
    border: 1px solid #e0e7ff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1rem 0;
}

.family-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 체크박스 그룹 - 더 안정적인 레이아웃 */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    max-width: 500px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 48px;
    box-sizing: border-box;
}

.checkbox-item:hover {
    border-color: #c7d2fe;
    background: #f8faff;
}

.checkbox-item.checked {
    border-color: #4f46e5;
    background: #eef2ff;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.1);
}

.checkbox-item input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #4f46e5;
}

.checkbox-item span {
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* 숫자 입력 필드들을 더 체계적으로 배치 */
.number-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 700px;
}

.number-input-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: border-color 0.2s;
}

.number-input-item:hover {
    border-color: #d1d5db;
}

.number-input-item label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    display: block;
    line-height: 1.4;
}

.number-input-item input {
    width: 100%;
    max-width: 100px;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    background: #fafbff;
}

.number-input-item input:focus {
    outline: none;
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* 도움말 개선 */
.help-note {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 4px solid #0ea5e9;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    color: #0c4a6e;
    line-height: 1.5;
}

/* 계산 버튼 */
.calculate-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.2);
}

/* 결과 표시 */
.result-container {
    background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
    border: 2px solid #e0e7ff;
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.result-container.hidden {
    display: none;
}

.total-score {
    font-size: 3rem;
    font-weight: bold;
    color: #4f46e5;
    margin-bottom: 1rem;
}

.score-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.score-item {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.score-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.score-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1f2937;
}

/* 도움말 */
.help-note {
    background: #fffbeb;
    border: 1px solid #fde047;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.875rem;
    color: #a16207;
}

/* 설명 카드 스타일 */
.explanation-card h3 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.explanation-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 2rem 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.guide-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.guide-card h5 {
    font-weight: 600;
    color: #4f46e5;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.score-table {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    margin: 1rem 0;
}

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

.score-table th {
    background: #f9fafb;
    padding: 0.75rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.score-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.warning-box {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.warning-box h5 {
    color: #dc2626;
    font-weight: 600;
    margin-bottom: 1rem;
}

.warning-box ul {
    color: #991b1b;
    padding-left: 1.5rem;
}

.warning-box li {
    margin-bottom: 0.5rem;
}

/* 반응형 - 데스크톱에서 더 컴팩트하게 */
@media (min-width: 1024px) {
    .main-card {
        max-width: 900px;
        margin: 0 auto 1.5rem;
    }

    .calc-section {
        padding: 1.25rem;
    }

    .checkbox-group {
        max-width: 500px;
    }

    .number-inputs {
        max-width: 700px;
    }

    .input-row {
        grid-template-columns: 220px 1fr;
    }
}

/* 반응형 - 태블릿 */
@media (max-width: 1023px) and (min-width: 769px) {
    .input-row {
        grid-template-columns: 180px 1fr;
        gap: 1rem;
    }

    .number-inputs {
        grid-template-columns: repeat(2, 1fr);
    }

    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    .main-card, .explanation-card {
        padding: 1.5rem;
    }

    .input-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .input-label {
        margin-bottom: 0.5rem;
    }

    .input-field, .select-field {
        max-width: 100%;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .checkbox-item {
        min-height: 44px;
    }

    .number-inputs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .score-breakdown {
        grid-template-columns: 1fr;
    }

    .total-score {
        font-size: 2.5rem;
    }

    .family-section {
        padding: 1.25rem;
    }
}