/**
 * Policy Loan Limit Comparison Calculator Styles
 * 약관대출 한도 비교 계산기 전용 스타일
 *
 * @package Zipper
 */

/* ===== 메인 2열 레이아웃 ===== */
.pllc-main-layout {
    display: grid;
    grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

.pllc-input-col {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

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

/* ===== 공통 섹션 카드 ===== */
.pllc-section,
.pllc-chart-section,
.pllc-summary-section,
.pllc-table-section,
.pllc-reason-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;
}

.pllc-section:hover,
.pllc-chart-section:hover,
.pllc-summary-section:hover,
.pllc-table-section:hover,
.pllc-reason-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.pllc-hidden {
    display: none !important;
}

.pllc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: #2d2a26;
}

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

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

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

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

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

.pllc-input-group input:not([type="radio"]):not([type="checkbox"]),
.pllc-input-group select,
.pllc-amount-input,
.pllc-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pllc-input-group input[type="number"],
.pllc-input-group input[type="tel"],
.pllc-amount-input {
    text-align: right;
    font-weight: 600;
}

.pllc-input-group input:not([type="radio"]):not([type="checkbox"]):hover,
.pllc-input-group select:hover,
.pllc-amount-input:hover,
.pllc-select:hover {
    border-color: #d4c67a;
}

.pllc-input-group input:not([type="radio"]):not([type="checkbox"]):focus,
.pllc-input-group select:focus,
.pllc-amount-input:focus,
.pllc-select:focus {
    outline: none;
    border-color: #d4af37;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.pllc-input-group input:not([type="radio"]):not([type="checkbox"])::placeholder,
.pllc-amount-input::placeholder {
    color: #c4c0bc;
    font-weight: 400;
}

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

.pllc-input-hint {
    margin: 6px 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: #8c8578;
}

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

.pllc-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pllc-mode-btn {
    padding: 10px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #f5f3f0;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pllc-mode-btn:hover {
    border-color: #d9d2c2;
    background: #ece8e2;
}

.pllc-mode-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

.pllc-mode-btn.is-active,
.pllc-mode-btn[aria-pressed="true"] {
    border-color: #d4af37;
    color: #8a6f1f;
    background: #fff9eb;
}

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

.pllc-calc-btn,
.pllc-reset-btn {
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pllc-calc-btn {
    order: 1;
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #d4af37, #c9a030);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

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

.pllc-calc-btn:focus-visible,
.pllc-reset-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

.pllc-reset-btn {
    order: 2;
    flex: 0 0 auto;
    min-width: 96px;
    padding: 12px 16px;
    border: 1px solid #e8e4dc;
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    background: #f5f3f0;
}

.pllc-reset-btn:hover {
    background: #ece8e2;
    border-color: #d9d2c2;
}

/* ===== 결과 대기 ===== */
.pllc-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding: 40px 20px;
    color: #9e9a96;
}

.pllc-waiting i,
.pllc-waiting-icon {
    display: block;
    font-size: 32px;
    color: #d4af37;
    opacity: 0.4;
    line-height: 1;
}

.pllc-waiting-icon i {
    display: block;
}

.pllc-waiting-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #5f5a56;
}

.pllc-waiting p,
.pllc-waiting-desc {
    margin: 0;
    font-size: 13px;
}

/* ===== 요약 카드 ===== */
.pllc-summary-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pllc-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.pllc-summary {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    border: 1px solid #ebe4d3;
    border-radius: 16px;
    background: #f8f5ee;
}

.pllc-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.pllc-summary-item,
.pllc-summary-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 132px;
    padding: 18px;
    border: 1px solid #ebe3d4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(57, 47, 29, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pllc-summary-item:hover,
.pllc-summary-card:hover {
    transform: translateY(-1px);
    border-color: #dfd3b8;
    box-shadow: 0 4px 12px rgba(77, 62, 29, 0.12);
}

.pllc-summary-item:first-child,
.pllc-summary-item.is-kpi {
    grid-column: 1 / -1;
    min-height: 158px;
    border-color: #e4d9bb;
    background: #fffaf0;
    box-shadow: 0 2px 10px rgba(86, 66, 22, 0.12);
}

.pllc-summary-item .pllc-summary-label,
.pllc-card-label {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #655f53;
}

.pllc-summary-value,
.pllc-card-value {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.28;
    letter-spacing: -0.02em;
    color: #2d2a26;
}

.pllc-summary-item:first-child .pllc-summary-value,
.pllc-summary-item:first-child .pllc-card-value,
.pllc-summary-item.is-kpi .pllc-summary-value,
.pllc-summary-item.is-kpi .pllc-card-value {
    font-size: 32px;
    font-weight: 800;
    color: #9b7511;
    letter-spacing: -0.02em;
}

.pllc-card-desc {
    margin: auto 0 0;
    padding-top: 4px;
    font-size: 12px;
    line-height: 1.58;
    color: #777062;
}

.pllc-card-meta {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.pllc-approval-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    padding: 4px 9px;
    border: 1px solid #e8dfc0;
    border-radius: 999px;
    background: #fffdf5;
    color: #8a6f1f;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.pllc-approval-badge.is-high {
    border-color: #d8e8d6;
    background: #f4fbf2;
    color: #2f7a42;
}

.pllc-approval-badge.is-medium {
    border-color: #ebdfbf;
    background: #fffaf0;
    color: #8f6c10;
}

.pllc-approval-badge.is-low {
    border-color: #efd9be;
    background: #fff8ef;
    color: #9a5f1f;
}

.pllc-approval-badge.is-none {
    border-color: #e9d8d8;
    background: #fff6f6;
    color: #a14a4a;
}

.pllc-approval-badge.is-pending {
    border-color: #e8dfc0;
    background: #fffdf5;
    color: #8a6f1f;
}

.pllc-priority-text {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    color: #584f3e;
}

.pllc-status-badge,
.pllc-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    margin-top: 2px;
    padding: 5px 10px;
    border: 1px solid #e5dcc8;
    border-radius: 999px;
    background: #fff;
    color: #776a4d;
    font-size: 11px;
    font-weight: 600;
}

