/**
 * Child Tax Credit Calculator Styles
 * 자녀장려금 자격·예상지급액 계산기
 *
 * @package Zipper
 */

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

.ctc-main-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

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

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

.ctc-section,
.ctc-result-summary,
.ctc-chart-section,
.ctc-table-section,
.ctc-reason-section,
.ctc-apply-section,
.ctc-waiting-card {
    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;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

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

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

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

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

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

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

#ctcYear,
#ctcHouseholdType,
#ctcTotalIncome,
#ctcTotalProperty,
#ctcChildCount,
.ctc-input:not([type="radio"]):not([type="checkbox"]),
.ctc-select,
.ctc-input-group input:not([type="radio"]):not([type="checkbox"]),
.ctc-input-group select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fbfaf8;
    color: #2d2a26;
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#ctcYear,
#ctcHouseholdType,
.ctc-select,
.ctc-input-group select {
    padding: 10px 34px 10px 12px;
    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='%236f6758' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

#ctcTotalIncome,
#ctcTotalProperty,
#ctcChildCount,
.ctc-input:not([type="radio"]):not([type="checkbox"]),
.ctc-input-group input:not([type="radio"]):not([type="checkbox"]) {
    padding: 10px 12px;
}

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

.ctc-amount-wrap .ctc-input,
.ctc-amount-wrap #ctcTotalIncome,
.ctc-amount-wrap #ctcTotalProperty {
    width: 100%;
    min-width: 0;
    padding-right: 12px;
}

.ctc-unit {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 0 12px;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: #7a7266;
    background: #fbfaf8;
    white-space: nowrap;
    pointer-events: none;
}

.ctc-amount-wrap .ctc-input:hover + .ctc-unit {
    background: #fff;
    border-color: #d4c67a;
}

.ctc-amount-wrap .ctc-input:focus + .ctc-unit {
    background: #fff;
    border-color: #d4af37;
}

#ctcTotalIncome,
#ctcTotalProperty,
.ctc-amount-input {
    text-align: right;
    font-weight: 600;
}

#ctcTotalIncome::placeholder,
#ctcTotalProperty::placeholder,
#ctcChildCount::placeholder,
.ctc-input::placeholder,
.ctc-input-group input::placeholder {
    color: #c4c0bc;
    font-weight: 400;
}

#ctcYear:hover,
#ctcHouseholdType:hover,
#ctcTotalIncome:hover,
#ctcTotalProperty:hover,
#ctcChildCount:hover,
.ctc-input:not([type="radio"]):not([type="checkbox"]):hover,
.ctc-select:hover,
.ctc-input-group input:not([type="radio"]):not([type="checkbox"]):hover,
.ctc-input-group select:hover {
    border-color: #d4c67a;
}

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

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

.ctc-radio-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.ctc-radio-inline label,
.ctc-radio-option {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fbfaf8;
    color: #5f5a56;
    font-size: 12px;
    line-height: 1.45;
    box-sizing: border-box;
    cursor: pointer;
}

.ctc-radio-inline label:hover,
.ctc-radio-option:hover {
    border-color: #d4c67a;
    background: #fff;
}

.ctc-radio-inline input[type="radio"],
.ctc-radio-option input[type="radio"] {
    width: auto;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #d4af37;
}

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

#ctcCalcBtn,
#ctcResetBtn,
.ctc-btn {
    min-height: 44px;
    border-radius: 10px;
    padding: 12px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

#ctcCalcBtn,
.ctc-btn-primary {
    flex: 1;
    border: 1px solid transparent;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, #d4af37 0%, #c49520 100%);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

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

#ctcResetBtn,
.ctc-btn-ghost {
    border: 1px solid #dfd8cb;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 500;
    background: #f5f3f0;
}

#ctcResetBtn:hover,
.ctc-btn-ghost:hover {
    border-color: #d4c67a;
    background: #fff;
}

#ctcWaiting,
.ctc-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 160px;
    text-align: center;
    color: #7f786b;
    font-size: 13px;
    line-height: 1.55;
}

#ctcWaiting i,
.ctc-waiting i {
    font-size: 32px;
    color: #d4af37;
    opacity: 0.4;
}

#ctcWaitingText,
.ctc-waiting-text {
    margin: 0;
}

#ctcWaiting.ctc-hidden,
.ctc-waiting.ctc-hidden {
    display: none !important;
}

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

#ctcSummaryBadge,
.ctc-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.18);
    color: #7b6521;
    font-size: 12px;
    font-weight: 700;
}

