/*
 * quotation.css
 * Styles for the Thermexa Dynamic Quotation Generator
 * ---------------------------------------------------
 * Sections:
 *   1. Section wrapper
 *   2. Step indicator (stepper)
 *   3. Panel container & animation
 *   4. Panel title
 *   5. Form grid & inputs
 *   6. Checkboxes
 *   7. Step navigation buttons
 *   8. Product selection cards
 *   9. Quotation document actions bar
 *  10. Quotation document (printable)
 *      10a. Letterhead header
 *      10b. Company info bar
 *      10c. Title bar & meta
 *      10d. Bill To / Site parties
 *      10e. Scope of work table
 *      10f. Material note
 *      10g. Performance metrics grid
 *      10h. Technical specifications grid
 *      10i. Terms & Conditions
 *      10j. Signature row
 *      10k. Document footer
 *  11. Print media query
 *  12. Responsive (mobile)
 */

/* ============================================================
   1. SECTION WRAPPER
   ============================================================ */
.quotation-section {
    background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 60%, #fff7ed 100%);
    padding: .5rem 0;
}

/* ============================================================
   2. STEP INDICATOR (STEPPER)
   ============================================================ */
.quote-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 2.5rem auto 3rem;
    max-width: 680px;
    flex-wrap: nowrap;
}

.quote-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.step-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
    border: 2px solid #e2e8f0;
}

.quote-step-item.active .step-circle,
.quote-step-item.completed .step-circle {
    background: var(--gradient-vibrant);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-align: center;
    white-space: nowrap;
}

.quote-step-item.active .step-label,
.quote-step-item.completed .step-label {
    color: var(--primary-color);
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 8px;
    margin-bottom: 20px;
    transition: background 0.3s;
    min-width: 30px;
}

.step-line.active {
    background: var(--primary-color);
}

/* ============================================================
   3. PANEL CONTAINER & ANIMATION
   ============================================================ */
.quote-forms-container {
    max-width: 900px;
    margin: 0 auto;
}

.quote-step-panel {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    animation: qPanelIn 0.4s ease;
}

.quote-step-panel.active {
    display: block;
}

@keyframes qPanelIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   4. PANEL TITLE
   ============================================================ */
.qpanel-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1.8rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.qpanel-title i {
    color: var(--primary-color);
}

/* ============================================================
   5. FORM GRID & INPUTS
   ============================================================ */
.quote-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.quote-form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.quote-form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.quote-form-grid label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.qreq {
    color: #ef4444;
}

.quote-form-grid input,
.quote-form-grid select,
.quote-form-grid textarea {
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
    color: var(--dark-color);
}

.quote-form-grid input:focus,
.quote-form-grid select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    background: white;
}

/* ============================================================
   6. CHECKBOXES
   ============================================================ */
.qcheckbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.qcheckbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.9rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s;
    background: #fafafa;
}

.qcheckbox-item:hover {
    border-color: var(--primary-color);
    background: #f0f4ff;
}

.qcheckbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.qcheckbox-item span {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.5;
}

/* ============================================================
   7. STEP NAVIGATION BUTTONS
   ============================================================ */
.qstep-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f1f5f9;
    gap: 1rem;
}

.btn-outline-dark {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-outline-dark:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f4ff;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35);
}

/* ============================================================
   8. PRODUCT SELECTION CARDS
   ============================================================ */
.product-sel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.product-sel-card {
    border: 2.5px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    text-align: center;
    background: white;
}

.product-sel-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-sel-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0f4ff, #faf5ff);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), var(--shadow-lg);
}

.product-sel-card.popular {
    border-color: var(--accent-color);
}

.product-sel-card.popular.selected {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, #fff7ed, #fff);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2), var(--shadow-lg);
}

.psel-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.psel-badge.pop {
    background: var(--accent-color);
}

.psel-icon {
    width: 56px;
    height: 56px;
    margin: 0.5rem auto 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
}

.product-sel-card.popular .psel-icon {
    background: var(--gradient-orange);
}

