/**
 * Rental Income Tax Calculator Styles
 * 임대소득세 계산기 전용 스타일
 *
 * @package Zipper
 */

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

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

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

/* ===== 공통 섹션 ===== */
.rit-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease;
}

.rit-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

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

.rit-section-title i {
    color: #d4af37;
    font-size: 15px;
}

/* ===== 탭 ===== */
.rit-tabs {
    display: flex;
    gap: 4px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 3px;
}

.rit-tab {
    flex: 1;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9e9a96;
    cursor: pointer;
    transition: all 0.2s;
}

.rit-tab:hover {
    color: #5f5a56;
}

.rit-tab.active {
    background: #fff;
    color: #d4af37;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.15);
}

/* ===== 탭 콘텐츠 ===== */
.rit-panel {
    display: none;
}

.rit-panel.active {
    display: block;
}

/* 탭 래퍼 내부 간격 */
.rit-panel .rit-section + .rit-section {
    margin-top: 14px;
}

.rit-panel .rit-btn-group {
    margin-top: 14px;
}

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

.rit-form-group:last-child {
    margin-bottom: 0;
}

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

.rit-sub-label {
    font-weight: 400;
    color: #9e9a96;
    margin-left: 4px;
}

.rit-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;
}

.rit-amount-input:hover {
    border-color: #d4c67a;
}

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

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

.rit-number-input {
    width: 80px;
    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;
}

.rit-number-input:hover {
    border-color: #d4c67a;
}

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

.rit-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;
}

.rit-select:hover {
    border-color: #d4c67a;
}

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

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

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

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

.rit-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;
}

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

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

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

.rit-radio-desc {
    font-size: 11px;
    color: #9e9a96;
    margin-left: auto;
}

/* ===== 체크박스 ===== */
.rit-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;
}

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

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

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

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

.rit-btn-calc {
    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);
}

.rit-btn-calc:hover {
    background: linear-gradient(135deg, #c9a030, #b8922a);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.rit-btn-reset {
    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;
}

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

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

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

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

/* ===== 결과 - 요약 카드 ===== */
.rit-summary-card {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.12);
}

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