#ctcSummaryTitle,
.ctc-summary-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
    color: #2d2a26;
}

#ctcMainValue,
.ctc-main-value {
    margin: 8px 0;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #b58913;
}

#ctcSummaryNote,
.ctc-summary-note {
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 1.55;
    color: #6d665c;
}

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

.ctc-metric-item,
.ctc-summary-item {
    border: 1px solid #e7ddc4;
    border-radius: 9px;
    background: #fff;
    padding: 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 88px;
}

.ctc-metric-label {
    font-size: 12px;
    font-weight: 600;
    color: #7a7266;
}

#ctcMetricEstimated,
#ctcMetricChildCount,
#ctcMetricIncomeRange,
#ctcMetricStatus,
.ctc-summary-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #2d2a26;
}

.ctc-metric-item.is-kpi #ctcMetricEstimated,
.ctc-summary-item.is-kpi .ctc-summary-value {
    font-size: 22px;
    color: #b58913;
}

.ctc-block-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.ctc-chart-wrap {
    position: relative;
    width: 100%;
    height: 280px;
    min-height: 260px;
}

#ctcChartCanvas,
.ctc-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

#ctcChartFallback,
.ctc-chart-fallback {
    margin-top: 10px;
    border: 1px dashed #d9cda8;
    border-radius: 8px;
    background: #fffdf3;
    color: #7f755f;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
}

.ctc-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.ctc-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.ctc-table th,
.ctc-table td {
    border: 1px solid #ece7da;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: #2d2a26;
    text-align: left;
    vertical-align: top;
}

.ctc-table th {
    background: #f7f3e8;
    color: #5f584c;
    font-weight: 700;
}

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

.ctc-empty-row td,
#ctcBreakdownTableBody tr.ctc-empty-row td {
    text-align: center;
    color: #7a7367;
    padding: 14px 10px;
    background: #fffdf8;
}

.ctc-status-pass {
    color: #1f6f46;
    font-weight: 700;
}

.ctc-status-fail {
    color: #a94b2a;
    font-weight: 700;
}

.ctc-status-info {
    color: #8a6a10;
    font-weight: 700;
}

#ctcReasonList,
.ctc-reason-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#ctcReasonList .ctc-reason-item,
.ctc-reason-item {
    border: 1px solid #e7ddc4;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    line-height: 1.45;
    color: #3a352f;
}

.ctc-reason-item strong {
    font-size: 12px;
    font-weight: 700;
}

.ctc-reason-item.ctc-reason-pass {
    border-color: #b8ddc5;
    background: #f2fbf4;
    color: #1f6f46;
}

.ctc-reason-item.ctc-reason-fail {
    border-color: #efc6bb;
    background: #fff2ee;
    color: #a94b2a;
}

.ctc-reason-item.ctc-reason-info {
    border-color: #ecd9a7;
    background: #fff8e7;
    color: #8a6a10;
}

.ctc-apply-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ctc-apply-list li {
    font-size: 12px;
    line-height: 1.5;
    color: #3a352f;
}

.ctc-apply-list a {
    color: #6f5818;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ctc-apply-list a:hover {
    color: #8a6a10;
}

#ctcDownloadBtn,
.ctc-download-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 10px;
}

