/**
 * APR Calculator Styles
 * APR 계산기 전용 스타일
 */

#aprcCalculator {
    padding: 14px 16px 18px;
}

#aprcCalculator .tool-layout-split {
    grid-template-columns: 328px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

#aprcCalculator .tool-layout-input,
#aprcCalculator .tool-layout-result,
.aprc-intro,
.aprc-section,
.aprc-input-section,
.aprc-input-group,
.aprc-breakdown-section,
.aprc-breakdown-list,
.aprc-breakdown-row,
.aprc-breakdown-head,
.aprc-summary-grid,
.aprc-tip-list,
.aprc-assumption-box,
.aprc-actions,
.aprc-waiting,
.aprc-waiting-copy,
.aprc-result-hero,
.aprc-table-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aprc-intro {
    margin-bottom: 12px;
    gap: 5px;
}

.aprc-lead {
    margin: 0;
    color: #5f5a56;
    font-size: 12px;
    line-height: 1.55;
}

.aprc-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.05);
}

.aprc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
}

.aprc-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.aprc-section-meta {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f7f1e1;
    color: #8a6500;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.aprc-input-section {
    gap: 8px;
}

.aprc-section-title i,
.aprc-assumption-title i {
    color: #d4af37;
}

.aprc-input-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.aprc-inline-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.aprc-input-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
}

.aprc-money-input,
.aprc-number-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 11px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #fff;
    color: #2d2a26;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aprc-money-input {
    text-align: right;
    font-weight: 600;
}

.aprc-number-input {
    text-align: center;
    font-weight: 600;
}

.aprc-money-input:hover,
.aprc-number-input:hover {
    border-color: #d4af37;
}

.aprc-money-input:focus,
.aprc-number-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.aprc-unit-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.aprc-money-note {
    color: #b8860b;
    font-size: 11px;
    line-height: 1.4;
}

.aprc-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.aprc-quick-btn {
    border: 1px solid #e8e4dc;
    background: #fff;
    color: #5f5a56;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aprc-quick-btn:hover,
.aprc-quick-btn:focus-visible {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
    outline: none;
}

.aprc-repay-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.aprc-repay-card {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    padding: 10px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aprc-repay-card input {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 2px solid #cfc8bb;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 3px #fff;
    align-self: center;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.aprc-repay-card input:checked {
    border-color: #d4af37;
    background: #d4af37;
    box-shadow: inset 0 0 0 3px #fff;
}

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

.aprc-repay-name {
    grid-column: 2;
    color: #2d2a26;
    font-size: 12px;
    font-weight: 700;
}

.aprc-repay-desc {
    grid-column: 2;
    color: #7a756d;
    font-size: 10px;
    line-height: 1.45;
}

.aprc-assumption-box {
    gap: 4px;
    padding: 7px 9px;
    background: #fffaf0;
    border-radius: 8px;
    border: 1px solid #eadfb8;
}

.aprc-assumption-title {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #7a5d18;
    font-size: 10px;
    font-weight: 700;
}

.aprc-tip-section {
    padding: 10px;
}

.aprc-tip-section .aprc-section-title {
    font-size: 13px;
    gap: 6px;
}

.aprc-assumption-list,
.aprc-tip-list {
    margin: 0;
    padding-left: 14px;
    color: #5f5a56;
    font-size: 10px;
    line-height: 1.32;
    gap: 1px;
}

.aprc-assumption-list li + li,
.aprc-tip-list li + li {
    margin-top: 1px;
}

.aprc-waiting {
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(255, 250, 236, 0.9));
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 12px;
}

.aprc-waiting[hidden] {
    display: none !important;
}

.aprc-waiting-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    color: #b8860b;
    font-size: 20px;
    flex-shrink: 0;
}

.aprc-waiting-copy {
    gap: 4px;
}

.aprc-waiting-copy strong {
    color: #2d2a26;
    font-size: 12px;
}

.aprc-waiting-copy p {
    margin: 0;
    color: #5f5a56;
    font-size: 11px;
    line-height: 1.5;
}

.aprc-top-grid,
.aprc-lower-grid {
    display: grid;
    gap: 10px;
}

.aprc-top-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(250px, 0.88fr);
    align-items: stretch;
}

