/* ==========================================================================
   Shared components for the business-first pages: quote check, bill upload,
   power audit, tenders, service request, finance, calculators, local pages.
   Loaded after styles.css on those pages only.
   ========================================================================== */

.page-header p {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.page-header .hero-buttons {
    justify-content: center;
    margin-top: 1.5rem;
}

.prose {
    max-width: 760px;
    margin: 0 auto;
}

.prose h2 {
    margin: 2.5rem 0 1rem;
}

.prose h3 {
    margin: 1.75rem 0 0.75rem;
}

.prose ul,
.prose ol {
    margin: 0 0 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prose ul {
    list-style: disc;
}

.prose ol {
    list-style: decimal;
}

.prose li {
    color: rgba(255, 255, 255, 0.9);
    padding-left: 0.25rem;
}

.prose a,
.text-link {
    color: #7DD3FC;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.prose a:hover,
.text-link:hover {
    color: var(--secondary-gold);
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 3rem;
    align-items: start;
}

@media (max-width: 900px) {
    .split {
        /* minmax(0, …) so a long select option can't widen the column */
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }
}

.panel {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}

.panel h2,
.panel h3 {
    margin-bottom: 1rem;
}

@media (max-width: 576px) {
    .panel {
        padding: 1.25rem;
    }
}

/* Numbered checklist (quote check, audit contents) */
.checklist {
    counter-reset: check;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.checklist > li {
    counter-increment: check;
    position: relative;
    padding: 1rem 1rem 1rem 3.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: var(--radius-md);
}

.checklist > li::before {
    content: counter(check);
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 179, 0, 0.14);
    color: var(--secondary-gold);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.875rem;
}

.checklist h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.25rem;
}

.checklist p {
    margin: 0;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.82);
}

.checklist .ask {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: #BAE6FD;
}

/* Plain tick list */
.ticks {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.ticks li {
    position: relative;
    padding-left: 1.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.ticks li::before {
    content: '';
    position: absolute;
    left: 0.125rem;
    top: 0.45em;
    width: 0.8rem;
    height: 0.45rem;
    border-left: 2px solid #34D399;
    border-bottom: 2px solid #34D399;
    transform: rotate(-45deg);
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    counter-reset: step;
}

.steps > li {
    counter-increment: step;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.steps > li::before {
    content: 'Step ' counter(step);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--secondary-gold);
}

.steps h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.375rem;
}

.steps p {
    font-size: 0.9375rem;
    margin: 0;
}

/* Source / as-of notes */
.note {
    border-left: 3px solid var(--secondary-gold);
    background: rgba(255, 179, 0, 0.07);
    padding: 0.875rem 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.88);
    margin: 1.25rem 0;
}

.note p {
    margin: 0;
    font-size: inherit;
}

.note p + p {
    margin-top: 0.5rem;
}

.source-list {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75);
}

.source-list li {
    margin-bottom: 0.375rem;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.72);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table caption {
    text-align: left;
    padding: 1rem 1.25rem 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1.25rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    color: rgba(255, 255, 255, 0.9);
}

.data-table thead th {
    background: rgba(30, 41, 59, 0.9);
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--white);
    white-space: nowrap;
}

.data-table tbody th {
    font-weight: 700;
    color: var(--white);
}

.data-table tbody tr:last-child > * {
    border-bottom: none;
}

.data-table td.num,
.data-table th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Buttons */
.btn-wa {
    background: #25D366;
    color: #052E16;
    border: none;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
}

.btn-wa:hover {
    background: #3BE07A;
    transform: translateY(-2px);
}

.btn-wa svg {
    width: 20px;
    height: 20px;
}

.btn:focus-visible,
.text-link:focus-visible,
.prose a:focus-visible {
    outline: 2px solid var(--secondary-gold);
    outline-offset: 3px;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

@media (max-width: 480px) {
    .btn-row .btn {
        width: 100%;
    }
}

/* Calculators */
.calc {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 2rem;
    align-items: start;
}

@media (max-width: 960px) {
    .calc {
        grid-template-columns: 1fr;
    }
}

.calc fieldset {
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem 1.25rem;
    margin: 0 0 1.25rem;
}

.calc legend {
    padding: 0 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--white);
}

.calc .form-group {
    margin-bottom: 1rem;
}

.calc .form-group:last-child {
    margin-bottom: 0;
}

.calc .form-group label {
    font-size: 0.9375rem;
}

.calc .unit-input {
    display: flex;
    align-items: stretch;
}

.calc .unit-input .form-control {
    flex: 1;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.calc .unit-input span {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: rgba(30, 41, 59, 0.9);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    white-space: nowrap;
}

.assumption {
    display: block;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: var(--radius-md);
    padding: 1rem 1.125rem;
}

.result dt {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 0.25rem;
}

.result dd {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.result dd small {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.estimate-flag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    background: rgba(255, 179, 0, 0.12);
    color: var(--secondary-gold);
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 160px;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    margin-bottom: 0.5rem;
    position: relative;
}

.chart-bars .bar {
    flex: 1;
    min-width: 2px;
    border-radius: 2px 2px 0 0;
    background: #38BDF8;
}

.chart-bars .bar.neg {
    background: #F87171;
}

/* Days-left line (B19) */
/* Print: the checklist and calculator results print cleanly on A4 */
.print-only {
    display: none;
}

@media print {
    @page {
        size: A4;
        margin: 14mm;
    }

    body {
        background: #FFFFFF !important;
        color: #111827 !important;
    }

    body::before,
    body::after,
    .header,
    .footer,
    .sticky-contact,
    .scroll-to-top,
    .no-print,
    .cta,
    form {
        display: none !important;
    }

    .print-only {
        display: block;
    }

    .page-header {
        padding: 0 0 1rem !important;
        text-align: left;
    }

    .page-header::before,
    .page-header::after {
        display: none !important;
    }

    .section {
        padding: 0.5rem 0 !important;
    }

    h1,
    h2,
    h3,
    p,
    li,
    th,
    td,
    dt,
    dd,
    .note,
    .assumption,
    .checklist .ask {
        color: #111827 !important;
    }

    .checklist > li,
    .panel,
    .result,
    .table-wrap,
    .steps > li {
        background: #FFFFFF !important;
        border: 1px solid #9CA3AF !important;
        break-inside: avoid;
    }

    .checklist > li::before {
        content: '\2610';
        background: none;
        color: #111827;
        font-size: 1.25rem;
    }

    .data-table thead th {
        background: #F3F4F6 !important;
        color: #111827 !important;
    }

    .chart-bars .bar {
        background: #6B7280 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    a {
        color: #111827 !important;
        text-decoration: none !important;
    }
}