.product-sel-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.product-sel-card p {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.psel-specs {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.psel-specs li {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.psel-specs li span {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.psel-specs li strong {
    font-size: 0.85rem;
    color: var(--dark-color);
    font-weight: 700;
}

.psel-rate {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-color);
    background: #f0f4ff;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    display: inline-block;
}

.product-sel-card.popular .psel-rate {
    color: var(--accent-color);
    background: #fff7ed;
}

/* ============================================================
   9. QUOTATION DOC ACTIONS BAR
   ============================================================ */
.quote-doc-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    align-items: center;
}

/* ============================================================
   10. QUOTATION DOCUMENT (printable)
   ============================================================ */
.quotation-doc {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
}

/* 10a. Letterhead header */
.qdoc-header {
    background: #0f172a;
    color: white;
    padding: 1.75rem 2rem 1.25rem;
}

.qdoc-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.qdoc-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: white;
    border-radius: 10px;
    padding: 4px;
}

.qdoc-brand-text h1 {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 1px;
    margin: 0;
    color: white;
}

.qdoc-brand-text p {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: #94a3b8;
    margin: 0;
    text-transform: uppercase;
}

.qdoc-cert-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.qdoc-cert-row span {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    color: #cbd5e1;
    text-transform: uppercase;
}

/* 10b. Company info bar */
.qdoc-company-bar {
    background: var(--primary-color);
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 0.6rem 2rem;
}

.qdoc-company-bar span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.qdoc-company-bar i {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}

/* 10c. Title bar & meta */
.qdoc-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: #f8fafc;
    border-bottom: 2px solid var(--primary-color);
    gap: 1rem;
    flex-wrap: wrap;
}

.qdoc-titlebar h2 {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--dark-color);
    margin: 0;
}

.qdoc-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.qdoc-meta-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

.qdoc-meta-item label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    font-weight: 600;
}

.qdoc-meta-item span {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* 10d. Bill To / Site parties */
.qdoc-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid #e2e8f0;
}

.qdoc-party {
    padding: 1.5rem 2rem;
}

.qdoc-party:first-child {
    border-right: 1px solid #e2e8f0;
}

.qdoc-party h4 {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.qdoc-party p {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.6;
    margin: 0.15rem 0;
}

/* 10e. Scope of work table */
.qdoc-table-wrapper {
    padding: 0 2rem 0.5rem;
    overflow-x: auto;
}

.qdoc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.qdoc-table thead tr {
    background: #0f172a;
    color: white;
}

.qdoc-table thead th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.qdoc-table thead th:last-child,
.qdoc-table thead th:nth-child(3),
.qdoc-table thead th:nth-child(4) {
    text-align: right;
}

.qdoc-table tbody tr:nth-child(even) { background: #f8fafc; }
.qdoc-table tbody tr:hover            { background: #f0f4ff; }

.qdoc-table tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-color);
    vertical-align: top;
}

.qdoc-table tbody td:last-child,
.qdoc-table tbody td:nth-child(3),
.qdoc-table tbody td:nth-child(4) {
    text-align: right;
    white-space: nowrap;
}

.qdoc-table tbody td .td-desc-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.2rem;
    display: block;
}

.qdoc-table tfoot td {
    padding: 0.7rem 1rem;
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-color);
    border-top: 1px solid #e2e8f0;
}

.qdoc-table tfoot td:first-child { text-align: left; }

.qdoc-table .qdoc-subtotal td {
    border-top: 2px solid #e2e8f0;
    font-weight: 600;
    color: var(--dark-color);
}

.qdoc-table .qdoc-total td {
    border-top: 2px solid var(--primary-color);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 1rem;
    font-weight: 800;
}

/* 10f. Material note */
.qdoc-material-note {
    margin: 0.75rem 2rem;
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: #065f46;
    line-height: 1.6;
}

/* 10g. Performance metrics grid */
.qdoc-performance {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.qdoc-performance h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qdoc-perf-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
}

