/**
 * National Pension Calculator Styles
 * 국민연금 수령액 계산기 전용 스타일
 *
 * @package Zipper
 */

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

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

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

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

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

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

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

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

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

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

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

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

.npc-sub-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #7a756d;
    margin-bottom: 6px;
}

.npc-helper-text {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.55;
    color: #8e877f;
}

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

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

.npc-period-row {
    align-items: end;
}

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

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

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

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

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

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

/* ===== Number 입력 ===== */
.npc-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;
}

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

/* ===== 고급 설정 토글 ===== */
.npc-advanced-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.npc-advanced-toggle:hover {
    border-color: #d4af37;
    color: #2d2a26;
}

.npc-toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.npc-advanced-toggle.active .npc-toggle-icon {
    transform: rotate(180deg);
}

.npc-advanced-panel {
    display: none;
    padding-top: 12px;
}

.npc-advanced-panel.active {
    display: block;
}

/* ===== 버튼 그룹 ===== */
.npc-btn-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.npc-calculate-btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    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);
}

.npc-calculate-btn:hover {
    background: linear-gradient(135deg, #e0c060, #d4af37);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.npc-reset-btn {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #7a756d;
    background: transparent;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.npc-reset-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

/* ===== 대기 섹션 ===== */
.npc-waiting {
    text-align: center;
    padding: 40px 20px;
}

.npc-waiting-icon {
    font-size: 48px;
    color: #e8e4dc;
    margin-bottom: 16px;
}

.npc-waiting-text {
    font-size: 14px;
    color: #a09a94;
}

/* ===== 직접 비교 핵심 결과 ===== */
.npc-decision-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.npc-decision-hero {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.14) 0%, rgba(255, 255, 255, 0.96) 48%, rgba(39, 174, 96, 0.06) 100%);
    border: 1px solid rgba(212, 175, 55, 0.22);
}

.npc-decision-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #b8860b;
    text-transform: uppercase;
}

.npc-decision-age-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #5f5a56;
}

.npc-decision-age-row strong {
    font-size: 20px;
    color: #2d2a26;
}

.npc-decision-divider {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.22);
}

.npc-decision-summary {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
    color: #2d2a26;
}

.npc-decision-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.npc-decision-metric {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(232, 228, 220, 0.95);
}

.npc-decision-metric span {
    font-size: 11px;
    font-weight: 600;
    color: #7a756d;
}

.npc-decision-metric strong {
    font-size: 18px;
    line-height: 1.3;
    color: #2d2a26;
}

/* ===== 3-Way 비교 카드 ===== */
.npc-comparison-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
}

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

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

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

/* 정상수령 카드 강조 */
.npc-card-normal {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.05) 100%);
    border-color: rgba(212, 175, 55, 0.35);
    transform: scale(1.03);
}

.npc-card-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.npc-card-early .npc-card-badge {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.npc-card-normal .npc-card-badge {
    background: rgba(212, 175, 55, 0.15);
    color: #b8860b;
}

.npc-card-deferred .npc-card-badge {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.npc-card-age {
    font-size: 13px;
    color: #7a756d;
    margin-bottom: 8px;
}

.npc-card-age strong {
    font-size: 18px;
    font-weight: 700;
    color: #2d2a26;
}

.npc-card-amount {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 4px;
}

.npc-card-amount strong {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #2d2a26;
    margin-top: 2px;
}

.npc-card-rate {
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
}

.npc-card-early .npc-card-rate {
    color: #e74c3c;
}

.npc-card-normal .npc-card-rate {
    color: #b8860b;
}

.npc-card-deferred .npc-card-rate {
    color: #27ae60;
}

/* ===== 상세 정보 카드 (2x2 grid) ===== */
.npc-detail-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.npc-detail-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

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

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

.npc-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.npc-detail-label i {
    color: #d4af37;
}

.npc-detail-value {
    font-size: 22px;
    font-weight: 700;
    color: #2d2a26;
}

.npc-detail-value .npc-unit {
    font-size: 13px;
    font-weight: 500;
    color: #7a756d;
}

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

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

.npc-chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

.npc-chart-container canvas {
    max-height: 300px;
}

.npc-breakeven-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
    font-size: 13px;
    color: #5f5a56;
}

.npc-breakeven-info strong {
    color: #2d2a26;
    font-weight: 700;
}

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

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

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

.npc-download-btn:hover {
    background: #1a5c38;
}

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

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

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

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

.npc-schedule-table th:last-child {
    text-align: center;
}

.npc-schedule-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0ece6;
    text-align: right;
    color: #2d2a26;
}

.npc-schedule-table td:first-child {
    text-align: center;
    font-weight: 600;
}

.npc-schedule-table td:last-child {
    text-align: center;
}

.npc-schedule-table tr:hover {
    background: #faf9f7;
}

.npc-best-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.npc-best-early {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.npc-best-normal {
    background: rgba(212, 175, 55, 0.15);
    color: #b8860b;
}

.npc-best-deferred {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

/* ===== 납부 대비 수익률 (ROI) ===== */
.npc-roi-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
}

.npc-roi-cards {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
}

.npc-roi-card {
    text-align: center;
    padding: 16px;
    background: #faf9f7;
    border-radius: 12px;
}

.npc-roi-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 6px;
}

.npc-roi-value {
    font-size: 22px;
    font-weight: 700;
    color: #2d2a26;
}

.npc-roi-sub {
    font-size: 11px;
    color: #a09a94;
    margin-top: 4px;
}

.npc-roi-arrow {
    font-size: 24px;
    color: #d4af37;
}

.npc-roi-highlight {
    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);
}

.npc-roi-highlight .npc-roi-value {
    color: #d4af37;
}

.npc-roi-result {
    margin-top: 12px;
    text-align: center;
    padding: 14px;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.08) 0%, rgba(39, 174, 96, 0.02) 100%);
    border: 1px solid rgba(39, 174, 96, 0.25);
    border-radius: 12px;
}

.npc-roi-result .npc-roi-label {
    color: #27ae60;
}

.npc-roi-percent {
    font-size: 28px;
    font-weight: 700;
    color: #27ae60;
}

/* ===== 면책 조항 ===== */
.npc-disclaimer {
    padding: 14px 16px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    font-size: 12px;
    color: #a09a94;
    line-height: 1.6;
}

.npc-disclaimer strong {
    color: #7a756d;
    font-weight: 600;
}

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

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

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

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

    .npc-comparison-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .npc-decision-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .npc-card-normal {
        transform: none;
    }

    .npc-roi-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .npc-roi-arrow {
        transform: rotate(90deg);
    }
}

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

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

    .npc-decision-age-row {
        align-items: flex-start;
    }

    .npc-decision-metrics {
        grid-template-columns: 1fr;
    }

    .npc-decision-metric strong {
        font-size: 17px;
    }

    .npc-detail-cards {
        grid-template-columns: 1fr;
    }

    .npc-card-amount strong {
        font-size: 18px;
    }

    .npc-detail-value {
        font-size: 18px;
    }

    .npc-roi-value {
        font-size: 18px;
    }

    .npc-roi-percent {
        font-size: 22px;
    }

    .npc-btn-group {
        grid-template-columns: 1fr;
    }

    .npc-breakeven-info {
        flex-direction: column;
        gap: 8px;
    }
}

/* 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;
}