/* ===== 차트 + 폴백 ===== */
.pllc-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.pllc-chart-head .pllc-section-title {
    margin-bottom: 0;
}

.pllc-chart-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pllc-chart-metric-toggle {
    display: inline-flex;
    align-items: stretch;
    gap: 6px;
    padding: 3px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #f8f5ef;
}

.pllc-chart-metric-btn {
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    padding: 7px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pllc-chart-metric-btn:hover {
    background: #eee9df;
}

.pllc-chart-metric-btn.is-active,
.pllc-chart-metric-btn[aria-pressed="true"] {
    background: #fff;
    color: #8a6f1f;
    box-shadow: 0 1px 3px rgba(73, 64, 45, 0.14);
}

.pllc-chart-metric-btn:focus-visible,
.pllc-download-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
}

.pllc-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.pllc-download-btn.tool-btn-excel {
    border: 1px solid #59ab79;
    background: #59ab79;
    color: #fff;
}

.pllc-download-btn.tool-btn-excel:hover {
    border-color: #4f9f70;
    background: #4f9f70;
}

.pllc-download-btn i {
    font-size: 13px;
    line-height: 1;
}

.pllc-chart-guide {
    margin: 8px 0 10px;
    font-size: 12px;
    line-height: 1.45;
    color: #6c655d;
}

.pllc-chart-section,
.pllc-table-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pllc-chart-section .pllc-section-title,
.pllc-table-section .pllc-section-title {
    margin-bottom: 0;
}

.pllc-chart-wrap {
    position: relative;
    width: 100%;
    height: 300px;
}

.pllc-chart-wrap canvas {
    width: 100% !important;
    max-height: 300px;
}

.pllc-chart-fallback {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px dashed #e8dfc0;
    border-radius: 10px;
    background: #fffdf7;
    font-size: 12px;
    color: #5f5a56;
}

.pllc-chart-fallback table,
.pllc-fallback-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.pllc-chart-fallback th,
.pllc-chart-fallback td,
.pllc-fallback-table th,
.pllc-fallback-table td {
    padding: 8px;
    border-bottom: 1px solid #efe9dc;
    text-align: right;
}

.pllc-chart-fallback th:first-child,
.pllc-chart-fallback td:first-child,
.pllc-fallback-table th:first-child,
.pllc-fallback-table td:first-child {
    text-align: left;
}

/* ===== 비교 테이블 ===== */
.pllc-table-wrap {
    width: 100%;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    overflow-x: auto;
    background: #fff;
}

.pllc-compare-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 12px;
}

.pllc-compare-table thead th {
    padding: 11px 10px;
    background: #f5f3f0;
    color: #5f5a56;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #e8e4dc;
    white-space: nowrap;
}

.pllc-compare-table thead th:first-child {
    text-align: left;
}

.pllc-compare-table tbody td {
    padding: 10px 9px;
    color: #2d2a26;
    border-bottom: 1px solid #f0ede8;
    text-align: center;
    vertical-align: middle;
    background: #fff;
}

.pllc-compare-table tbody td:first-child {
    text-align: left;
    color: #5f5a56;
    font-weight: 500;
}

.pllc-priority-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 3px 8px;
    border: 1px solid #e8dfc0;
    border-radius: 999px;
    background: #fffdf5;
    color: #8a6f1f;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.pllc-priority-chip.is-hold {
    border-color: #e7dddd;
    background: #faf7f7;
    color: #8d8078;
}

.pllc-compare-table tbody tr:nth-child(even) td {
    background: #fcfbf9;
}

.pllc-compare-table tbody tr:hover td {
    background: #fdfbf5;
}

/* ===== 판단 사유 리스트 ===== */
.pllc-reason-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pllc-reason-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #ece6d9;
    border-radius: 8px;
    background: #faf9f7;
    font-size: 12px;
    line-height: 1.55;
    color: #5f5a56;
}

