/**
 * Electricity Bill Calculator (누진세·복지할인)
 * @package Zipper
 */

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

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

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

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

.ebc-section,
.ebc-result-summary,
.ebc-chart-section,
.ebc-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;
    max-width: 100%;
    box-sizing: border-box;
}

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

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

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

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

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

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

.ebc-select,
.ebc-input,
.ebc-input-group input:not([type="radio"]):not([type="checkbox"]),
.ebc-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;
}

.ebc-select,
.ebc-input-group select {
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 34px 10px 12px;
    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;
}

.ebc-input,
.ebc-input-group input:not([type="radio"]):not([type="checkbox"]) {
    padding: 10px 12px;
}

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

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

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

.ebc-amount-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fbfaf8;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ebc-amount-wrap:hover {
    border-color: #d4c67a;
}

.ebc-amount-wrap:focus-within {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    background: #fff;
}

.ebc-input-group .ebc-amount-wrap input.ebc-input[type="text"] {
    border: 0;
    border-radius: 0;
    padding: 10px 12px;
    background: transparent;
    box-shadow: none;
    text-align: right;
    font-weight: 600;
    min-width: 0;
}

.ebc-input-group .ebc-amount-wrap input.ebc-input[type="text"]:hover,
.ebc-input-group .ebc-amount-wrap input.ebc-input[type="text"]:focus {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.ebc-amount-wrap .ebc-unit {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 700;
    color: #7b7467;
    border-left: 1px solid #e4ddd0;
    background: linear-gradient(180deg, #fcfbf8 0%, #f3efe8 100%);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.72);
    pointer-events: none;
}

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

.ebc-check-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ebc-check-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    border: 1px solid #e2ddd3;
    border-radius: 8px;
    background: #fbfaf8;
    color: #5f5a56;
    font-size: 12px;
    line-height: 1.45;
    cursor: pointer;
}

.ebc-check-label input[type="checkbox"] {
    margin-top: 1px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

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

.ebc-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

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

.ebc-btn-ghost:hover {
    transform: translateY(-1px);
}

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

.ebc-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3ead3;
    color: #7a6120;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ebc-summary-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.35;
    color: #2d2a26;
}

.ebc-main-value {
    margin-top: 8px;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    color: #b58913;
    letter-spacing: -0.02em;
}

.ebc-summary-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: #756c5f;
    line-height: 1.45;
}

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

.ebc-summary-item {
    border: 1px solid #ece6d8;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ebc-summary-label {
    font-size: 12px;
    font-weight: 600;
    color: #6d6458;
}

.ebc-summary-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #2d2a26;
}

.ebc-summary-item.is-kpi .ebc-summary-value {
    font-size: 22px;
    color: #b58913;
}

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

.ebc-block-sub {
    margin: 0 0 10px;
    font-size: 12px;
    color: #7a7267;
}

.ebc-download-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ebc-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(72, 146, 103, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

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

.ebc-chart-wrap canvas {
    max-height: 280px;
}

.ebc-chart-fallback {
    margin: 10px 0 0;
    font-size: 12px;
    color: #9a6e00;
    background: #fff8e8;
    border: 1px solid #f1deaf;
    border-radius: 8px;
    padding: 10px;
}

.ebc-fallback-table-wrap {
    margin-top: 10px;
}

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

.ebc-fallback-table th,
.ebc-fallback-table td {
    border: 1px solid #ece6d8;
    padding: 8px 10px;
}

.ebc-fallback-table th {
    background: #faf7f0;
    color: #5f5a56;
    text-align: left;
    width: 58%;
}

.ebc-fallback-table td {
    text-align: right;
    font-weight: 700;
    color: #2d2a26;
}

.ebc-table-wrap {
    overflow-x: auto;
}

.ebc-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 12px;
}

.ebc-table th,
.ebc-table td {
    border: 1px solid #ece6d8;
    padding: 9px 10px;
    vertical-align: middle;
}

.ebc-table th {
    background: #faf7f0;
    color: #5f5a56;
    text-align: left;
    font-weight: 700;
}

.ebc-table td {
    color: #3a352e;
}

.ebc-table td:last-child {
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}

.ebc-empty-row td {
    text-align: center !important;
    color: #8d8579;
    font-weight: 500;
}

.ebc-waiting {
    text-align: center;
    padding: 40px 20px;
    color: #9e9a96;
}

.ebc-waiting i {
    font-size: 32px;
    color: #d4af37;
    opacity: 0.4;
    display: block;
    margin-bottom: 12px;
}

.ebc-waiting p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

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

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

@media (max-width: 900px) {
    .ebc-main-layout {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .ebc-input-col {
        max-width: 100%;
        overflow: hidden;
    }

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

@media (max-width: 768px) {
    .ebc-main-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

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

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

    .ebc-block-head {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

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

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

    .ebc-chart-wrap canvas {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .ebc-main-layout,
    .ebc-input-col,
    .ebc-result-col,
    .ebc-section,
    .ebc-result-summary,
    .ebc-chart-section,
    .ebc-table-section {
        max-width: 100%;
        box-sizing: border-box;
    }

    .ebc-section,
    .ebc-result-summary,
    .ebc-chart-section,
    .ebc-table-section {
        padding: 14px;
    }

    .ebc-summary-value {
        font-size: 16px;
    }

    .ebc-summary-item.is-kpi .ebc-summary-value {
        font-size: 19px;
    }

    .ebc-main-value {
        font-size: 26px;
    }

    .ebc-input-group .ebc-amount-wrap input.ebc-input[type="text"] {
        padding: 10px;
    }

    .ebc-amount-wrap .ebc-unit {
        min-width: 60px;
        padding: 0 10px;
        font-size: 11px;
    }

    .ebc-btn-group {
        flex-direction: column;
        align-items: stretch;
    }

    .ebc-table {
        min-width: 520px;
    }
}

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

    .ebc-section:hover,
    .ebc-result-summary:hover,
    .ebc-chart-section:hover,
    .ebc-table-section:hover,
    .ebc-btn:hover {
        transform: none !important;
    }
}