.rit-summary-main {
    font-size: 32px;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 4px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

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

.rit-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

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

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

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

/* ===== 결과 - 등록 vs 미등록 비교 카드 ===== */
.rit-compare-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.rit-compare-header {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rit-compare-header i {
    color: #d4af37;
}

.rit-compare-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.rit-compare-col {
    padding: 14px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #faf9f7;
}

.rit-compare-col.registered {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.rit-compare-col.unregistered {
    background: #f5f3f0;
    border-color: #d4d0cc;
}

.rit-compare-col h4 {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rit-compare-col.registered h4 {
    color: #16a34a;
}

.rit-compare-col .rit-amount {
    font-size: 20px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 8px;
}

.rit-compare-col.registered .rit-amount {
    color: #16a34a;
}

.rit-compare-col .rit-detail {
    font-size: 12px;
    color: #7a756d;
    line-height: 1.4;
}

.rit-compare-highlight {
    padding: 10px 12px;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 8px;
    margin-top: 12px;
    text-align: center;
}

.rit-compare-highlight .rit-label {
    font-size: 11px;
    color: #e65100;
    margin-bottom: 4px;
}

.rit-compare-highlight .rit-value {
    font-size: 18px;
    font-weight: 700;
    color: #f57c00;
}

/* ===== 결과 - 분리과세 vs 종합과세 비교 (탭2) ===== */
.rit-vs-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.rit-vs-header {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rit-vs-header i {
    color: #d4af37;
}

.rit-vs-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.rit-vs-col {
    padding: 14px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #faf9f7;
}

.rit-vs-col.separate {
    background: #faf9f7;
    border-color: #d4d0cc;
}

.rit-vs-col.comprehensive {
    background: #faf9f7;
    border-color: #d4d0cc;
}

.rit-vs-col h4 {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    margin: 0 0 10px 0;
}

.rit-vs-col .rit-amount {
    font-size: 20px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 8px;
}

.rit-vs-col .rit-detail {
    font-size: 12px;
    color: #7a756d;
    line-height: 1.4;
}

.rit-vs-recommend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #d4af37;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    margin-left: 6px;
}

.rit-vs-recommend i {
    font-size: 10px;
}

/* 추천 항목 강조 */
.rit-vs-col.recommended {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    border-color: #d4af37;
    border-width: 2px;
}

.rit-vs-col.recommended .rit-amount {
    color: #d4af37;
}

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

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

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

.rit-flow-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

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

.rit-flow-table th:last-child {
    text-align: right;
}

.rit-flow-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0ede8;
    color: #2d2a26;
}

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

.rit-flow-table tbody tr:hover td {
    background: #faf9f7;
}

.rit-flow-table tr:last-child td {
    border-bottom: none;
}

.rit-flow-table .rit-highlight-row {
    background: #fdfbf5;
    border: 1px solid #e8dfc0;
}

.rit-flow-table .rit-highlight-row td {
    color: #d4af37;
    font-weight: 700;
    font-size: 14px;
}

.rit-flow-table .rit-separator-row td {
    padding: 4px 0;
    border-bottom: 1px solid #e8e4dc;
}

/* ===== 간주임대료 결과 ===== */
.rit-imputed-result {
    padding: 12px 14px;
    background: #fdfbf5;
    border: 1px solid #e8dfc0;
    border-radius: 8px;
    margin-top: 12px;
}

.rit-imputed-result h5 {
    font-size: 12px;
    font-weight: 600;
    color: #7a756d;
    margin: 0 0 8px 0;
}

.rit-imputed-result .rit-amount {
    font-size: 16px;
    font-weight: 700;
    color: #d4af37;
}

/* ===== 결과 - 도넛 차트 ===== */
.rit-chart-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.rit-chart-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rit-chart-title i {
    color: #d4af37;
}

.rit-donut-wrap {
    position: relative;
    width: 100%;
    max-width: 220px;
    height: 220px;
    margin: 0 auto;
}

/* ===== 세율 구간 바 차트 ===== */
.rit-bar-chart-wrap {
    margin-top: 16px;
}

.rit-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.rit-bar-label {
    min-width: 100px;
    font-size: 12px;
    color: #5f5a56;
}

.rit-bar-fill {
    position: relative;
    height: 24px;
    background: #e8e4dc;
    border-radius: 4px;
    flex: 1;
    overflow: hidden;
}

.rit-bar-fill .rit-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #c9a030);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rit-bar-fill.rit-bar-active {
    background: #fff3e0;
    border: 1px solid #ffb74d;
}

.rit-bar-fill.rit-bar-active .rit-bar-inner {
    background: linear-gradient(90deg, #f57c00, #e65100);
}

.rit-bar-range {
    font-size: 11px;
    color: #9e9a96;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rit-bar-marker {
    position: absolute;
    top: -8px;
    width: 3px;
    height: 40px;
    background: #e74c3c;
    border-radius: 2px;
    z-index: 1;
}

.rit-bar-marker::after {
    content: '현재';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: #e74c3c;
    white-space: nowrap;
}

/* ===== 경고 박스 (건강보험 경고) ===== */
.rit-warning-box {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 8px;
    margin-top: 12px;
}

.rit-warning-box i {
    font-size: 16px;
    color: #e67e22;
    flex-shrink: 0;
    margin-top: 1px;
}

.rit-warning-box span {
    font-size: 12px;
    color: #e65100;
    line-height: 1.5;
    font-weight: 500;
}

/* ===== 정보 박스 (안내) ===== */
.rit-info-box {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 12px 14px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    margin-top: 12px;
}

.rit-info-box i {
    font-size: 16px;
    color: #3498db;
    flex-shrink: 0;
    margin-top: 1px;
}

.rit-info-box span {
    font-size: 12px;
    color: #0d47a1;
    line-height: 1.5;
}

/* ===== 절세 팁 섹션 ===== */
.rit-tips-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.rit-tips-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rit-tips-title i {
    color: #d4af37;
}

.rit-tips-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rit-tip-item {
    display: flex;
    align-items: start;
    gap: 8px;
    padding: 10px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    font-size: 12px;
    color: #5f5a56;
    line-height: 1.5;
}

.rit-tip-item i {
    font-size: 14px;
    color: #d4af37;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ===== 면책 조항 ===== */
.rit-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;
}

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

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

/* ===== 인쇄 스타일 ===== */
@media print {
    .rit-input-col {
        display: none;
    }

    .rit-main-layout {
        grid-template-columns: 1fr;
    }

    .rit-section,
    .rit-summary-card,
    .rit-compare-card,
    .rit-vs-card,
    .rit-flow-section,
    .rit-chart-section,
    .rit-tips-section {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* ===== 모션 감소 접근성 ===== */
@media (prefers-reduced-motion: reduce) {
    .rit-section,
    .rit-amount-input,
    .rit-select,
    .rit-btn-calc,
    .rit-tab,
    .rit-bar-fill .rit-bar-inner {
        transition: none !important;
    }
    .rit-section:hover,
    .rit-btn-calc:hover {
        transform: none !important;
    }
}

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

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

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

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

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

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

    .rit-compare-body,
    .rit-vs-body {
        grid-template-columns: 1fr;
    }

    .rit-summary-grid {
        grid-template-columns: 1fr;
    }

    .rit-flow-table {
        font-size: 12px;
    }

    .rit-flow-table th,
    .rit-flow-table td {
        padding: 8px 8px;
    }
}

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

    .rit-section {
        padding: 12px;
    }

    .rit-summary-card,
    .rit-compare-card,
    .rit-vs-card {
        padding: 16px;
    }

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

    .rit-tabs {
        flex-direction: column;
    }

    .rit-tab {
        padding: 8px 6px;
        font-size: 12px;
    }

    .rit-donut-wrap {
        max-width: 200px;
        height: 200px;
    }

    .rit-flow-table {
        font-size: 11px;
    }

    .rit-flow-table th,
    .rit-flow-table td {
        padding: 6px 6px;
    }

    .rit-bar-label {
        min-width: 80px;
        font-size: 11px;
    }

    .rit-bar-fill {
        height: 20px;
    }
}