.pllc-reason-list li::before {
    content: "•";
    color: #d4af37;
    font-size: 15px;
    line-height: 1;
    margin-top: 1px;
}

/* ===== 면책/기준일 ===== */
.pllc-disclaimer,
.pllc-date-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.5;
}

.pllc-disclaimer {
    border: 1px solid #e8e4dc;
    background: #faf9f7;
    color: #9e9a96;
}

.pllc-date-notice {
    border: 1px solid #e8dfc0;
    background: #fffdf5;
    color: #8c8578;
}

.pllc-basis-date {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: #8c8578;
}

.pllc-basis-date strong {
    color: #5f5a56;
    font-weight: 600;
}

.pllc-disclaimer i,
.pllc-date-notice i {
    flex-shrink: 0;
    margin-top: 2px;
    color: #d4af37;
}

/* ===== 모션 감소 ===== */
@media (prefers-reduced-motion: reduce) {
    .pllc-section,
    .pllc-chart-section,
    .pllc-summary-item,
    .pllc-summary-card,
    .pllc-input-group input:not([type="radio"]):not([type="checkbox"]),
    .pllc-input-group select,
    .pllc-calc-btn,
    .pllc-reset-btn,
    .pllc-chart-metric-btn,
    .pllc-download-btn,
    .pllc-compare-table tbody td {
        transition: none !important;
    }

    .pllc-calc-btn:hover {
        transform: none !important;
    }
}

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

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

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

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

    .pllc-summary-item:first-child,
    .pllc-summary-item.is-kpi {
        grid-column: auto;
    }
}

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

    .pllc-chart-wrap {
        height: 260px;
    }

    .pllc-chart-wrap canvas {
        max-height: 260px;
    }

    .pllc-compare-table {
        min-width: 620px;
    }

    .pllc-chart-tools {
        width: 100%;
    }

    .pllc-download-btn {
        margin-left: auto;
    }
}

/* ===== 반응형 768px ===== */
@media (max-width: 768px) {
    .pllc-section,
    .pllc-chart-section,
    .pllc-summary-section,
    .pllc-table-section,
    .pllc-reason-section {
        padding: 16px;
    }

    .pllc-input-row {
        grid-template-columns: 1fr;
    }

    .pllc-summary {
        padding: 18px;
    }

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

    .pllc-summary-item,
    .pllc-summary-card {
        min-height: 0;
        padding: 14px;
    }

    .pllc-summary-item:first-child,
    .pllc-summary-item.is-kpi {
        min-height: 0;
        grid-column: auto;
    }

    .pllc-summary-value {
        font-size: 21px;
    }

    .pllc-summary-item:first-child .pllc-summary-value,
    .pllc-summary-item.is-kpi .pllc-summary-value {
        font-size: 24px;
    }

    .pllc-card-desc {
        padding-top: 7px;
    }

    .pllc-chart-wrap {
        height: 230px;
    }

    .pllc-chart-wrap canvas {
        max-height: 230px;
    }

    .pllc-chart-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .pllc-chart-metric-toggle {
        width: 100%;
    }

    .pllc-chart-metric-btn {
        flex: 1;
    }

    .pllc-download-btn {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .pllc-compare-table thead th,
    .pllc-compare-table tbody td,
    .pllc-chart-fallback th,
    .pllc-chart-fallback td {
        padding: 8px 7px;
    }
}

/* ===== 반응형 480px ===== */
@media (max-width: 480px) {
    .pllc-section,
    .pllc-chart-section,
    .pllc-summary-section,
    .pllc-table-section,
    .pllc-reason-section {
        padding: 12px;
    }

    .pllc-btn-group {
        gap: 6px;
    }

    .pllc-calc-btn {
        padding: 11px 12px;
        font-size: 13px;
    }

    .pllc-reset-btn {
        min-width: 84px;
        padding: 11px 12px;
        font-size: 12px;
    }

    .pllc-waiting {
        padding: 32px 16px;
    }

    .pllc-summary {
        padding: 14px;
        gap: 10px;
    }

    .pllc-summary-item,
    .pllc-summary-card {
        padding: 12px;
    }

    .pllc-summary-value {
        font-size: 18px;
    }

    .pllc-summary-item:first-child .pllc-summary-value,
    .pllc-summary-item.is-kpi .pllc-summary-value {
        font-size: 20px;
    }

    .pllc-priority-text {
        font-size: 11px;
    }

    .pllc-chart-guide {
        font-size: 11px;
    }

    .pllc-chart-metric-btn {
        font-size: 11px;
        padding: 6px 8px;
    }

    .pllc-download-btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    .pllc-chart-wrap {
        height: 200px;
    }

    .pllc-chart-wrap canvas {
        max-height: 200px;
    }

    .pllc-compare-table {
        min-width: 560px;
        font-size: 11px;
    }

    .pllc-reason-list li {
        font-size: 11px;
        padding: 9px 10px;
    }
}
