/**
 * Year-End Tax Settlement Calculator Styles
 * 연말정산 환급금 계산기 전용 스타일
 *
 * @package Zipper
 */

/* ===== 2컬럼 레이아웃 (데스크탑) ===== */
.yetc-main-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    align-items: start;
}

.yetc-input-col {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.yetc-result-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== 공통 섹션 (접이식 카드) ===== */
.yetc-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.yetc-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.yetc-section-title i {
    color: #d4af37;
    font-size: 14px;
}

/* ===== Collapsible Header ===== */
.yetc-collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
    user-select: none;
    -webkit-user-select: none;
}

.yetc-collapsible-header .yetc-section-title {
    margin-bottom: 0;
}

.yetc-chevron {
    font-size: 12px;
    color: #9e9a96;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.yetc-collapsible-header.open .yetc-chevron {
    transform: rotate(180deg);
}

.yetc-collapsible-content {
    display: none;
}

.yetc-collapsible-header.open + .yetc-collapsible-content {
    display: block;
}

/* ===== 입력 그룹 ===== */
.yetc-input-group {
    margin-bottom: 12px;
    max-width: 100%;
    box-sizing: border-box;
}

.yetc-input-group:last-child {
    margin-bottom: 0;
}

.yetc-input-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #5f5a56;
    margin-bottom: 6px;
}

.yetc-input-label .yetc-label-hint {
    font-weight: 400;
    color: #9e9a96;
    margin-left: 4px;
}

.yetc-amount-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    text-align: right;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.yetc-amount-input:focus {
    outline: none;
    border-color: #d4af37;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.yetc-amount-input::placeholder {
    font-weight: 400;
    color: #c4c0bc;
}

.yetc-number-input {
    width: 70px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.yetc-number-input:focus {
    outline: none;
    border-color: #d4af37;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.yetc-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%235f5a56' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.yetc-select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.yetc-korean-amount {
    font-size: 11px;
    color: #d4af37;
    margin-top: 4px;
    text-align: right;
    min-height: 16px;
}

.yetc-hint {
    font-size: 11px;
    color: #9e9a96;
    margin-top: 4px;
}

/* ===== 체크박스 (pill style) ===== */
.yetc-checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.yetc-checkbox-row:last-child {
    margin-bottom: 0;
}

.yetc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: #5f5a56;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    cursor: pointer;
    transition: all 0.2s;
}

.yetc-checkbox-label:hover {
    border-color: #d4af37;
}

.yetc-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #d4af37;
    flex-shrink: 0;
}

.yetc-checkbox-label.active {
    border-color: #d4af37;
    background: #fdfbf5;
    color: #2d2a26;
    font-weight: 500;
}

/* ===== 라디오 버튼 ===== */
.yetc-radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.yetc-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: #5f5a56;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    cursor: pointer;
    transition: all 0.2s;
}

.yetc-radio-label:hover {
    border-color: #d4af37;
}

.yetc-radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #d4af37;
    flex-shrink: 0;
}

.yetc-radio-label.active {
    border-color: #d4af37;
    background: #fdfbf5;
    color: #2d2a26;
    font-weight: 500;
}

/* ===== 인라인 그룹 ===== */
.yetc-inline-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.yetc-inline-group .yetc-input-label {
    margin-bottom: 0;
    white-space: nowrap;
}

.yetc-inline-group .yetc-unit {
    font-size: 12px;
    color: #5f5a56;
    white-space: nowrap;
}

/* ===== 버튼 ===== */
.yetc-btn-group {
    display: flex;
    gap: 8px;
}

.yetc-calculate-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #d4af37, #c9a030);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.yetc-calculate-btn:hover {
    background: linear-gradient(135deg, #c9a030, #b8922a);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.yetc-reset-btn {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    background: #f5f3f0;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.yetc-reset-btn:hover {
    background: #eae7e3;
}

/* ===== 결과 - 대기 영역 ===== */
.yetc-waiting {
    text-align: center;
    padding: 40px 20px;
    color: #9e9a96;
}

.yetc-waiting i {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
    color: #d4af37;
    opacity: 0.4;
}

.yetc-waiting p {
    font-size: 13px;
    margin: 0;
}

/* ===== 결과 - 요약 카드 ===== */
.yetc-result-summary {
    background: #fdfbf5;
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 24px;
}

.yetc-summary-title {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 8px;
}

.yetc-summary-main {
    font-size: 32px;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 4px;
    line-height: 1.2;
}

.yetc-summary-main.yetc-refund {
    color: #4dabf7;
}

.yetc-summary-main.yetc-additional {
    color: #e74c3c;
}

.yetc-summary-label {
    font-size: 13px;
    color: #5f5a56;
    margin-bottom: 16px;
}

.yetc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid #e8e4dc;
    font-size: 13px;
}

.yetc-summary-row-label {
    color: #7a756d;
}

.yetc-summary-row-value {
    font-weight: 600;
    color: #2d2a26;
}

/* ===== 결과 - 상세 섹션 ===== */
.yetc-detail-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== 결과 - 계산 흐름 ===== */
.yetc-flow-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.yetc-flow-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.yetc-flow-title i {
    color: #d4af37;
}

.yetc-flow-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.yetc-flow-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.yetc-flow-step:nth-child(odd) {
    background: #faf9f7;
}

.yetc-flow-step-label {
    color: #5f5a56;
    display: flex;
    align-items: center;
    gap: 6px;
}

.yetc-flow-step-label .yetc-flow-op {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}