#ctcDownloadBtn.tool-btn.tool-btn-excel,
.ctc-download-btn.tool-btn.tool-btn-excel {
    color: #fff;
    background: linear-gradient(135deg, #59ab79 0%, #4b9a69 100%);
    border: 1px solid #448e62;
    box-shadow: 0 2px 6px rgba(63, 153, 98, 0.28);
}

#ctcDownloadBtn.tool-btn.tool-btn-excel:hover,
.ctc-download-btn.tool-btn.tool-btn-excel:hover {
    color: #fff;
    background: linear-gradient(135deg, #4f9f70 0%, #438f62 100%);
    border-color: #3d845a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(54, 137, 86, 0.34);
}

#ctcApplyHint,
.ctc-apply-hint {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #6d6659;
}

.ctc-disclaimer {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    font-size: 11px;
    line-height: 1.5;
    color: #9e9a96;
}

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

.ctc-disclaimer span {
    min-width: 0;
}

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

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

    #ctcYear,
    #ctcHouseholdType,
    #ctcTotalIncome,
    #ctcTotalProperty,
    #ctcChildCount,
    .ctc-input:not([type="radio"]):not([type="checkbox"]),
    .ctc-select,
    .ctc-input-group input:not([type="radio"]):not([type="checkbox"]),
    .ctc-input-group select {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .ctc-section,
    .ctc-result-summary,
    .ctc-chart-section,
    .ctc-table-section,
    .ctc-reason-section,
    .ctc-apply-section,
    .ctc-waiting-card {
        padding: 14px;
    }

    .ctc-metric-grid,
    .ctc-summary-grid {
        grid-template-columns: 1fr;
    }

    .ctc-block-head {
        flex-direction: column;
        align-items: flex-start;
    }

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

    #ctcCalcBtn,
    #ctcResetBtn,
    #ctcDownloadBtn,
    .ctc-download-btn {
        width: 100%;
        justify-content: center;
    }

    #ctcMainValue,
    .ctc-main-value {
        font-size: 30px;
    }

    .ctc-chart-wrap {
        height: 250px;
        min-height: 240px;
    }

    .ctc-amount-wrap {
        gap: 6px;
    }

    .ctc-unit {
        min-width: 36px;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .ctc-main-layout,
    .ctc-input-col,
    #ctcResultCol,
    .ctc-result-col,
    .ctc-section,
    .ctc-result-summary,
    .ctc-chart-section,
    .ctc-table-section,
    .ctc-reason-section,
    .ctc-apply-section,
    .ctc-waiting-card {
        max-width: 100%;
        overflow-x: hidden;
    }

    .ctc-radio-inline {
        grid-template-columns: 1fr;
    }

    #ctcSummaryTitle,
    .ctc-summary-title {
        font-size: 16px;
    }

    #ctcMainValue,
    .ctc-main-value {
        font-size: 27px;
    }

    #ctcMetricEstimated,
    #ctcMetricChildCount,
    #ctcMetricIncomeRange,
    #ctcMetricStatus,
    .ctc-summary-value {
        font-size: 16px;
    }

    .ctc-metric-item.is-kpi #ctcMetricEstimated,
    .ctc-summary-item.is-kpi .ctc-summary-value {
        font-size: 19px;
    }

    .ctc-table {
        min-width: 620px;
    }

    .ctc-table th,
    .ctc-table td {
        font-size: 11px;
        padding: 9px 10px;
    }

    .ctc-chart-wrap {
        height: 220px;
        min-height: 210px;
    }

    .ctc-amount-wrap {
        gap: 5px;
    }

    .ctc-unit {
        min-width: 34px;
        padding: 0 9px;
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ctc-section,
    .ctc-result-summary,
    .ctc-chart-section,
    .ctc-table-section,
    .ctc-reason-section,
    .ctc-apply-section,
    .ctc-waiting-card,
    #ctcCalcBtn,
    #ctcResetBtn,
    #ctcDownloadBtn,
    .ctc-download-btn,
    #ctcYear,
    #ctcHouseholdType,
    #ctcTotalIncome,
    #ctcTotalProperty,
    #ctcChildCount,
    .ctc-input:not([type="radio"]):not([type="checkbox"]),
    .ctc-select,
    .ctc-input-group input:not([type="radio"]):not([type="checkbox"]),
    .ctc-input-group select,
    .ctc-reason-item {
        transition: none !important;
    }

    #ctcCalcBtn:hover,
    #ctcDownloadBtn.tool-btn.tool-btn-excel:hover,
    .ctc-download-btn.tool-btn.tool-btn-excel:hover {
        transform: none !important;
    }
}
