/**
 * Loan Refinance Calculator Styles
 * 대환대출 계산기 전용 스타일
 *
 * @package Zipper
 */

/* ===== 레이아웃 오버라이드 ===== */
.tool-section:has(.lrf-input-section) .tool-layout-split {
    grid-template-columns: 300px 1fr;
}

@media (max-width: 900px) {
    .tool-section:has(.lrf-input-section) .tool-layout-split {
        grid-template-columns: 1fr;
    }
}

/* ===== 입력 섹션 ===== */
.lrf-input-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.lrf-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
    box-sizing: border-box;
}

.lrf-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
}

.lrf-input-group input,
.lrf-input-group select {
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

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

.lrf-input-group input::placeholder {
    color: #a09a94;
}

.lrf-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* 금액 읽기 표시 */
.lrf-amount-display {
    font-size: 12px;
    color: #d4af37;
    font-weight: 500;
    margin-top: 4px;
    min-height: 18px;
}

/* ===== 빠른 선택 버튼 ===== */
.lrf-quick-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lrf-quick-btn {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #7a756d;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.lrf-quick-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

/* ===== 섹션 구분선 ===== */
.lrf-section-divider {
    border-top: 1px dashed #e8e4dc;
    padding-top: 14px;
    margin-top: 2px;
}

.lrf-section-label {
    font-size: 13px;
    font-weight: 700;
    color: #2d2a26;
    border-left: 4px solid #d4af37;
    padding-left: 10px;
    margin-bottom: 10px;
}

/* ===== 상환 방식 선택 ===== */
.lrf-repay-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lrf-repay-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.lrf-repay-option:hover {
    border-color: #d4af37;
    background: #fff;
}

.lrf-repay-option.active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
}

.lrf-repay-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
    cursor: pointer;
    flex-shrink: 0;
}

.lrf-repay-option > label {
    flex: 1;
    font-size: 13px;
    color: #2d2a26;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lrf-repay-option .repay-badge {
    font-size: 11px;
    font-weight: 600;
    color: #7a756d;
    background: rgba(122, 117, 109, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== 수수료 토글 ===== */
.lrf-fee-toggle {
    display: flex;
    align-items: center;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 3px;
}

.lrf-fee-toggle-btn {
    flex: 1;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #7a756d;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.lrf-fee-toggle-btn:hover {
    color: #2d2a26;
}

.lrf-fee-toggle-btn.active {
    background: #fff;
    color: #2d2a26;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ===== 계산 버튼 ===== */
.lrf-calc-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.lrf-calc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

.lrf-calc-btn:active {
    transform: translateY(0);
}

/* ===== 액션 버튼 ===== */
.lrf-action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    max-width: 100%;
}

.lrf-reset-btn,
.lrf-share-btn {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lrf-reset-btn {
    color: #7a756d;
    background: #fff;
    border: 1px solid #e8e4dc;
}

.lrf-reset-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.lrf-share-btn {
    color: #3498db;
    background: #fff;
    border: 1px solid #3498db;
}

.lrf-share-btn:hover {
    background: rgba(52, 152, 219, 0.08);
}

/* ===== 숨김 ===== */
.lrf-hidden {
    display: none !important;
}

/* ===== 대기 상태 ===== */
.lrf-waiting {
    text-align: center;
    padding: 40px 20px;
    color: #a09a94;
}

.lrf-waiting > i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    color: #d4af37;
}

.lrf-waiting > p {
    font-size: 14px;
    margin-bottom: 16px;
}

.lrf-waiting-guide {
    text-align: left;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 14px;
    max-width: 400px;
    margin: 0 auto;
}

.lrf-waiting-guide .guide-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lrf-waiting-guide .guide-title i {
    color: #d4af37;
}

.lrf-waiting-guide ul {
    margin: 0;
    padding-left: 18px;
}

.lrf-waiting-guide li {
    font-size: 12px;
    color: #5f5a56;
    margin-bottom: 4px;
    line-height: 1.5;
}

/* ===== 메인 결과: 절감 히어로 ===== */
.lrf-savings-hero {
    position: relative;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
}

.lrf-savings-label {
    font-size: 14px;
    color: #7a756d;
    margin-bottom: 8px;
}

.lrf-savings-value {
    font-size: 48px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
    margin-bottom: 4px;
}

.lrf-savings-value .unit {
    font-size: 22px;
    font-weight: 600;
    color: #b8860b;
    margin-left: 4px;
}

.lrf-savings-sub {
    font-size: 13px;
    color: #5f5a56;
    margin-top: 8px;
}

/* ===== 비교 섹션 ===== */
.lrf-compare-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

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

.lrf-section-title i {
    color: #d4af37;
}

.lrf-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lrf-compare-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.lrf-compare-card.current {
    border-color: #e0dcd5;
}

.lrf-compare-card.new {
    background: rgba(212, 175, 55, 0.04);
    border-color: rgba(212, 175, 55, 0.4);
}

.lrf-compare-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7a756d;
    margin-bottom: 12px;
}

.lrf-compare-card.new .lrf-compare-header {
    color: #d4af37;
}

.lrf-compare-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0ede8;
}

