/**
 * 카드론·현금서비스 이자 계산기
 * @package Zipper
 */

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

.clca-main-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.clca-input-col {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.clca-result-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.clca-section,
.clca-result-summary,
.clca-chart-section,
.clca-table-section {
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

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

.clca-result-summary {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.12);
}

.clca-section-title,
.clca-block-title {
    margin: 0 0 12px;
    color: #2d2a26;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clca-section-title i,
.clca-block-title i {
    color: #d4af37;
}

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

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

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

.clca-label {
    display: block;
    margin-bottom: 6px;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.clca-input-group input:not([type="radio"]):not([type="checkbox"]),
.clca-input-group select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.clca-input {
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fbfaf8;
    color: #2d2a26;
    font-size: 13px;
    padding: 10px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.clca-input:hover {
    border-color: #d4c67a;
}

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

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

.clca-input[type="number"] {
    -moz-appearance: textfield;
}

.clca-input[type="number"]::-webkit-outer-spin-button,
.clca-input[type="number"]::-webkit-inner-spin-button {
    margin: 0;
}

.clca-amount-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    max-width: 100%;
}

.clca-amount-wrap .clca-input {
    text-align: right;
    font-weight: 600;
}

.clca-unit {
    min-width: 54px;
    padding: 0 10px;
    height: 40px;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: linear-gradient(180deg, #fcfbf8 0%, #f3efe8 100%);
    color: #7b7467;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    user-select: none;
    white-space: nowrap;
}

.clca-amount-wrap-small .clca-unit {
    min-width: 48px;
}

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

.clca-hint {
    margin: 8px 0 0;
    color: #8f887d;
    font-size: 11px;
    line-height: 1.45;
}

.clca-btn-group {
    display: flex;
    gap: 8px;
}

.clca-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    line-height: 1.2;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.clca-btn-primary {
    flex: 1;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #c59a23 100%);
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

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

.clca-btn-ghost {
    color: #5f5a56;
    background: #f5f3f0;
    border: 1px solid #e8e4dc;
    font-size: 13px;
    font-weight: 500;
}

.clca-btn-ghost:hover {
    border-color: #d4c67a;
    color: #2d2a26;
}

.clca-waiting {
    text-align: center;
    padding: 40px 20px;
    color: #9e9a96;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.clca-waiting i {
    font-size: 32px;
    color: #d4af37;
    opacity: 0.4;
    display: block;
}

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

.clca-summary-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: #f8f2df;
    color: #8d6a12;
    font-size: 11px;
    font-weight: 700;
}

.clca-summary-title {
    margin: 10px 0 6px;
    font-size: 20px;
    line-height: 1.35;
    color: #2d2a26;
    letter-spacing: -0.02em;
}

.clca-summary-note {
    margin: 0;
    color: #6b645a;
    font-size: 13px;
    line-height: 1.55;
}

.clca-main-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.clca-main-kpi,
.clca-summary-item {
    border: 1px solid #eee6d9;
    border-radius: 10px;
    background: #fcfbf8;
    padding: 12px;
    min-width: 0;
}

.clca-main-kpi-label,
.clca-summary-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #7b7467;
}

.clca-main-kpi-value,
.clca-summary-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #2d2a26;
    word-break: keep-all;
}

.clca-main-kpi.is-kpi .clca-main-kpi-value {
    font-size: 22px;
    color: #b58913;
}

.clca-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.clca-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.clca-download-btn {
    white-space: nowrap;
}

.clca-download-btn.tool-btn.tool-btn-excel {
    color: #fff;
    background: linear-gradient(135deg, #59ab79 0%, #4b9a69 100%);
    border: 1px solid #448e62;
}

.clca-download-btn.tool-btn.tool-btn-excel:hover {
    background: linear-gradient(135deg, #4f9f70 0%, #438f62 100%);
}

.clca-block-sub {
    margin: 0 0 10px;
    font-size: 12px;
    color: #6b645a;
    line-height: 1.5;
}

.clca-chart-wrap {
    position: relative;
    width: 100%;
    height: 320px;
    min-width: 0;
}

.clca-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.clca-chart-fallback {
    margin: 8px 0 0;
    font-size: 12px;
    color: #8a5c00;
    line-height: 1.45;
}

.clca-fallback-table-wrap,
.clca-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.clca-fallback-table,
.clca-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.clca-fallback-table th,
.clca-fallback-table td,
.clca-table th,
.clca-table td {
    border-bottom: 1px solid #f0ece4;
    padding: 10px 8px;
    text-align: right;
    font-size: 12px;
    color: #4d473f;
    vertical-align: middle;
    white-space: nowrap;
}

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

.clca-fallback-table thead th,
.clca-table thead th {
    background: #faf7f0;
    color: #665f53;
    font-weight: 700;
}

.clca-empty-row td {
    text-align: center !important;
    color: #9b9387;
}

.clca-warning-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #544f47;
    font-size: 12px;
    line-height: 1.5;
}

.clca-warning-list li.is-warning {
    color: #8a5c00;
}

.clca-warning-list li.is-danger {
    color: #a2362a;
}

.clca-notice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.clca-notice-item {
    border: 1px solid #eee7dc;
    border-radius: 10px;
    background: #fbfaf8;
    padding: 10px;
}

.clca-notice-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    color: #7b7467;
}

.clca-notice-value {
    display: block;
    font-size: 12px;
    color: #2d2a26;
    line-height: 1.45;
}

@media (max-width: 1200px) {
    .clca-main-kpi-grid,
    .clca-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .clca-main-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

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

    .clca-section,
    .clca-result-summary,
    .clca-chart-section,
    .clca-table-section {
        padding: 16px;
    }

    .clca-block-head {
        flex-direction: column;
        align-items: stretch;
    }

    .clca-download-btn {
        width: 100%;
        justify-content: center;
    }

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

@media (max-width: 768px) {
    .clca-input-row {
        grid-template-columns: 1fr;
    }

    .clca-main-kpi-grid,
    .clca-summary-grid,
    .clca-notice-grid {
        grid-template-columns: 1fr;
    }

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

    .clca-btn {
        width: 100%;
    }

    .clca-chart-wrap {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .tool-section,
    .clca-main-layout,
    .clca-input-col,
    .clca-result-col {
        max-width: 100%;
        overflow-x: hidden;
    }

    .clca-chart-wrap {
        height: 220px;
    }

    .clca-main-kpi-value,
    .clca-summary-value {
        font-size: 16px;
    }

    .clca-main-kpi.is-kpi .clca-main-kpi-value {
        font-size: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .clca-section,
    .clca-result-summary,
    .clca-chart-section,
    .clca-table-section,
    .clca-input,
    .clca-btn {
        transition: none !important;
    }

    .clca-btn-primary:hover {
        transform: none !important;
    }
}