.qdoc-perf-card {
    background: white;
    border-radius: 10px;
    padding: 1rem 0.75rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.qdoc-perf-card i      { font-size: 1.3rem; color: var(--primary-color); }
.qdoc-perf-card strong { font-size: 0.95rem; font-weight: 800; color: var(--dark-color); line-height: 1.2; }
.qdoc-perf-card span   { font-size: 0.65rem; color: #64748b; text-align: center; line-height: 1.3; }

/* 10h. Technical specifications grid */
.qdoc-specs {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.qdoc-specs h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #0f172a;
    font-weight: 800;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qdoc-specs h4 i { color: var(--primary-color); }

.qdoc-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.qdoc-specs-grid div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.82rem;
    gap: 1rem;
}

.qdoc-specs-grid div:nth-child(odd)      { border-right: 1px solid #f1f5f9; }
.qdoc-specs-grid div span:first-child    { color: #64748b; font-weight: 500; white-space: nowrap; }
.qdoc-specs-grid div span:last-child     { color: var(--dark-color); font-weight: 600; text-align: right; }

/* 10i. Terms & Conditions */
.qdoc-terms {
    padding: 1.5rem 2rem;
    background: #fffbeb;
    border-bottom: 1px solid #e2e8f0;
    border-top: 3px solid #fbbf24;
}

.qdoc-terms h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #92400e;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.qdoc-terms ol { padding-left: 1.2rem; margin: 0; }

.qdoc-terms ol li {
    font-size: 0.8rem;
    color: #78350f;
    line-height: 1.6;
    margin-bottom: 0.3rem;
}

/* 10j. Signature row */
.qdoc-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 2rem 3rem;
    border-bottom: 1px solid #e2e8f0;
}

.qdoc-sign-block {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.qdoc-sign-line {
    width: 100%;
    height: 1.5px;
    background: #334155;
    margin-bottom: 0.4rem;
}

.qdoc-sign-block p      { font-size: 0.78rem; color: #64748b; margin: 0; }
.qdoc-sign-block strong { font-size: 0.85rem; color: var(--dark-color); }

/* 10k. Document footer */
.qdoc-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 1rem 2rem;
    text-align: center;
}

.qdoc-footer-certs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.qdoc-footer-certs span {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #64748b;
    text-transform: uppercase;
}

.qdoc-footer p { font-size: 0.72rem; margin: 0.25rem 0; color: #64748b; }

.qdoc-disclaimer {
    font-style: italic;
    font-size: 0.65rem !important;
    color: #475569 !important;
}

/* ============================================================
   11. PRINT MEDIA QUERY
   ============================================================ */
@media print {
    /* Hide every direct child of body EXCEPT the quotation placeholder */
    body > *:not(#quotation-placeholder) {
        display: none !important;
    }

    /* Make the placeholder and its ancestors visible */
    #quotation-placeholder,
    .quotation-section {
        display: block !important;
    }

    /* Hide the non-document parts inside the quotation section */
    .quotation-section .section-header,
    .quote-stepper,
    .quote-forms-container > .quote-step-panel:not(#qPanel4),
    .quote-doc-actions {
        display: none !important;
    }

    /* Show step 4 cleanly */
    #qPanel4 {
        display: block !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }

    .quotation-doc {
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .qdoc-perf-grid { grid-template-columns: repeat(3, 1fr) !important; }

    /* Avoid page breaks inside critical rows */
    .qdoc-signatures,
    .qdoc-footer,
    .qdoc-terms,
    tr {
        page-break-inside: avoid;
    }
}

/* ============================================================
   12. RESPONSIVE (MOBILE ≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    /* Stepper */
    .quote-stepper  { gap: 0; padding: 0 0.5rem; }
    .step-line      { min-width: 15px; }
    .step-label     { font-size: 0.65rem; }
    .step-circle    { width: 38px; height: 38px; font-size: 0.85rem; }

    /* Panel */
    .quote-step-panel { padding: 1.5rem; }

    /* Form grid */
    .quote-form-grid                         { grid-template-columns: 1fr; }
    .quote-form-grid .form-group.full-width  { grid-column: 1; }

    /* Products */
    .product-sel-grid { grid-template-columns: 1fr; gap: 2rem; }

    /* Quotation document */
    .qdoc-parties                         { grid-template-columns: 1fr; }
    .qdoc-party:first-child               { border-right: none; border-bottom: 1px solid #e2e8f0; }
    .qdoc-perf-grid                       { grid-template-columns: repeat(3, 1fr); }
    .qdoc-specs-grid                      { grid-template-columns: 1fr; }
    .qdoc-specs-grid div:nth-child(odd)   { border-right: none; }
    .qdoc-signatures                      { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem; }
    .qdoc-company-bar                     { flex-direction: column; gap: 0.4rem; }
    .qdoc-meta                            { justify-content: flex-start; }
    .qdoc-meta-item                       { align-items: flex-start; }
    .qdoc-titlebar                        { flex-direction: column; align-items: flex-start; }
    .quote-doc-actions                    { justify-content: flex-start; }
    .qdoc-table-wrapper                   { padding: 0 1rem 0.5rem; }
    .qdoc-performance,
    .qdoc-specs,
    .qdoc-terms,
    .qdoc-footer                          { padding: 1rem; }
    .qdoc-parties .qdoc-party             { padding: 1rem; }
}
