/**
 * Retirement Fund Calculator Styles
 * 노후자금 필요금액 계산기 전용 스타일
 *
 * @package Zipper
 */

/* ===== 2컬럼 자체 그리드 레이아웃 (Rule 38) ===== */
.rfc-main-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

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

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

/* ===== rfcResultSection 내부 gap 보정 ===== */
#rfcResultSection {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

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

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

/* ===== Hidden ===== */
.rfc-hidden {
    display: none !important;
}

/* ===== 입력 영역 ===== */
.rfc-input-section {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.rfc-input-group {
    margin-bottom: 12px;
    max-width: 100%;
    box-sizing: border-box;
}

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

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

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

/* ===== 입력 행 (2열) ===== */
.rfc-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rfc-input-row .rfc-input-group {
    margin-bottom: 0;
}

/* ===== 금액 입력 ===== */
.rfc-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;
}

.rfc-amount-input:hover,
.rfc-number-input:hover {
    border-color: #d4c67a;
}

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

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

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

/* ===== Number 입력 ===== */
.rfc-number-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    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;
}

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

.rfc-number-input::placeholder {
    font-weight: 400;
    color: #c4c0bc;
}

/* ===== 단위 포함 입력 ===== */
.rfc-input-with-unit {
    position: relative;
}

.rfc-input-with-unit input {
    padding-right: 36px;
}

.rfc-input-unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 500;
    color: #9e9a96;
    pointer-events: none;
}

/* ===== Select ===== */
.rfc-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;
}

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

/* ===== 힌트 ===== */
.rfc-hint {
    font-size: 11px;
    color: #9e9a96;
    margin-top: 4px;
}

/* ===== 버튼 그룹 ===== */
.rfc-btn-group {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.rfc-btn-primary {
    flex: 1;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #d4af37;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.rfc-btn-primary:hover {
    background: #c9a030;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

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

.rfc-btn-secondary:hover {
    background: #eae7e3;
    border-color: #d4af37;
    color: #2d2a26;
}

/* ===== 대기 섹션 ===== */
.rfc-waiting {
    text-align: center;
    padding: 40px 20px;
    color: #9e9a96;
}

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

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

/* ===== 요약 카드 ===== */
.rfc-summary-card {
    background: #fdfbf5;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
}

.rfc-summary-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.rfc-summary-main-label {
    font-size: 13px;
    color: #5f5a56;
}

.rfc-summary-main-value {
    font-size: 28px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1.2;
}

.rfc-summary-korean {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 16px;
    text-align: right;
}

.rfc-summary-sub {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid #e8e4dc;
}

.rfc-summary-sub-item {
    text-align: center;
}

.rfc-summary-sub-label {
    font-size: 11px;
    color: #7a756d;
    margin-bottom: 4px;
}

.rfc-summary-sub-value {
    font-size: 16px;
    font-weight: 600;
    color: #2d2a26;
}

.rfc-summary-sub-korean {
    font-size: 11px;
    color: #9e9a96;
    margin-top: 2px;
}

/* ===== 차트 섹션 ===== */
.rfc-chart-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.rfc-chart-container {
    position: relative;
    width: 100%;
    max-height: 280px;
}

.rfc-chart-container canvas {
    max-height: 280px;
}

/* ===== 시나리오 비교 ===== */
.rfc-scenario-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.rfc-scenario-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 14px;
    transition: all 0.2s;
}

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

.rfc-scenario-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    border-radius: 10px;
    padding: 2px 8px;
    margin-bottom: 8px;
}

.rfc-scenario-tag.min {
    background: #e8f5e9;
    color: #2e7d32;
}

.rfc-scenario-tag.mid {
    background: #fff3e0;
    color: #ef6c00;
}

.rfc-scenario-tag.max {
    background: #e3f2fd;
    color: #1565c0;
}

.rfc-scenario-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 8px;
}

.rfc-scenario-amount {
    font-size: 11px;
    color: #7a756d;
    margin-bottom: 2px;
}

.rfc-scenario-value {
    font-size: 18px;
    font-weight: 700;
    color: #2d2a26;
    line-height: 1.2;
}

.rfc-scenario-korean {
    font-size: 11px;
    color: #9e9a96;
    margin-top: 2px;
    margin-bottom: 6px;
}

.rfc-scenario-sub {
    font-size: 11px;
    color: #7a756d;
    padding-top: 6px;
    border-top: 1px solid #f0ede8;
}

/* ===== 적립 계획 ===== */
.rfc-savings-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.rfc-savings-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.rfc-savings-card {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    transition: all 0.2s;
}

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

.rfc-savings-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 4px;
}

.rfc-savings-rate {
    font-size: 11px;
    color: #7a756d;
    margin-bottom: 8px;
}

.rfc-savings-value {
    font-size: 16px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1.2;
}

.rfc-savings-korean {
    font-size: 11px;
    color: #9e9a96;
    margin-top: 2px;
}

/* ===== 스케줄 테이블 ===== */
.rfc-schedule-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.rfc-schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rfc-schedule-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rfc-schedule-title i {
    color: #d4af37;
}

.rfc-excel-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #27ae60;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.rfc-excel-btn:hover {
    background: #219a54;
}

.rfc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.rfc-schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.rfc-schedule-table th {
    background: #f5f3f0;
    font-size: 11px;
    font-weight: 600;
    color: #5f5a56;
    padding: 8px 10px;
    border-bottom: 2px solid #e8e4dc;
    white-space: nowrap;
    text-align: right;
}

.rfc-schedule-table th:first-child {
    text-align: center;
}

.rfc-schedule-table td {
    font-size: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid #f0ede8;
    text-align: right;
    color: #2d2a26;
}

.rfc-schedule-table td:first-child {
    text-align: center;
    font-weight: 600;
    color: #5f5a56;
}

.rfc-schedule-table tr:hover td {
    background: #fdfbf5;
}

.rfc-negative {
    color: #e74c3c;
}

/* ===== 면책 조항 ===== */
.rfc-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;
    margin-top: 16px;
}

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

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

    .rfc-input-col {
        position: static;
    }

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

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

/* ===== 반응형 (480px 이하) ===== */
@media (max-width: 480px) {
    .rfc-main-layout,
    .rfc-input-col,
    .rfc-result-col {
        max-width: 100%;
        overflow-x: hidden;
    }

    .rfc-input-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .rfc-summary-sub {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .rfc-scenario-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

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

    .rfc-btn-group {
        flex-direction: column;
    }

    .rfc-section {
        padding: 12px;
    }

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

    .rfc-schedule-table th,
    .rfc-schedule-table td {
        padding: 6px 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rfc-section,
    .rfc-amount-input,
    .rfc-number-input,
    .rfc-btn-primary,
    .rfc-btn-secondary,
    .rfc-scenario-card,
    .rfc-savings-card {
        transition: none !important;
    }
    .rfc-section:hover,
    .rfc-btn-primary:hover {
        transform: none !important;
    }
}

/* Excel button guard */
.tool-btn-excel {
  background: #59ab79;
  border-color: #59ab79;
}

.tool-btn-excel:hover,
.tool-btn-excel:focus-visible {
  background: #4f9f70;
  border-color: #4f9f70;
}

