/* assets/css/estimate.css */

:root {
    --green-main: #166534;
    --green-dark: #14532d;
    --green-soft: #e5f3ea;
    --green-soft-alt: #ecfdf3;
    --border-soft: #d4dde7;
    --border-green-soft: #bbf7d0;
    --text-main: #111827;
    --text-muted: #6b7280;
    --bg-page: #e5f3ea;
    --bg-card: #ffffff;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
    --radius-card: 18px;
    --radius-pill: 999px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.estimate-body {
    margin: 0;
    padding: 24px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
}

/* Layout */

.estimate-page {
    max-width: 1120px;
    margin: 0 auto 40px;
}

.estimate-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.estimate-logo {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--green-main);
    margin-bottom: 6px;
}

.estimate-header h1 {
    margin: 0 0 4px;
    font-size: 24px;
    color: var(--green-dark);
}

.estimate-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.estimate-brand-chip {
    background: var(--green-soft);
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid #cfead7;
    font-size: 11px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    white-space: nowrap;
}

.estimate-brand-chip span {
    color: var(--text-muted);
}

.estimate-brand-chip strong {
    color: var(--green-dark);
    font-size: 12px;
}

/* Main card */

.estimate-main-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 20px 22px 24px;
    box-shadow: var(--shadow-soft);
}

/* Summary section */

.estimate-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.summary-main {
    flex: 1 1 260px;
    padding: 16px 18px;
    background: var(--green-soft-alt);
    border-radius: 12px;
    border: 1px solid var(--border-green-soft);
}

.summary-label {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.summary-range {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 650;
    color: var(--green-dark);
}

.summary-note {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.summary-side {
    flex: 1 1 220px;
    font-size: 13px;
    color: var(--text-muted);
}

.summary-list {
    margin: 0 0 6px;
    padding: 0;
}

.summary-list > div {
    margin-bottom: 4px;
}

.summary-list dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.summary-list dd {
    margin: 0;
    font-size: 13px;
    color: var(--text-main);
}

.summary-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: var(--green-soft);
    font-size: 11px;
    color: var(--green-main);
}

/* Table */

.estimate-table-section {
    margin-top: 6px;
}

.section-title {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--green-dark);
}

.estimate-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: #f9fafb;
}

.estimate-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    background: #ffffff;
}

.estimate-table th,
.estimate-table td {
    padding: 7px 8px;
    font-size: 12px;
    text-align: left;
    border-bottom: 1px solid #edf0f5;
}

.estimate-table thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    background: #f3f4ff;
}

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

.estimate-table .col-item {
    width: 40%;
}

.item-label {
    display: block;
    font-weight: 500;
    color: var(--text-main);
}

.item-note {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Totals */

.totals-block {
    margin-top: 12px;
    font-size: 13px;
}

.totals-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}

.totals-line span {
    color: var(--text-muted);
}

.totals-line strong {
    color: var(--text-main);
}

.totals-line--highlight strong {
    color: var(--green-dark);
}

/* Lead / form */

.estimate-lead {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--border-soft);
}

.lead-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
    color: var(--green-dark);
}

.lead-header p {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-muted);
}

.lead-form {
    margin-top: 2px;
}

.field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.field {
    flex: 1 1 200px;
}

.field label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: #374151;
}

.field label span {
    color: #dc2626;
}

.field input {
    width: 100%;
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    font-size: 14px;
    outline: none;
}

.field input:focus {
    border-color: var(--green-main);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18);
}

/* Buttons */

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--green-main);
    color: #ffffff;
}

.btn-primary:hover {
    background: #15803d;
}

.btn-outline {
    background: #ffffff;
    border: 1px solid var(--green-main);
    color: var(--green-main);
}

.btn-outline:hover {
    background: var(--green-soft);
}

.fine-print {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Footer nav */

.estimate-footer-nav {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.back-link {
    color: var(--green-main);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.footer-brand {
    font-size: 12px;
    color: var(--text-muted);
}

/* Responsive */

@media (max-width: 900px) {
    body.estimate-body {
        padding: 16px;
    }
    .estimate-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .estimate-brand-chip {
        align-self: flex-start;
    }
}

@media (max-width: 720px) {
    body.estimate-body {
        padding: 12px;
    }
    .estimate-main-card {
        padding: 16px 14px 20px;
    }
    .estimate-summary {
        flex-direction: column;
    }
    .estimate-footer-nav {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .estimate-page {
        margin-bottom: 24px;
    }
    .estimate-header h1 {
        font-size: 20px;
    }
    .summary-range {
        font-size: 20px;
    }
    .estimate-table {
        min-width: 520px;
    }
}
