/* ══════════════════════════════════════════════════════════════════════════════
   QuickBill Tools — Shared Styles
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Tool Container ── */
.qbt-tool {
    max-width: 660px;
    margin: 28px auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 32px 28px;
    font-family: inherit;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

/* ── Header ── */
.qbt-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.qbt-header-icon {
    display: inline-flex;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--qbt-accent, #1e9bd7);
    color: #fff;
    font-size: 26px;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.qbt-header-title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin: 0 0 4px;
}

.qbt-header-sub {
    font-size: 13px;
    color: #777;
    margin: 0;
    line-height: 1.5;
}

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

.qbt-field {
    margin-bottom: 18px;
}

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

.qbt-label-hint {
    font-weight: 400;
    color: #888;
    font-size: 12px;
    margin-left: 4px;
}

.qbt-input,
.qbt-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #222;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.qbt-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.qbt-input::placeholder {
    color: #aaa;
}

.qbt-input:focus,
.qbt-select:focus {
    border-color: var(--qbt-accent, #1e9bd7);
}

/* ── Two-column field row ── */
.qbt-row {
    display: flex;
    gap: 14px;
}

.qbt-row .qbt-field {
    flex: 1;
}

/* ── Checkbox row ── */
.qbt-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 18px;
}

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

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

/* ── Appliance checklist grid ── */
.qbt-appliance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.qbt-appliance-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.qbt-appliance-item:hover {
    border-color: var(--qbt-accent, #1e9bd7);
    background: rgba(30, 155, 215, 0.03);
}

.qbt-appliance-item--selected {
    border-color: var(--qbt-accent, #1e9bd7);
    background: rgba(30, 155, 215, 0.06);
}

.qbt-appliance-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--qbt-accent, #1e9bd7);
    cursor: pointer;
}

.qbt-appliance-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.qbt-appliance-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.qbt-appliance-watts {
    font-size: 11px;
    color: #888;
}

.qbt-appliance-qty {
    width: 40px;
    padding: 4px 6px;
    font-size: 13px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    outline: none;
}

.qbt-appliance-qty:focus {
    border-color: var(--qbt-accent, #1e9bd7);
}

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

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

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

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

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

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

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

/* ── Highlight cards row ── */
.qbt-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.qbt-highlight {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px 12px;
    text-align: center;
}

.qbt-highlight-icon {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.qbt-highlight-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--qbt-accent, #1e9bd7);
    display: block;
    letter-spacing: -0.3px;
}

.qbt-highlight-label {
    font-size: 11px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
    display: block;
}

/* ── Section titles in result ── */
.qbt-section {
    margin-bottom: 20px;
}

.qbt-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 ── */
.qbt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

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

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

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

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

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

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

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

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

.qbt-total-sub {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 4px;
}

/* ── Comparison bars ── */
.qbt-bar-wrap {
    margin-bottom: 18px;
}

.qbt-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.qbt-bar-label {
    width: 80px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    text-align: right;
    flex-shrink: 0;
}

.qbt-bar-track {
    flex: 1;
    height: 28px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.qbt-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--qbt-accent, #1e9bd7);
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    transition: width 0.6s ease;
    min-width: 40px;
}

.qbt-bar-fill--alt {
    background: #e65100;
}

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

.qbt-disclaimer p {
    margin: 0;
}

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

/* ── Converter specific ── */
.qbt-converter-result {
    text-align: center;
    padding: 24px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
}

.qbt-converter-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--qbt-accent, #1e9bd7);
    display: block;
    margin-bottom: 4px;
}

.qbt-converter-formula {
    font-size: 13px;
    color: #777;
    font-style: italic;
}

/* ── Tariff comparison table ── */
.qbt-tariff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    overflow-x: auto;
    display: block;
}

.qbt-tariff-table th,
.qbt-tariff-table td {
    padding: 8px 10px;
    text-align: center;
    border: 1px solid #eee;
    white-space: nowrap;
}

.qbt-tariff-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
}

.qbt-tariff-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    background: #fafafa;
}

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

@media (max-width: 600px) {
    .qbt-tool {
        padding: 22px 16px;
        margin: 16px auto;
        border-radius: 8px;
    }

    .qbt-row {
        flex-direction: column;
        gap: 0;
    }

    .qbt-submit {
        width: 80%;
    }

    .qbt-highlights {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .qbt-appliance-grid {
        grid-template-columns: 1fr;
    }

    .qbt-bar-label {
        width: 60px;
        font-size: 11px;
    }

    .qbt-converter-value {
        font-size: 26px;
    }

    .qbt-tariff-table {
        font-size: 11px;
    }

    .qbt-tariff-table th,
    .qbt-tariff-table td {
        padding: 6px 6px;
    }
}

@media print {
    .qbt-form {
        display: none;
    }
    .qbt-tool {
        border: 1px solid #ccc;
        box-shadow: none;
    }
    .qbt-result {
        opacity: 1;
        transform: none;
    }
}
