/**
 * Real Estate Brokerage Fee Calculator Styles
 * 부동산 중개수수료 계산기 전용 스타일
 *
 * @package Zipper
 */

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

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

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

/* ===== 공통 섹션 ===== */
.rbc-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;
}

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

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

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

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

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

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

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

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

.rbc-tab-panel.active {
    display: block;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ===== 환산보증금 표시 ===== */
.rbc-converted-deposit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    background: #fdfbf5;
    border: 1px solid #e8dfc0;
    border-radius: 8px;
    font-size: 12px;
}

.rbc-converted-label {
    color: #7a756d;
    font-weight: 500;
}

.rbc-converted-value {
    color: #d4af37;
    font-weight: 700;
}

/* ===== 당사자 힌트 ===== */
.rbc-party-hint {
    font-size: 11px;
    color: #9e9a96;
    margin-top: 10px;
    text-align: center;
}

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

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

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

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

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

/* ===== 범위 슬라이더 (협의 요율) ===== */
.rbc-range-wrap {
    margin-top: 8px;
}

.rbc-range-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #5f5a56;
    margin-bottom: 8px;
}

.rbc-range-value {
    font-size: 14px;
    font-weight: 700;
    color: #d4af37;
}

.rbc-range-input {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e8e4dc;
    border-radius: 3px;
    outline: none;
    margin-bottom: 6px;
}

.rbc-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #d4af37;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.rbc-range-input::-webkit-slider-thumb:hover {
    background: #c9a030;
    transform: scale(1.1);
}

.rbc-range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #d4af37;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.rbc-range-input::-moz-range-thumb:hover {
    background: #c9a030;
    transform: scale(1.1);
}

.rbc-range-hint {
    font-size: 10px;
    color: #9e9a96;
    text-align: center;
}

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

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

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

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

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

.rbc-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);
}

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

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

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

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

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

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

/* ===== 결과 - 요약 카드 ===== */
.rbc-result-summary {
    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);
}

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

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

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

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

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

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

/* ===== 결과 - 매도인/매수인 각각 표시 (Dual Party) ===== */
.rbc-party-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

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

.rbc-party-title i {
    color: #d4af37;
}

.rbc-party-cards {
    display: flex;
    gap: 12px;
}

.rbc-party-card {
    flex: 1;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s;
}

.rbc-party-card:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.08);
}

.rbc-party-card-label {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.rbc-party-card-label i {
    color: #d4af37;
}

.rbc-party-card-value {
    font-size: 24px;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 8px;
    line-height: 1.2;
}

.rbc-party-card-desc {
    font-size: 11px;
    color: #9e9a96;
    line-height: 1.4;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ===== 결과 - 요율 구간표 ===== */
.rbc-rate-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

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

.rbc-rate-title i {
    color: #d4af37;
}

.rbc-rate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

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

.rbc-rate-table th:last-child {
    text-align: center;
}

.rbc-rate-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0ede8;
    color: #2d2a26;
}

.rbc-rate-table td:last-child {
    text-align: center;
    font-weight: 600;
    color: #d4af37;
}

.rbc-rate-table tbody tr:hover td {
    background: #faf9f7;
}

.rbc-rate-table tr:last-child td {
    border-bottom: none;
}

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

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

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

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

.rbc-chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.rbc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #5f5a56;
}

.rbc-legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== 절감액 강조 ===== */
.rbc-saving-highlight {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: #e8f5e9;
    border: 1px solid #81c784;
    border-radius: 8px;
    margin-top: 12px;
}

.rbc-saving-highlight i {
    color: #27ae60;
    font-size: 16px;
}

.rbc-saving-highlight span {
    font-size: 13px;
    color: #1b5e20;
    font-weight: 600;
}

/* ===== 정보 박스 (환산보증금 설명 등) ===== */
.rbc-info-box {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 12px 14px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    margin-top: 12px;
}

.rbc-info-box i {
    font-size: 16px;
    color: #1976d2;
    flex-shrink: 0;
    margin-top: 1px;
}

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

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

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

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

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

.rbc-tips-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;
}

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

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

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

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

/* ===== 모션 감소 접근성 ===== */
@media (prefers-reduced-motion: reduce) {
    .rbc-section,
    .rbc-amount-input,
    .rbc-select,
    .rbc-calculate-btn,
    .rbc-tab,
    .rbc-party-card,
    .rbc-range-input::-webkit-slider-thumb,
    .rbc-range-input::-moz-range-thumb {
        transition: none !important;
    }
    .rbc-section:hover,
    .rbc-calculate-btn:hover,
    .rbc-range-input::-webkit-slider-thumb:hover,
    .rbc-range-input::-moz-range-thumb:hover {
        transform: none !important;
    }
}

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

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

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

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

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

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

    .rbc-party-cards {
        flex-direction: column;
    }

    .rbc-party-card-value {
        font-size: 20px;
    }

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

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

    .rbc-rate-table {
        font-size: 11px;
    }

    .rbc-rate-table th,
    .rbc-rate-table td {
        padding: 6px 8px;
    }
}

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

    .rbc-section {
        padding: 12px;
    }

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

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

    .rbc-party-card-value {
        font-size: 18px;
    }

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

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

    .rbc-donut-wrap {
        max-width: 180px;
        height: 180px;
    }

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

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

    .rbc-rate-table {
        font-size: 10px;
    }

    .rbc-rate-table th,
    .rbc-rate-table td {
        padding: 6px 4px;
    }
}
