/* ══════════════════════════════════════════════════════════════════════════════
   QuickBill Calculator — Styles
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Calculator Container ── */
.qbc-calculator {
    max-width: 620px;
    margin: 28px auto;
    background: #fff;
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 30px 28px;
    font-family: inherit;
}

/* ── Header ── */
.qbc-calc-header {
    text-align: center;
    margin-bottom: 24px;
}

.qbc-calc-header-icon {
    display: inline-block;
    font-size: 28px;
    margin-bottom: 4px;
}

.qbc-calc-header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--qbc-accent, #1e9bd7);
    margin: 0 0 4px;
}

.qbc-calc-header-sub {
    font-size: 13px;
    color: #777;
    margin: 0;
}

/* ── Form ── */
.qbc-calc-form {
    padding: 0;
}

.qbc-calc-field {
    margin-bottom: 16px;
}

.qbc-calc-field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.qbc-calc-units,
.qbc-calc-fpa {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #222;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.qbc-calc-units::placeholder,
.qbc-calc-fpa::placeholder {
    color: #999;
}

.qbc-calc-units:focus,
.qbc-calc-fpa:focus {
    border-color: var(--qbc-accent, #1e9bd7);
}

/* ── Protected consumer checkbox ── */
.qbc-calc-checkbox-row {
    display: flex;
    justify-content: center;
    margin: 14px 0 18px;
}

.qbc-calc-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.qbc-calc-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--qbc-accent, #1e9bd7);
}

.qbc-calc-protected-note {
    font-size: 12px;
    color: #e65100;
    margin: 8px 0 0;
    padding: 6px 10px;
    background: #fff3e0;
    border-radius: 4px;
}

/* ── Calculate button ── */
.qbc-calc-submit {
    display: block;
    width: 60%;
    margin: 0 auto;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: var(--qbc-accent, #1e9bd7);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.qbc-calc-submit:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.qbc-calc-submit:active {
    transform: translateY(0);
}

/* ── Source links ── */
.qbc-calc-sources {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fafafa;
    font-size: 12px;
    line-height: 1.5;
}

.qbc-calc-sources-title {
    margin: 0 0 6px;
    font-weight: 700;
    color: #555;
}

.qbc-calc-sources ul {
    margin: 0;
    padding-left: 18px;
}

.qbc-calc-sources a {
    color: var(--qbc-accent, #1e9bd7);
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESULT AREA
   ══════════════════════════════════════════════════════════════════════════════ */

.qbc-calc-result {
    margin-top: 24px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.qbc-calc-result[hidden] {
    display: none;
}

.qbc-calc-result--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Consumer badge ── */
.qbc-calc-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.qbc-calc-badge--protected {
    background: #e8f5e9;
    color: #2e7d32;
}

.qbc-calc-badge--standard {
    background: #e3f2fd;
    color: #1565c0;
}

/* ── Section titles ── */
.qbc-calc-section {
    margin-bottom: 20px;
}

.qbc-calc-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

/* ── Tables ── */
.qbc-calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.qbc-calc-table th,
.qbc-calc-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.qbc-calc-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.qbc-calc-table tbody td:last-child,
.qbc-calc-table thead th:last-child {
    text-align: right;
}

.qbc-calc-table tfoot th {
    padding-top: 10px;
    font-size: 14px;
    color: #222;
}

.qbc-calc-table tfoot th:last-child {
    text-align: right;
    color: var(--qbc-accent, #1e9bd7);
}

/* Summary table (Other charges) */
.qbc-calc-table--summary td:last-child {
    text-align: right;
    font-weight: 500;
}

/* ── Grand total box ── */
.qbc-calc-total {
    background: var(--qbc-accent, #1e9bd7);
    color: #fff;
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

.qbc-calc-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qbc-calc-total-label {
    font-size: 15px;
    font-weight: 600;
}

.qbc-calc-total-amount {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.qbc-calc-per-unit {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 6px;
}

/* ── Disclaimer ── */
.qbc-calc-disclaimer {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    padding: 12px 14px;
    background: #fafafa;
    border-radius: 4px;
    border: 1px solid #eee;
}

.qbc-calc-disclaimer p {
    margin: 0;
}

/* ── Error state ── */
.qbc-calc-error {
    text-align: center;
    color: #e53935;
    font-size: 14px;
    padding: 14px;
    background: #ffebee;
    border-radius: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .qbc-calculator {
        padding: 22px 16px;
    }

    .qbc-calc-submit {
        width: 80%;
    }

    .qbc-calc-total-row {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }

    .qbc-calc-total-amount {
        font-size: 22px;
    }

    .qbc-calc-table {
        font-size: 13px;
    }

    .qbc-calc-table th,
    .qbc-calc-table td {
        padding: 6px 6px;
    }
}

/* ── Print styles ── */
@media print {
    .qbc-calc-form {
        display: none;
    }

    .qbc-calculator {
        border: 1px solid #ccc;
        box-shadow: none;
    }

    .qbc-calc-result {
        opacity: 1;
        transform: none;
    }
}