.lrf-compare-row:last-child {
    border-bottom: none;
}

.lrf-compare-row-label {
    font-size: 13px;
    color: #5f5a56;
}

.lrf-compare-row-value {
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
}

.lrf-compare-card.new .lrf-compare-row-value {
    color: #d4af37;
}

/* ===== 절감 상세 카드 ===== */
.lrf-savings-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.lrf-savings-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

.lrf-savings-card:hover {
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.12);
}

.lrf-savings-card-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lrf-savings-card-label i {
    color: #d4af37;
}

.lrf-savings-card-value {
    font-size: 24px;
    font-weight: 700;
    color: #2d2a26;
}

.lrf-savings-card-value .unit {
    font-size: 14px;
    font-weight: 500;
    color: #7a756d;
}

.lrf-savings-card.highlight {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0.02) 100%);
    border-color: rgba(46, 204, 113, 0.35);
}

.lrf-savings-card.highlight .lrf-savings-card-label {
    color: #27ae60;
}

.lrf-savings-card.highlight .lrf-savings-card-label i {
    color: #27ae60;
}

.lrf-savings-card.highlight .lrf-savings-card-value {
    color: #27ae60;
}

/* ===== 값 색상 (양/음) ===== */
.lrf-positive {
    color: #27ae60 !important;
}

.lrf-negative {
    color: #e74c3c !important;
}

.lrf-warning {
    color: #e67e22 !important;
}

/* ===== 손익분기 섹션 ===== */
.lrf-breakeven-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.lrf-breakeven-bar {
    height: 8px;
    background: #f0ede8;
    border-radius: 4px;
    position: relative;
    margin: 16px 0;
}

.lrf-breakeven-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #d4af37 0%, #b8860b 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.lrf-breakeven-marker {
    position: absolute;
    top: -6px;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #d4af37;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.3);
}

.lrf-breakeven-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.lrf-breakeven-item {
    text-align: center;
}

.lrf-breakeven-item-label {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 4px;
}

.lrf-breakeven-item-value {
    font-size: 18px;
    font-weight: 700;
    color: #2d2a26;
}

.lrf-breakeven-item-value .unit {
    font-size: 12px;
    font-weight: 500;
    color: #7a756d;
}

/* ===== 손익분기 메시지 ===== */
.lrf-breakeven-message {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    background: #faf9f7;
    margin-bottom: 12px;
}

.lrf-breakeven-message.lrf-positive {
    background: rgba(46, 204, 113, 0.08);
    color: #27ae60 !important;
}

.lrf-breakeven-message.lrf-negative {
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c !important;
}

.lrf-breakeven-message.lrf-warning {
    background: rgba(230, 126, 34, 0.08);
    color: #e67e22 !important;
}

/* ===== 수수료 표시 ===== */
.lrf-fee-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(231, 76, 60, 0.06);
    border-radius: 8px;
    margin-bottom: 12px;
}

.lrf-fee-label {
    font-size: 13px;
    font-weight: 600;
    color: #e74c3c;
}

.lrf-fee-value {
    font-size: 16px;
    font-weight: 700;
    color: #e74c3c;
}

/* ===== 안내문 ===== */
.lrf-notice {
    text-align: center;
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
}

.lrf-notice p {
    font-size: 12px;
    color: #a09a94;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lrf-notice i {
    color: #d4af37;
}

/* ===== 반응형 - 태블릿 ===== */
@media (max-width: 900px) {
    .tool-layout-input {
        max-width: 100%;
        overflow: hidden;
    }

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

    .lrf-savings-cards {
        grid-template-columns: 1fr;
    }

    .lrf-breakeven-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .lrf-compare-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 반응형 - 모바일 ===== */
@media (max-width: 768px) {
    .lrf-savings-hero {
        padding: 20px 16px;
    }

    .lrf-savings-value {
        font-size: 40px;
    }

    .lrf-savings-value .unit {
        font-size: 18px;
    }

    .lrf-savings-cards {
        grid-template-columns: 1fr;
    }

    .lrf-compare-card {
        padding: 14px;
    }

    .lrf-repay-option {
        padding: 10px;
        gap: 8px;
    }

    .lrf-repay-option > label {
        flex-wrap: wrap;
        gap: 4px;
    }

    .lrf-repay-option .repay-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .lrf-breakeven-item-value {
        font-size: 16px;
    }
}

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

    .lrf-input-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .lrf-savings-value {
        font-size: 34px;
    }

    .lrf-savings-value .unit {
        font-size: 16px;
    }

    .lrf-savings-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .lrf-savings-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 14px;
    }

    .lrf-savings-card-label {
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .lrf-savings-card-value {
        font-size: 22px;
    }

    .lrf-breakeven-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .lrf-compare-card {
        padding: 12px;
    }

    .lrf-compare-row-value {
        font-size: 14px;
    }

    .lrf-repay-option {
        padding: 8px 10px;
        gap: 6px;
    }

    .lrf-repay-option > label {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        font-size: 13px;
    }

    .lrf-repay-option .repay-badge {
        font-size: 10px;
    }
}
