/* style-base.css - Global base styles, design tokens, and card components */
/* Version: 10.0 (Pretendard 적용) */

/* 프리텐다드 (가변 폰트, 한글 동적 서브셋 — 필요한 글자만 내려받아 가볍다)
   CSP: style-src/font-src에 cdn.jsdelivr.net 허용 필요 (_headers, firebase.json 양쪽 반영됨) */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
    /* Color Palette */
    --primary: #1a73e8;
    --primary-hover: #155ab6;
    --primary-light: #e8f0fe;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* 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);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Phone82 reference logo: crisp HTML/CSS mark rendered with Pretendard. */
.phone82-brand {
    display: inline-flex;
    width: 340px;
    max-width: 90%;
    flex-direction: column;
    align-items: center;
    color: #172033;
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    font-style: normal;
    letter-spacing: 0;
    line-height: 1.15;
    text-decoration: none;
}

.phone82-brand__bubble {
    position: relative;
    z-index: 1;
    display: block;
    width: max-content;
    max-width: 100%;
    margin-bottom: 20px;
    padding: 8px 12px 7px;
    border: 2px solid transparent;
    border-radius: 16px;
    background: linear-gradient(#fff, #fff) padding-box,
                linear-gradient(115deg, #2cc4f2, #647cff 55%, #c34ee7) border-box;
    color: #3f68ea;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: left;
    box-shadow: 0 8px 22px rgba(73, 105, 220, 0.08);
}

.phone82-brand__bubble::after {
    content: '';
    position: absolute;
    left: 51%;
    bottom: -12px;
    width: 20px;
    height: 20px;
    border-right: 2px solid #7b70f5;
    border-bottom: 2px solid #7b70f5;
    background: #fff;
    transform: translateX(-50%) rotate(45deg);
}

.phone82-brand__bubble strong,
.phone82-brand__bubble span {
    position: relative;
    z-index: 1;
    display: block;
    font: inherit;
}

.phone82-brand__bubble b {
    color: #397fea;
    font-weight: 800;
}

.phone82-brand__wordmark {
    display: block;
    font-size: 2.55rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.phone82-brand__wordmark > span,
.phone82-brand__wordmark > strong {
    background: linear-gradient(100deg, #a34be5 4%, #387be9 82%);
    background-clip: text;
    -webkit-background-clip: text;
    color: #4779e8;
    -webkit-text-fill-color: transparent;
}

.phone82-brand__wordmark > strong { font-weight: 850; }
.phone82-brand__wordmark > em {
    color: #172033;
    font-style: normal;
    font-weight: 750;
}

.phone82-brand--landing { width: 300px; }
.phone82-brand--landing .phone82-brand__bubble {
    margin-bottom: 16px;
    padding: 6px 10px 5px;
    border-radius: 14px;
    font-size: 0.7rem;
}
.phone82-brand--landing .phone82-brand__wordmark { font-size: 2.2rem; }
.phone82-brand--compact { width: 300px; }
.phone82-brand--compact .phone82-brand__bubble { font-size: 0.76rem; }
.phone82-brand--compact .phone82-brand__wordmark { font-size: 2.25rem; }
.brand-heading { text-align: center; }

body.dark-mode .phone82-brand__bubble,
.dark .phone82-brand__bubble {
    background: linear-gradient(#182235, #182235) padding-box,
                linear-gradient(115deg, #2cc4f2, #647cff 55%, #c34ee7) border-box;
    color: #dbe7ff;
}
body.dark-mode .phone82-brand__bubble::after,
.dark .phone82-brand__bubble::after { background: #182235; }
body.dark-mode .phone82-brand__wordmark > em,
.dark .phone82-brand__wordmark > em { color: #f1f5f9; }

@media (max-width: 640px) {
    .phone82-brand { width: 270px; }
    .phone82-brand__bubble {
        margin-bottom: 16px;
        padding: 7px 10px 6px;
        border-radius: 14px;
        font-size: 0.72rem;
    }
    .phone82-brand__wordmark { font-size: 2.05rem; }
    .phone82-brand--landing { width: 245px; }
    .phone82-brand--landing .phone82-brand__bubble { font-size: 0.65rem; }
    .phone82-brand--landing .phone82-brand__wordmark { font-size: 1.8rem; }
    .phone82-brand--compact { width: 245px; }
    .phone82-brand--compact .phone82-brand__bubble { font-size: 0.65rem; }
    .phone82-brand--compact .phone82-brand__wordmark { font-size: 1.8rem; }
}

/* Base Card Style */
.card-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card-section:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px;
}

/* ======================================================================= */
/* style.css (Version: 9.9.3 (Latest Update)) */
/* ======================================================================= */

.pc-only { display: inline; }
.mobile-only { display: none; }

@media (max-width: 768px) {
    .pc-only { display: none !important; }
    .mobile-only { display: inline !important; }
}

/* ================================== */
/* ?�▼??초기?�금??& ?��?개월??개편 ?��????�▼??*/
/* ================================== */
.input-group.smartwatch-group {
    border: 1px solid #e4d9fb;
    background-color: #faf8ff;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.input-group.smartwatch-group label {
    color: #7c3aed; /* ?�이�??�상 강조 */
}

/* ?�크모드 ?�??*/
body.dark-mode .input-group.smartwatch-group {
    background-color: #241b38;
    border-color: #4c3a75;
}

body.dark-mode .input-group.smartwatch-group label {
    color: #c4b5fd;
}

/* 스마트워치 "함께 써요" 버튼: 다른 파란색 토글과 구분되는 보라색 강조 */
.smartwatch-unified-group [id^="smartwatch-main-toggle-"] .payment-button.active[data-value="true"] {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}

body.dark-mode .smartwatch-unified-group [id^="smartwatch-main-toggle-"] .payment-button.active[data-value="true"] {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
}

.plan-maintenance-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 15px;
    position: relative;
}

.plan-maintenance-row .input-group {
    margin-bottom: 0;
    flex: 1;
}

.plan-maintenance-row .maintenance-group {
    flex: 1.2;
    display: flex;
    flex-direction: column; /* ?�이블을 버튼 ?�로 보내�??�해 추�? */
    align-items: stretch;
    gap: 5px;
    position: relative;
}

.plan-maintenance-row .maintenance-group label {
    display: block;
    font-weight: bold;
    font-size: 0.9em; /* ?�금???�력�??�이블과 ?�일�?*/
    margin-bottom: 0;
}

.maintenance-months-buttons {
    display: flex !important;
    gap: 4px !important;
    margin-bottom: 0 !important;
    width: 100%;
    grid-template-columns: none !important;
}

.maintenance-month-button {
    flex: 1;
    padding: 8px 2px !important;
    font-size: 0.8em !important;
    min-height: 40px !important;
    line-height: 1.1;
    white-space: nowrap;
}

/* 개월??직접?�력 ?�업 ?�니메이??(?�래�??�오�??�정) */
.custom-maintenance-popup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: absolute;
    top: calc(100% + 5px); /* 버튼 바로 ?�래 배치 */
    right: 0; /* 버튼 그룹 ?�측 ?�렬 */
    transform: scaleY(0);
    transform-origin: top;
    background: #fff;
    padding: 10px 15px;
    border: 2px solid #1a73e8;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    z-index: 110;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    pointer-events: none;
}

.custom-maintenance-popup.active {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
}

.custom-maintenance-popup input {
    width: 60px !important;
    padding: 5px !important;
    text-align: center;
    height: 35px !important;
    font-size: 1em !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

.custom-maintenance-popup span {
    font-weight: bold;
    color: #1a73e8;
    font-size: 0.95em;
}

/* ?�크모드 ?�??*/
body.dark-mode .custom-maintenance-popup {
    background: #1f2937;
    border-color: #60a5fa;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
body.dark-mode .custom-maintenance-popup span {
    color: #60a5fa;
}

@media (max-width: 768px) {
    .plan-maintenance-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .plan-maintenance-row .maintenance-group {
        flex: none;
    }
    .custom-maintenance-popup {
        top: calc(100% + 5px);
        width: 100%; /* 모바?�에?�는 가??차게 */
        box-sizing: border-box;
    }
}

/* ================================== */
/* ?�▲??초기?�금??& ?��?개월??개편 ?��????�▲??*/
/* ================================== */

/* ================================== */
/* ========= 공통 기본 ?��???========= */
/* ================================== */
* { box-sizing: border-box; }
body { font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Inter", sans-serif; background: #f5f7fa; color: #333; padding: 20px; transition: background-color 0.3s, color 0.3s; }
html, body { height: 100%; margin: 0; }

/* ?�크모드 ?�정 (?�용???��? 기반) */
body.dark-mode { background: #111827; color: #ffffff; }

/* ?�마 ?��? 버튼 강조 ?��???*/
.icon-button.btn-dark-mode-toggle {
    background-color: #374151; /* 차분???�크 그레??*/
    color: #ffffff;
    width: 70px;
    height: 70px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(55, 65, 81, 0.3);
    position: relative;
    transition: all 0.2s ease;
}

.icon-button.btn-dark-mode-toggle i {
    font-size: 1.2em;
    margin-bottom: 2px;
}

.icon-button.btn-dark-mode-toggle span {
    color: #ffffff;
    font-weight: bold;
    font-size: 13px;
    margin-top: 6px;
}

.icon-button.btn-dark-mode-toggle:hover {
    background-color: #1f2937;
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ?�크모드????버튼 ?�상 변�?(??모양) */
body.dark-mode .icon-button.btn-dark-mode-toggle {
    background-color: #f59e0b !important; /* ?�뜻???��???(?�양 ?�낌) */
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
}

body.dark-mode .icon-button.btn-dark-mode-toggle:hover {
    background-color: #d97706 !important;
}

body.dark-mode .container { background: #1f2937 !important; color: #ffffff !important; box-shadow: 0 6px 20px rgba(0,0,0,0.3) !important; }
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5 { color: #ffffff !important; }
body.dark-mode .section { background: #374151 !important; border-color: #4b5563 !important; }
body.dark-mode .input-group label { color: #ffffff !important; }
body.dark-mode .input-group input, body.dark-mode .input-group select { background-color: #1f2937 !important; color: #ffffff !important; border-color: #4b5563 !important; }
body.dark-mode .info-box { background-color: #374151 !important; color: #e5e7eb !important; border-color: #4b5563 !important; }
body.dark-mode .info-box-red { background-color: #451a1a !important; color: #f87171 !important; border: 1px solid #7f1d1d !important; border-radius: 4px; padding: 10px; }
body.dark-mode .sidebar-menu { background: #1f2937 !important; color: #ffffff !important; }
body.dark-mode .sidebar-menu nav a { color: #ffffff !important; }
body.dark-mode .sidebar-menu nav a:hover { background-color: #374151 !important; }
body.dark-mode .sidebar-header { border-bottom-color: #374151 !important; }
body.dark-mode .modal-content { background: #1f2937 !important; color: #ffffff !important; }
body.dark-mode .date-calculator-section { background-color: #374151 !important; border-color: #4b5563 !important; color: #ffffff !important; }
body.dark-mode .additional-plan-box { background-color: #2d3748 !important; border-color: #4b5563 !important; }

/* 요금제 추가 변경 버튼 - 완전히 다른 Amber 테마 */
.btn-additional-plan {
    border: 2px solid #f59e0b !important;
    color: #d97706 !important;
    background-color: #fffbeb !important;
    font-weight: 800 !important;
    transition: all 0.2s ease-in-out !important;
}

.btn-additional-plan:hover {
    background-color: #fef3c7 !important;
}

.btn-additional-plan.active {
    background-color: #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}

/* 추가 요금제 설정창 - 차별화된 디자인 (점선 및 미색) */
.additional-plan-box { 
    background-color: #fffef2 !important; 
    border: 2px dashed #fcd34d !important; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02) !important;
    margin-top: 5px !important;
}

/* 다크모드 시인성 강화 - 버튼 존재감 대폭 업그레이드 */
body.dark-mode .btn-additional-plan {
    border: 2px solid #f59e0b !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #451a03 0%, #92400e 100%) !important; /* 진한 황금빛 그라데이션 */
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4) !important; /* 상시 은은한 광채 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

body.dark-mode .btn-additional-plan:hover {
    background: linear-gradient(135deg, #78350f 0%, #b45309 100%) !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6) !important;
}

body.dark-mode .btn-additional-plan.active {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
    color: #000000 !important; /* 활성화 시 텍스트 검정으로 대비 극대화 */
    border-color: #ffffff !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.8) !important;
    text-shadow: none;
}

body.dark-mode .additional-plan-box { 
    background-color: #2d261a !important; /* 더 밝고 따뜻한 톤 */
    border-color: #fbbf24 !important; /* 금색 점선 테두리 */
}

/* 화면 정중앙 안내 팝업 스타일 개선 (줄바꿈 및 다크모드 대비) */
.center-notice-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9); /* 더 진한 배경 */
    color: white;
    padding: 35px 30px;
    border-radius: 24px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 80%;
    max-width: 380px;
    backdrop-filter: blur(10px);
    border: 2px solid #f59e0b; /* 황금색 테두리 기본 적용 */
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.center-notice-overlay.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.center-notice-content {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.7;
    word-break: keep-all; /* 단어 단위 줄바꿈 */
    white-space: pre-line; /* \n 대응 */
}

/* 안내 팝업 하단 예시 텍스트: 작게, 자동 줄바꿈, 한글 단어 단위 줄바꿈 */
.center-notice-example {
    word-break: keep-all;
    overflow-wrap: anywhere; /* 긴 숫자/단어가 컨테이너 폭을 넘어가지 않게 */
    white-space: pre-line;
}

.center-notice-icon {
    font-size: 3rem;
    color: #fbbf24;
    margin-bottom: 20px;
    display: block;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.4));
}

body.dark-mode .center-notice-overlay {
    background: rgba(20, 20, 20, 0.95);
    border-color: #fbbf24;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}
body.dark-mode .date-calculator-section h3 { color: #ffffff !important; border-bottom-color: #4b5563 !important; }
body.dark-mode .date-input-group input { background-color: #1f2937 !important; color: #ffffff !important; border-color: #4b5563 !important; }
body.dark-mode .date-input-group span { color: #9ca3af !important; }
body.dark-mode .date-calculator-section .result { color: #60a5fa !important; }

/* 결과 ?�션 �??�이�??�크모드 */
body.dark-mode .result-section { background-color: #1e293b !important; border: 1px solid #334155 !important; }
body.dark-mode .monthly-table th { background-color: #334155 !important; color: #ffffff !important; border-color: #475569 !important; }
body.dark-mode .monthly-table td { background-color: #1f2937 !important; color: #e5e7eb !important; border-color: #334155 !important; }
body.dark-mode .monthly-table tr:nth-child(even) td { background-color: #111827 !important; }
body.dark-mode .winner { color: #60a5fa !important; }

/* ?�약�?계산�??�이�??�크모드 */
body.dark-mode #penaltyMonthlyResults td { color: #e5e7eb !important; border-color: #334155 !important; }
body.dark-mode #penalty-calc-table-wrapper { background-color: #1f2937 !important; }

/* ?�약�?계산�?- 중도 ?��? ?�션 ?�크모드 */
body.dark-mode #penalty-termination-calculator .section {
    background-color: #1f2937 !important;
    border-color: #4b5563 !important;
    color: #e5e7eb !important;
}

body.dark-mode .plan-history-item {
    background-color: #1f2937 !important; /* ?�금???�력 박스 배경 */
    border-color: #4b5563 !important;
}

body.dark-mode .plan-history-item h4 {
    border-bottom-color: #374151 !important;
    color: #60a5fa !important;
}

body.dark-mode #termination-penalty-result {
    background-color: #1e293b !important; /* 결과 ?�역 배경 */
    border: 1px solid #334155 !important;
    color: #e5e7eb !important;
}

body.dark-mode #termination-penalty-result ul li {
    border-bottom-color: #374151 !important;
}

body.dark-mode #termination-penalty-result .final-penalty {
    border-top-color: #60a5fa !important;
}

body.dark-mode #add-plan-change-btn {
    color: #d1d5db !important;
    border-color: #4b5563 !important;
}

body.dark-mode #add-plan-change-btn:hover {
    background-color: #374151 !important;
}

/* ?�세 ?�역 카드 ?�크모드 */
body.dark-mode .breakdown-card { background: #1f2937 !important; border-color: #4b5563 !important; color: #ffffff !important; }
body.dark-mode .breakdown-card h5 { border-bottom-color: #374151 !important; }
body.dark-mode .breakdown-card p, body.dark-mode .breakdown-card li { color: #e5e7eb !important; }
body.dark-mode .breakdown-card .discount-item { color: #60a5fa !important; }
body.dark-mode .device-price-section { border-bottom-color: #374151 !important; }
body.dark-mode .device-price-section strong { color: #ffffff !important; }
body.dark-mode .total-cost-section { border-bottom-color: #374151 !important; }
body.dark-mode .total-cost-section strong { color: #f87171 !important; }

/* 버튼 �????�크모드 */
body.dark-mode .carrier-button, body.dark-mode .payment-button, body.dark-mode .discount-button, body.dark-mode .maintenance-month-button, body.dark-mode .installment-month-button, body.dark-mode .discount-type-select-trigger { background-color: #374151 !important; color: #ffffff !important; border-color: #4b5563 !important; }
body.dark-mode .carrier-button img { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
body.dark-mode .carrier-button.active, body.dark-mode .payment-button.active, body.dark-mode .discount-button.active, body.dark-mode .maintenance-month-button.active, body.dark-mode .installment-month-button.active { background-color: #1a73e8 !important; border-color: #1a73e8 !important; color: #ffffff !important; }

/* ?��? 개월 컨테?�너 ?�크모드 */
body.dark-mode .installment-months-container {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}

/* 부가?�비??강조 버튼 ?�크모드 */
body.dark-mode .payment-button.extra-toggle.active {
    background-color: #d97706 !important; /* ?�간 ???�두???�렌지 */
    border-color: #b45309 !important;
}

body.dark-mode .payment-button.extra-toggle:not(.active) {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
}

/* 가족할??�?결합?�보 모달 보강 */
body.dark-mode .family-carrier-tab, body.dark-mode .family-combo-btn { background-color: #374151 !important; color: #ffffff !important; border-color: #4b5563 !important; }
body.dark-mode .family-carrier-tab.active, body.dark-mode .family-combo-btn.active { background-color: #1a73e8 !important; border-color: #1a73e8 !important; }
body.dark-mode .family-input-row { background-color: #1f2937 !important; border-color: #4b5563 !important; }
body.dark-mode .family-sub-option { background-color: #374151 !important; border-left-color: #60a5fa !important; }
body.dark-mode .combination-tabs { background-color: #374151 !important; border-bottom-color: #4b5563 !important; }
body.dark-mode .combination-tab { color: #d1d5db !important; }
body.dark-mode .combination-tab.active { background-color: #1f2937 !important; color: #60a5fa !important; border-bottom-color: #60a5fa !important; }
body.dark-mode .combination-table th { background-color: #334155 !important; color: #ffffff !important; border-color: #475569 !important; }
body.dark-mode .combination-table td { border-color: #334155 !important; color: #e5e7eb !important; }
body.dark-mode .combination-table tr:nth-child(even) { background-color: #111827 !important; }
body.dark-mode .welfare-step-title {
    color: #ffffff !important;
}

body.dark-mode .welfare-step-title span {
    background-color: #60a5fa !important; /* 번호 ?�이콘을 밝�? ?��??�으�?*/
    color: #ffffff !important;
}

body.dark-mode .modal-content p {
    color: #d1d5db !important; /* 모달 ???�반 ?�명 ?�스??*/
}

/* 복�??�인 결과 컨테?�너 가?�성 */
body.dark-mode .welfare-example-card {
    background-color: #1f2937 !important;
    border-color: #4b5563 !important;
}

body.dark-mode .welfare-example-card .card-body {
    background-color: #1f2937 !important;
}

body.dark-mode .welfare-example-card .card-header {
    background-color: #374151 !important;
    border-bottom-color: #4b5563 !important;
    color: #ffffff !important;
}

body.dark-mode .welfare-example-card.high .card-header {
    background-color: #1e3a8a !important; /* ?�크모드??진한 ?�랑 */
    color: #ffffff !important;
}

body.dark-mode .welfare-example-card.low .card-header {
    background-color: #064e3b !important; /* ?�크모드??진한 초록 */
    color: #ffffff !important;
}

body.dark-mode .welfare-example-card .base-fee {
    color: #9ca3af !important;
}

body.dark-mode .welfare-result-container .total-row {
    border-top-color: #4b5563 !important;
    color: #ffffff !important;
}

body.dark-mode .welfare-result-container .total-row span {
    color: #60a5fa !important;
}

/* ?�단 ?�개 문구 ?�크모드 */
body.dark-mode .intro-text, body.dark-mode .intro-text p, body.dark-mode .intro-text h2 {
    color: #ffffff !important;
}

body.dark-mode .intro-text > *:not(:first-child) {
    color: #e5e7eb !important;
}
/* 메인 ?�택 ?�면 버튼 ?�크모드 */
body.dark-mode .choice-button {
    background-color: #1f2937 !important;
    border-color: #1a73e8 !important;
    color: #60a5fa !important;
}

body.dark-mode .choice-button span {
    color: #d1d5db !important;
}

body.dark-mode .choice-button:hover {
    background-color: #1a73e8 !important;
    color: white !important;
}

/* ?�터??계산�??�소 ?�크모드 */
body.dark-mode .selection-fieldset {
    background-color: #1f2937 !important;
    border-color: #4b5563 !important;
}

body.dark-mode .selection-fieldset legend {
    color: #60a5fa !important;
    background-color: #1f2937 !important;
}

body.dark-mode .result-card {
    background-color: #1f2937 !important;
    border-color: #4b5563 !important;
    color: #ffffff !important;
}

body.dark-mode .result-card h4 {
    color: #60a5fa !important;
    border-bottom-color: #374151 !important;
}

body.dark-mode .result-card hr {
    border-top-color: #374151 !important;
}

body.dark-mode .result-subtitle {
    background-color: #1e293b !important;
    color: #60a5fa !important;
    border-color: #334155 !important;
}

/* ?�터??계산�??�용 ?�세 ?�소 ?�크모드 */
body.dark-mode .compact-summary-list li {
    border-bottom-color: #374151 !important;
}

body.dark-mode .compact-summary-list li span:first-child {
    color: #d1d5db !important;
}

body.dark-mode .compact-summary-list li span:last-child {
    color: #ffffff !important;
}

body.dark-mode .compact-summary-list li.discount span {
    color: #60a5fa !important;
}

body.dark-mode .compact-summary-total hr {
    border-top-color: #4b5563 !important;
}

body.dark-mode .compact-summary-total .summary-total {
    color: #60a5fa !important;
}

body.dark-mode .compact-summary-total .summary-total strong {
    color: #f87171 !important;
}

body.dark-mode .toggle-button {
    background-color: #374151 !important;
    color: #ffffff !important;
    border-color: #4b5563 !important;
}

body.dark-mode .toggle-button:hover {
    background-color: #4b5563 !important;
}

body.dark-mode .toggle-button.active {
    background-color: #1a73e8 !important;
    border-color: #1a73e8 !important;
}

body.dark-mode .result-table .plan-change-row {
    background-color: #422006 !important; /* ?�크모드???�두???�렌지/갈색 */
}

body.dark-mode .result-table .plan-change-row td {
    color: #fbbf24 !important; /* 밝�? ?��????�스??*/
}

body.dark-mode .fee-total {
    color: #60a5fa !important;
}

body.dark-mode .fee-note {
    color: #9ca3af !important;
}

body.dark-mode #proration-info {
    color: #e5e7eb !important;
}

/* ?�터??계산�??�겨�??�션(결합변�??�금?��?�? ?�크모드 ?�체 ?��? */
body.dark-mode #phone-plan-change-section-1, 
body.dark-mode #phone-plan-change-section-2,
body.dark-mode #internet-tv-plan-change-section-1,
body.dark-mode #internet-tv-plan-change-section-2 {
    background-color: #1f2937 !important;
    border: 1px solid #4b5563 !important;
    color: #e5e7eb !important;
}

body.dark-mode #phone-plan-change-section-1 .input-group,
body.dark-mode #phone-plan-change-section-2 .input-group,
body.dark-mode #internet-tv-plan-change-section-1 .input-group,
body.dark-mode #internet-tv-plan-change-section-2 .input-group {
    background-color: transparent !important;
}

/* [긴급 ?�정] ?�터??계산�??��? ?�정 ?�력 그룹 배경/?�두�?강제 ?�크모드 (?�확??ID ?�겟팅) */
body.dark-mode #phone-plan-change-options-1,
body.dark-mode #phone-plan-change-options-2,
body.dark-mode #plan-change-options-1,
body.dark-mode #plan-change-options-2 {
    background-color: #1f2937 !important; /* ?�라??배경????��?�기 */
    border: 1px solid #4b5563 !important;
    color: #e5e7eb !important;
}

/* ?��? ?�력 그룹 �??�벨 */
body.dark-mode #phone-plan-change-options-1 .input-group,
body.dark-mode #phone-plan-change-options-2 .input-group,
body.dark-mode #plan-change-options-1 .input-group,
body.dark-mode #plan-change-options-2 .input-group {
    background-color: transparent !important;
}

body.dark-mode #phone-plan-change-options-1 label,
body.dark-mode #phone-plan-change-options-2 label,
body.dark-mode #plan-change-options-1 label,
body.dark-mode #plan-change-options-2 label {
    color: #ffffff !important;
}

/* ?��???모든 div ?�소 배경 ?�명??(?�위 배경 ?�르?�록) */
body.dark-mode #phone-plan-change-options-1 div,
body.dark-mode #phone-plan-change-options-2 div,
body.dark-mode #plan-change-options-1 div,
body.dark-mode #plan-change-options-2 div {
    background-color: transparent !important;
    border-color: #4b5563 !important;
    color: #e5e7eb !important;
}

/* ?�력 ?�드 ?�두�?�?배경 ?�확??*/
body.dark-mode #phone-plan-change-section-1 select, 
body.dark-mode #phone-plan-change-section-2 select,
body.dark-mode #internet-tv-plan-change-section-1 input,
body.dark-mode #internet-tv-plan-change-section-2 input,
body.dark-mode #internet-tv-plan-change-section-1 select,
body.dark-mode #internet-tv-plan-change-section-2 select {
    background-color: #374151 !important; /* ?�력창�? 조금 ??밝�? ?�색?�로 구분 */
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
}

body.dark-mode .checkbox-align-group label {
    color: #ffffff !important;
}

/* ?�디??체크박스 그룹 ?��? ?�스??가?�성 ?�보 */
body.dark-mode .radio-button-group label,
body.dark-mode .checkbox-align-group label {
    color: #e5e7eb !important;
}

/* 모든 ?�력 ?�드/?�택 박스 ?�확??*/
body.dark-mode input[type="text"], 
body.dark-mode input[type="number"], 
body.dark-mode select {
    background-color: #1f2937 !important;
    color: #ffffff !important;
    border-color: #4b5563 !important;
}

/* ?�치�?비교 ?�션 카드 */
body.dark-mode .installation-fee-comparison .result-card {
    background-color: #1f2937 !important;
    border-color: #4b5563 !important;
}

/* 공통 ?�이�?�?기�? ?�소 */
body.dark-mode .monthly-table-wrapper {
    background-color: #1f2937 !important;
}

/* 간편 계산�??�크모드 */
body.dark-mode #simple-calculator-content h1, 
body.dark-mode #simple-calculator-content h2 {
    color: #ffffff !important;
}

body.dark-mode #simple-calculator-content .option-button {
    background-color: #374151 !important;
    color: #e5e7eb !important;
}

body.dark-mode #simple-calculator-content .option-button:hover {
    background-color: #4b5563 !important;
}

body.dark-mode #simple-calculator-content .option-button.selected {
    background-color: #3498db !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3) !important;
}

body.dark-mode #simple-calculator-modal .simple-results-table {
    border-color: #4b5563 !important;
}

body.dark-mode #simple-calculator-modal .simple-results-table thead {
    background-color: #334155 !important;
}

body.dark-mode #simple-calculator-modal .simple-results-table th, 
body.dark-mode #simple-calculator-modal .simple-results-table td {
    border-color: #4b5563 !important;
    color: #e5e7eb !important;
}

body.dark-mode #simple-calculator-modal .simple-results-table tbody tr:nth-child(even) {
    background-color: #111827 !important;
}

body.dark-mode #simple-calculator-modal .simple-results-table tbody tr:hover {
    background-color: #1e293b !important;
}

/* ?�금 ?�인 ?�인 모달 ?�크모드 */
body.dark-mode #discount-check-modal .modal-content h2 {
    color: #ffffff !important;
}

body.dark-mode .discount-tab-content h3 {
    color: #60a5fa !important;
    border-bottom-color: #374151 !important;
}

body.dark-mode .discount-tab-content p {
    color: #d1d5db !important;
}

body.dark-mode #discount-check-modal .result-table {
    border-color: #4b5563 !important;
}

body.dark-mode #discount-check-modal .result-table th {
    background-color: #334155 !important;
    color: #ffffff !important;
}

body.dark-mode #discount-check-modal .result-table td {
    color: #e5e7eb !important;
    border-color: #334155 !important;
    background-color: #1f2937 !important;
}

body.dark-mode #discount-check-modal .result-table th {
    background-color: #334155 !important;
    color: #ffffff !important;
}

body.dark-mode #discount-check-modal .result-table tr {
    background-color: transparent !important;
}

/* ?�금 ?�인 ?�인 모달 ??강조 ?�소 ?�크모드 */
body.dark-mode .discount-tab-content .info-box {
    background-color: #374151 !important;
    color: #ffffff !important;
    border-color: #4b5563 !important;
}

body.dark-mode .discount-tab-content div[style*="background: #f9f9f9"] {
    background-color: #1f2937 !important; /* ?��? ?�색 배경 박스�??�둡�?*/
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

body.dark-mode .discount-tab-content strong {
    color: #60a5fa !important; /* 중요 강조 문구???�늘?�으�?*/
}

body.dark-mode .discount-tab-content h3 {
    color: #ffffff !important;
    border-left: 4px solid #1a73e8 !important; /* ?��????�쪽 ?�인 강조 */
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    margin-bottom: 10px;
}

.date-input-group input {
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 12px 5px;
    font-size: 1.1em;
}

.date-input-group .year {
    flex: 2; /* ?�도?????�게 */
}

.date-input-group .month,
.date-input-group .day {
    flex: 1; /* ?? ?��? ?�일 비율 */
}

.date-input-group span {
    font-size: 1em;
    color: #888;
}

.container { background: #fff; padding: 30px; border-radius: 12px; max-width: 1100px; margin: auto; box-shadow: 0 6px 20px rgba(0,0,0,0.08); position: relative; }
h1, h2 { text-align: center; color: #1a73e8; }
.main-content { display: flex; gap: 30px; flex-wrap: wrap; }
.section { flex: 1; background: #fafafa; padding: 20px; border-radius: 8px; border: 1px solid #ddd; min-width: 300px; }
.section h3 { border-bottom: 2px solid #1a73e8; padding-bottom: 5px; }
.input-group { margin-bottom: 15px; }
.input-group label { display: block; font-weight: bold; margin-bottom: 5px; }
.input-group input, .input-group select { width: 100%; padding: 12px; border-radius: 4px; border: 1px solid #ccc; font-size: 1em; }
/* 요금제 검색 패널: '구분' 필터가 '연령대' 필터와 바로 붙어 보여 혼동을 주지 않도록 하단 경계선 추가 */
#plan-category-group { padding-bottom: 15px; margin-bottom: 20px; border-bottom: 1px solid var(--border-color, #e2e8f0); }
body.dark-mode #plan-category-group { border-bottom-color: #4b5563; }
.error-message { color: #d93025; text-align: center; margin: 15px 0; font-weight: bold; min-height: 20px; }
.calc-button { width: 100%; padding: 15px; font-size: 1.2em; background: #1a73e8; color: #fff; border: none; border-radius: 5px; margin-top: 20px; cursor: pointer;}
.calc-button:hover { background: #155ab6; }
.result-section { margin-top: 30px; padding: 20px; background: #e8f0fe; border-radius: 8px; }

/* 결과 영역 스르륵 등장 애니메이션 (PC 우측 슬라이드 애니메이션과 별개의 기본 동작)
   클래스 토글로 재시작하기 위해 .result-animate-in에서만 트리거 */
#result.result-section {
    transform-origin: top center;
}
#result.result-section.result-animate-in {
    animation: resultFadeSlideIn 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes resultFadeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(28px) scale(0.97);
        filter: blur(2px);
    }
    50% {
        opacity: 1;
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* 결과 내부 카드/표/요약은 약간의 지연 후 부드럽게 등장 — 스태거(stagger) 효과 강화 */
#result.result-section.result-animate-in #result-summary-section,
#result.result-section.result-animate-in #discount-breakdown,
#result.result-section.result-animate-in .monthly-detail-toggle-wrapper,
#result.result-section.result-animate-in .winner {
    animation: resultChildFadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.35s;
}

#result.result-section.result-animate-in .winner { animation-delay: 0.40s; }
#result.result-section.result-animate-in #result-summary-section { animation-delay: 0.55s; }
#result.result-section.result-animate-in #discount-breakdown { animation-delay: 0.72s; }
#result.result-section.result-animate-in .monthly-detail-toggle-wrapper { animation-delay: 0.88s; }

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

/* 사용자가 모션을 줄이기를 원하면 애니메이션 비활성화 */
@media (prefers-reduced-motion: reduce) {
    #result.result-section,
    #result.result-section.result-animate-in,
    #result.result-section.result-animate-in #result-summary-section,
    #result.result-section.result-animate-in #discount-breakdown,
    #result.result-section.result-animate-in .monthly-detail-toggle-wrapper,
    #result.result-section.result-animate-in .winner {
        animation: none !important;
    }
}
.info-box { font-size: 0.9em; color: #555; background-color: #f0f0f0; padding: 10px; border-radius: 4px; line-height: 1.5; margin-top: 5px; }
.info-box-red { font-size: 0.9em; color: #d93025; padding-top: 5px; text-align: center; }
.radio-button-group { display: flex; gap: 15px; align-items: center; padding: 5px 0; }
.radio-button-group label { font-weight: normal; }