.yetc-flow-op-minus {
    background: #fff0f0;
    color: #e74c3c;
}

.yetc-flow-op-equals {
    background: #f0f7ff;
    color: #3498db;
}

.yetc-flow-op-multiply {
    background: #fdf5e6;
    color: #d4af37;
}

.yetc-flow-op-plus {
    background: #f0fff0;
    color: #27ae60;
}

.yetc-flow-step-value {
    font-weight: 600;
    color: #2d2a26;
    text-align: right;
}

.yetc-flow-step.yetc-flow-highlight {
    background: #fdfbf5;
    border: 1px solid #e8dfc0;
}

.yetc-flow-step.yetc-flow-highlight .yetc-flow-step-value {
    color: #d4af37;
    font-size: 15px;
}

/* ===== 결과 - 공제/세액 상세 테이블 ===== */
.yetc-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.yetc-detail-table th {
    padding: 8px 10px;
    background: #faf9f7;
    border-bottom: 1px solid #e8e4dc;
    font-weight: 600;
    color: #5f5a56;
    text-align: left;
}

.yetc-detail-table th:last-child {
    text-align: right;
}

.yetc-detail-table td {
    padding: 8px 10px;
    background: #fff;
    border-bottom: 1px solid #f0ede8;
    color: #2d2a26;
}

.yetc-detail-table td:last-child {
    text-align: right;
    font-weight: 600;
}

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

.yetc-detail-table .yetc-table-total {
    background: #fdfbf5;
    font-weight: 600;
}

.yetc-detail-table .yetc-table-total td {
    border-top: 2px solid #e8e4dc;
    color: #d4af37;
}

/* ===== 결과 - 세율 구간 시각화 ===== */
.yetc-bracket-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.yetc-bracket-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.yetc-bracket-title i {
    color: #d4af37;
}

.yetc-bracket-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.yetc-bracket-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.yetc-bracket-rate {
    width: 36px;
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
    text-align: right;
    flex-shrink: 0;
}

.yetc-bracket-bar-wrap {
    flex: 1;
    height: 24px;
    background: #f5f3f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.yetc-bracket-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 0;
}

.yetc-bracket-range {
    font-size: 10px;
    color: #9e9a96;
    width: 90px;
    flex-shrink: 0;
    text-align: right;
}

.yetc-bracket-row.yetc-bracket-active .yetc-bracket-rate {
    color: #d4af37;
    font-weight: 700;
}

.yetc-bracket-row.yetc-bracket-active .yetc-bracket-fill {
    position: relative;
}

.yetc-bracket-row.yetc-bracket-active .yetc-bracket-fill::after {
    content: '\25C0 \B0B4 \AD6C\AC04';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.yetc-bracket-colors-6  { background: #e8f5e9; }
.yetc-bracket-colors-15 { background: #c8e6c9; }
.yetc-bracket-colors-24 { background: #fff9c4; }
.yetc-bracket-colors-35 { background: #ffe0b2; }
.yetc-bracket-colors-38 { background: #ffccbc; }
.yetc-bracket-colors-40 { background: #ffab91; }
.yetc-bracket-colors-42 { background: #ef9a9a; }
.yetc-bracket-colors-45 { background: #e57373; }

.yetc-effective-rate {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fdfbf5;
    border: 1px solid #e8dfc0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.yetc-effective-rate-label {
    color: #5f5a56;
}

.yetc-effective-rate-value {
    font-weight: 700;
    color: #d4af37;
    font-size: 16px;
}

/* ===== 면책 조항 ===== */
.yetc-disclaimer {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    font-size: 11px;
    color: #9e9a96;
    line-height: 1.5;
}

.yetc-disclaimer i {
    color: #d4af37;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ===== 유틸리티 ===== */
.yetc-hidden {
    display: none !important;
}

/* ===== 반응형 (900px) ===== */
@media (max-width: 900px) {
    .yetc-main-layout {
        grid-template-columns: 1fr;
    }

    .yetc-input-col {
        position: static;
        width: 100%;
    }

    .yetc-result-col {
        width: 100%;
    }

    .tool-layout-input {
        max-width: 100%;
        overflow: hidden;
    }

    .yetc-input-group input:not([type="radio"]):not([type="checkbox"]),
    .yetc-input-group select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .yetc-bracket-range {
        width: 70px;
        font-size: 9px;
    }

    .yetc-summary-main {
        font-size: 26px;
    }

    .yetc-detail-table {
        font-size: 11px;
    }

    .yetc-detail-table th,
    .yetc-detail-table td {
        padding: 6px 6px;
    }
}

/* ===== 반응형 (480px) ===== */
@media (max-width: 480px) {
    .tool-section,
    .tool-layout-split,
    .tool-layout-input,
    .tool-layout-result {
        max-width: 100%;
        overflow-x: hidden;
    }

    .yetc-section {
        padding: 12px;
    }

    .yetc-result-summary {
        padding: 16px;
    }

    .yetc-summary-main {
        font-size: 22px;
    }

    .yetc-bracket-row {
        gap: 4px;
    }

    .yetc-bracket-range {
        display: none;
    }

    .yetc-checkbox-row {
        flex-direction: column;
    }

    .yetc-inline-group {
        flex-wrap: wrap;
    }

    .yetc-number-input {
        width: 60px;
    }

    .yetc-flow-step {
        padding: 8px 8px;
        font-size: 12px;
    }

    .yetc-flow-step.yetc-flow-highlight .yetc-flow-step-value {
        font-size: 14px;
    }
}