.aprc-lower-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.aprc-result-hero {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    background: linear-gradient(140deg, rgba(255, 247, 221, 0.95), rgba(255, 255, 255, 0.96));
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.1);
    justify-content: space-between;
}

.aprc-badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(122, 117, 109, 0.12);
    color: #5f5a56;
    font-size: 11px;
    font-weight: 700;
}

.aprc-badge.aprc-badge-alert {
    background: rgba(220, 50, 50, 0.12);
    color: #b12222;
}

.aprc-badge.aprc-badge-strong {
    background: rgba(212, 175, 55, 0.18);
    color: #8a6500;
}

.aprc-hero-label {
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
}

.aprc-hero-value {
    color: #2d2a26;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.aprc-hero-sub {
    margin: 0;
    color: #5f5a56;
    font-size: 12px;
    line-height: 1.5;
}

.aprc-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-content: start;
}

.aprc-summary-card,
.aprc-glance-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fcfbf8;
    padding: 10px;
}

.aprc-summary-label,
.aprc-glance-label {
    color: #7a756d;
    font-size: 11px;
    font-weight: 600;
}

.aprc-summary-value,
.aprc-glance-value {
    color: #2d2a26;
    font-size: 16px;
    line-height: 1.35;
    letter-spacing: -0.02em;
    word-break: keep-all;
}

.aprc-schedule-section {
    gap: 8px;
}

.aprc-schedule-glance {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.aprc-breakdown-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: #2d2a26;
    font-size: 13px;
}

.aprc-breakdown-head span {
    color: #5f5a56;
}

.aprc-breakdown-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #f1ede5;
    overflow: hidden;
}

.aprc-breakdown-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    width: 0;
}

.aprc-fill-interest {
    background: linear-gradient(90deg, #d4af37, #b8860b);
}

.aprc-fill-fee {
    background: linear-gradient(90deg, #8a6cff, #5d45d8);
}

.aprc-breakdown-meta {
    color: #7a756d;
    font-size: 12px;
    line-height: 1.5;
}

.aprc-table-wrap {
    gap: 0;
    overflow: auto;
    max-height: 440px;
    border: 1px solid #eee8dd;
    border-radius: 12px;
    background: #fff;
}

.aprc-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.aprc-table th,
.aprc-table td {
    padding: 8px 7px;
    border-bottom: 1px solid #eee8dd;
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
}

.aprc-table th:first-child,
.aprc-table td:first-child {
    text-align: center;
}

.aprc-table th {
    color: #5f5a56;
    background: #faf7ef;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
}

.aprc-table-empty,
.aprc-table-gap {
    text-align: center !important;
    color: #7a756d;
}

.aprc-table tbody tr:nth-child(even) td {
    background: #fcfbf8;
}

.aprc-table-first td {
    background: rgba(212, 175, 55, 0.05);
}

.aprc-table-highlight td {
    background: rgba(212, 175, 55, 0.12);
    font-weight: 700;
}

.aprc-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.aprc-actions .tool-btn {
    min-height: 40px;
    padding: 10px 12px;
    font-size: 12px;
}

@media (max-width: 1100px) {
    #aprcCalculator .tool-layout-split {
        grid-template-columns: 1fr;
    }

    #aprcCalculator .tool-layout-result {
        position: static;
        top: auto;
    }

    .aprc-top-grid,
    .aprc-lower-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #aprcCalculator {
        padding: 14px;
    }

    .aprc-input-row,
    .aprc-repay-grid {
        grid-template-columns: 1fr;
    }

    .aprc-summary-grid,
    .aprc-schedule-glance,
    .aprc-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #aprcCalculateBtn {
        grid-column: 1 / -1;
    }

    .aprc-waiting {
        flex-direction: column;
        align-items: flex-start;
    }

    .aprc-hero-value {
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .aprc-section,
    .aprc-result-hero,
    .aprc-summary-card {
        padding: 12px;
    }

    .aprc-quick-btns {
        gap: 6px;
    }

    .aprc-quick-btn {
        font-size: 11px;
        padding: 6px 9px;
    }

    .aprc-summary-value {
        font-size: 15px;
    }

    .aprc-summary-grid,
    .aprc-schedule-glance,
    .aprc-actions {
        grid-template-columns: 1fr;
    }
}
