/* ==========================================================================
   [AI]LABS — Page Components
   Custom section patterns and components from the Design System spec.
   Loaded after brand.css. Uses its custom properties.
   ========================================================================== */


/* ==========================================================================
   1. WORKBENCH — Hero split layout
   ========================================================================== */

.workbench {
    display: grid;
    grid-template-columns: 55% 1fr;
    gap: var(--sp-xl);
    align-items: center;
    position: relative;
    z-index: 1;
}

.workbench-readout {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}


/* ==========================================================================
   2. READOUT — Diagnostic data card (hero)
   ========================================================================== */

.readout {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-lg);
    width: 100%;
    max-width: 380px;
}

.readout-row {
    display: flex;
    align-items: baseline;
    gap: var(--sp-xs);
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.readout-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.readout-row:first-child {
    padding-top: 0;
}

.readout-prefix {
    display: none;  /* '//' prefix removed for a cleaner look */
}

.readout-value {
    font-family: var(--font-mono);
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: var(--orange);
    min-width: 64px;
}

.readout-label {
    font-size: 0.875rem;
    color: var(--text-40);
}


/* ==========================================================================
   3. SCORECARD — Audit diagnostic bars
   ========================================================================== */

.scorecard {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
}

.scorecard-item {
    padding-bottom: var(--sp-md);
    border-bottom: 1px solid var(--border-subtle);
}

.scorecard-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.scorecard-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--sp-xs);
}

.scorecard-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-40);
}

.scorecard-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--orange);
}

.scorecard-bar {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: var(--sp-xs);
    overflow: hidden;
}

.scorecard-fill {
    height: 100%;
    background: var(--orange);
    border-radius: 2px;
}

.scorecard-desc {
    font-size: 0.875rem;
    color: var(--text-body);
    line-height: 1.5;
}


/* ==========================================================================
   4. ROADMAP — Horizontal process rail
   ========================================================================== */

.roadmap {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: start;
    gap: 0;
}

.roadmap-phase {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-md);
}

.roadmap-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--sp-xs);
    align-self: center;
}

.roadmap-connector::after {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: var(--border-mid);
}

.roadmap-phase-header {
    margin-bottom: var(--sp-sm);
}

.roadmap-week {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.25rem;
}

.roadmap-phase-title {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-100);
    display: block;
}

.roadmap-tasks {
    margin-bottom: var(--sp-sm);
}

.roadmap-tasks li {
    font-size: 0.875rem;
    color: var(--text-body);
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.roadmap-tasks li:last-child {
    border-bottom: none;
}

.roadmap-tasks li::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--orange);
    margin-right: 0.75rem;
    margin-bottom: 0.18em;
    vertical-align: middle;
}


/* ==========================================================================
   5. SCENARIO CARD — Field report / work order
   ========================================================================== */

.scenario-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-xl);
    padding: var(--sp-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    margin-bottom: var(--sp-lg);
}

.scenario-card:last-child {
    margin-bottom: 0;
}

.scenario-footer {
    grid-column: 1 / -1;
    padding-top: var(--sp-sm);
    border-top: 1px solid var(--border-subtle);
}

.scenario-type {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    display: block;
    margin-bottom: var(--sp-sm);
}

.scenario-problem h4 {
    margin-bottom: var(--sp-xs);
}

.scenario-section-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-40);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: var(--sp-xs);
    margin-top: var(--sp-md);
}

.scenario-section-label:first-child {
    margin-top: 0;
}

.scenario-solution ul li {
    padding: var(--sp-xs) 0;
    color: var(--text-body);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9375rem;
}

.scenario-solution ul li:last-child {
    border-bottom: none;
}

.scenario-solution ul li::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--orange);
    margin-right: 0.75rem;
    margin-bottom: 0.18em;
    vertical-align: middle;
}


/* ==========================================================================
   6. AUDIT LAYOUT — Two-column text + scorecard
   ========================================================================== */

.audit-layout {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: var(--sp-2xl);
    align-items: start;
}

.audit-note {
    font-size: 0.8125rem;
    color: var(--text-40);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}


/* ==========================================================================
   7. ANTI-PITCH — Strikethrough trust builder
   ========================================================================== */

.anti-pitch {
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
    margin-top: var(--sp-xl);
}

.anti-pitch-struck {
    color: var(--text-40);
    font-size: 1.125rem;
    margin-bottom: var(--sp-xs);
}

.anti-pitch-struck del {
    text-decoration: line-through;
}

.anti-pitch-item > p:last-child {
    color: var(--text-body);
    font-size: 1rem;
    line-height: 1.6;
}


/* ==========================================================================
   7b. STEP SEQUENCE — Installation steps (how-it-works)
   Two-column work order: left = phase label + title + narrative,
   right = INPUT / OUTPUT mono lists. Reuses tokens only.
   ========================================================================== */

.step-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
    margin-top: var(--sp-xl);
}

.step-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--sp-xl);
    padding: var(--sp-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 2px solid var(--orange);
    border-radius: var(--radius);
    transition: border-color var(--ease);
}

.step-card:hover {
    border-color: var(--border-hover);
    border-top-color: var(--orange-h);
}

.step-phase {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    display: block;
    margin-bottom: var(--sp-sm);
}

.step-main h3 {
    margin-bottom: var(--sp-md);
}

.step-main p {
    color: var(--text-body);
    margin-bottom: var(--sp-sm);
}

.step-main p:last-child {
    margin-bottom: 0;
}

.step-io {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
}

.step-io-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-40);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: var(--sp-xs);
}

.step-io ul li {
    padding: var(--sp-xs) 0;
    color: var(--text-body);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.step-io ul li:last-child {
    border-bottom: none;
}

.step-io ul li::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--orange);
    margin-right: 0.75rem;
    margin-bottom: 0.18em;
    vertical-align: middle;
}


/* ==========================================================================
   8. DISPATCH — Left-aligned CTA section
   ========================================================================== */

.dispatch {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.dispatch-inner {
    display: grid;
    grid-template-columns: 65% 35%;
    gap: var(--sp-lg);
    align-items: center;
}

.dispatch-text .eyebrow {
    margin-bottom: var(--sp-sm);
}

.dispatch-text h2 {
    margin-bottom: var(--sp-xs);
}

.dispatch-text p {
    max-width: 480px;
}

.dispatch-action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.dispatch-caption {
    font-family: var(--font-mono);
    font-size: var(--type-caption);
    color: var(--text-25);
    margin-top: var(--sp-md);
    letter-spacing: 0.04em;
}


/* ==========================================================================
   8b. AUDIT REQUEST — Contact form page
   ========================================================================== */

.audit-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--sp-2xl);
    align-items: start;
}

.audit-form-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 2px solid var(--orange);
    border-radius: var(--radius);
    padding: var(--sp-lg);
}

.audit-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-sm);
}

.audit-form .form-grid .form-group {
    margin-bottom: 0;
}

.audit-form .form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-xs);
    margin-bottom: 0;
}

.audit-form .form-check input[type="checkbox"] {
    margin-top: 0.3rem;
    accent-color: var(--orange);
    cursor: pointer;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.audit-form .form-check label {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-40);
    line-height: 1.5;
    cursor: pointer;
}

/* Submit button with loading state */
.audit-form .form-submit {
    position: relative;
    overflow: hidden;
    margin-top: var(--sp-md);
}

.audit-form .btn-text {
    transition: opacity var(--ease);
}

.audit-form .btn-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.audit-form .form-submit.is-loading .btn-text {
    opacity: 0;
}

.audit-form .form-submit.is-loading .btn-loading {
    opacity: 1;
}

@keyframes audit-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.audit-form .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(250, 250, 249, .25);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: audit-spin .6s linear infinite;
}

/* Success / error replacement states */
.audit-result {
    text-align: center;
    padding: var(--sp-xl) var(--sp-md);
}

.audit-result .result-mark {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    color: var(--orange);
    display: block;
    margin-bottom: var(--sp-md);
    line-height: 1;
}

.audit-result h3 {
    margin-bottom: var(--sp-sm);
}

.audit-result p {
    color: var(--text-body);
    max-width: 420px;
    margin: 0 auto;
}

/* Right column — expectations */
.audit-aside {
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
}

.audit-aside .next-list {
    display: flex;
    flex-direction: column;
}

.audit-aside .next-step {
    display: flex;
    gap: var(--sp-sm);
    align-items: flex-start;
    padding: var(--sp-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.audit-aside .next-step:first-child { padding-top: 0; }

.audit-aside .next-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.audit-aside .step-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--orange);
    flex-shrink: 0;
    width: 20px;
    margin-top: 0.1rem;
}

.audit-aside .step-text {
    font-size: 0.9375rem;
    color: var(--text-body);
    line-height: 1.5;
}

.audit-aside .step-text strong {
    color: var(--text-100);
    font-weight: 700;
}

.audit-aside .reach-card .info-row {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: var(--sp-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.audit-aside .reach-card .info-row:first-of-type { padding-top: 0; }

.audit-aside .reach-card .info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.audit-aside .info-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-40);
}

.audit-aside .info-value {
    font-size: 0.9375rem;
    color: var(--text-100);
}

.audit-aside .info-value a {
    color: var(--text-100);
}

.audit-aside .info-value a:hover {
    color: var(--orange);
}


/* ==========================================================================
   8b. PRICING — Fee figures and included-list inside job-ticket cards
   ========================================================================== */

/* Monthly/period suffix that sits next to a price in a card heading */
.fee-period {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-40);
    letter-spacing: 0;
    margin-left: 0.5rem;
}

/* Large mono price used in comparison cards */
.fee-figure {
    font-family: var(--font-mono);
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-100);
    margin-bottom: var(--sp-sm);
}

/* What-you-get list inside a fee card (// prefix, matches roadmap/service) */
.fee-list {
    margin-top: var(--sp-sm);
}

.fee-list li {
    padding: var(--sp-xs) 0;
    color: var(--text-body);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9375rem;
}

.fee-list li:last-child {
    border-bottom: none;
}

.fee-list li::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--orange);
    margin-right: 0.75rem;
    margin-bottom: 0.18em;
    vertical-align: middle;
}


/* ==========================================================================
   9. RESPONSIVE — Tablet (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {

    .workbench {
        grid-template-columns: 1fr;
        gap: var(--sp-lg);
    }

    .workbench-readout {
        justify-content: flex-start;
    }

    .readout {
        max-width: 100%;
    }

    .roadmap {
        grid-template-columns: 1fr;
        gap: var(--sp-sm);
    }

    .roadmap-connector {
        padding: 0;
        justify-content: flex-start;
        padding-left: var(--sp-md);
    }

    .roadmap-connector::after {
        width: 1px;
        height: 24px;
    }

    .roadmap-phase {
        border-left: 2px solid var(--orange);
    }

    .scenario-card {
        grid-template-columns: 1fr;
        gap: var(--sp-lg);
        padding: var(--sp-lg);
    }

    .audit-layout {
        grid-template-columns: 1fr;
        gap: var(--sp-lg);
    }

    .dispatch-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--sp-lg);
    }

    .dispatch-text p {
        max-width: 100%;
    }

    .dispatch-action {
        justify-content: center;
    }

    .dispatch-caption {
        text-align: center;
    }

    .audit-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-lg);
    }

    .audit-aside {
        order: -1;
    }
}


/* ==========================================================================
   10. RESPONSIVE — Mobile (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {

    .readout {
        padding: var(--sp-md);
    }

    .readout-value {
        font-size: 1.125rem;
        min-width: 48px;
    }

    .roadmap-phase {
        padding: var(--sp-sm);
    }

    .scenario-card {
        padding: var(--sp-md);
    }

    .anti-pitch-struck {
        font-size: 1rem;
    }

    .dispatch-action .btn {
        width: 100%;
    }

    .audit-form-wrap {
        padding: var(--sp-md);
    }

    .audit-form .form-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   11. TAG VARIANTS — muted status tag (per Design System 5)
   ========================================================================== */

.tag-muted {
    color: var(--text-40);
    border-color: var(--border);
}

.tag-neutral {
    color: var(--text-body);
    border-color: var(--border-mid);
}


/* ==========================================================================
   13. LEGAL PAGES — privacy / terms prose
   ========================================================================== */

.legal-body {
    max-width: var(--wrap-narrow);
}

.legal-date {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-40);
    margin-bottom: var(--sp-xl);
    letter-spacing: 0.04em;
}

.legal-body h2 {
    font-size: 1.375rem;
    margin-top: var(--sp-xl);
    margin-bottom: var(--sp-sm);
}

.legal-body h3 {
    font-size: 1.0625rem;
    margin-top: var(--sp-lg);
    margin-bottom: var(--sp-xs);
}

.legal-body h2:first-child,
.legal-body h3:first-child {
    margin-top: 0;
}

.legal-body p,
.legal-body li {
    color: var(--text-body);
    line-height: 1.8;
    font-size: 0.9375rem;
}

.legal-body ul {
    list-style: none;
    margin: var(--sp-sm) 0 var(--sp-md);
}

.legal-body li {
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.legal-body li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--orange);
    position: absolute;
    left: 0;
    top: 0.7rem;
}

.legal-body a {
    color: var(--orange);
}

/* Highlighted callout box (e.g. SMS consent terms) */
.legal-highlight {
    background: var(--orange-glow);
    border: 1px solid var(--orange-border);
    border-radius: var(--radius);
    padding: var(--sp-md) var(--sp-lg);
    margin: var(--sp-lg) 0;
}

.legal-highlight p:last-child {
    margin-bottom: 0;
}


/* ==========================================================================
   14. ABOUT PAGE — story body + proof split
   ========================================================================== */

/* Readable prose column for the 1,427 story */
.story-body p {
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-bottom: var(--sp-md);
}

.story-body p:last-child {
    margin-bottom: 0;
}

/* Two-column proof: text left, diagnostic readout right (mirrors workbench) */
.about-proof {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--sp-2xl);
    align-items: center;
}

.about-proof-readout {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .about-proof {
        grid-template-columns: 1fr;
        gap: var(--sp-lg);
    }

    .about-proof-readout {
        justify-content: flex-start;
    }

    .about-proof-readout .readout {
        max-width: 100%;
    }
}


/* ==========================================================================
   15. HOME — lean hero + step row
   ========================================================================== */

.hero-home {
    min-height: auto;
    padding-top: calc(var(--nav-h) + var(--sp-2xl));
    padding-bottom: var(--sp-2xl);
}

.hero-home .hero-content {
    max-width: 720px;
}

.hero-home h1 {
    margin-bottom: var(--sp-md);
}

/* Lean 4-up step row (homepage "how it works") */
.steps-lean {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-lg);
}

.step-lean-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: var(--sp-xs);
    line-height: 1;
}

.step-lean h4 {
    margin-bottom: var(--sp-xs);
}

.step-lean p {
    font-size: 0.9375rem;
    color: var(--text-body);
    margin: 0;
}

@media (max-width: 768px) {
    .hero-home {
        padding-top: calc(var(--nav-h) + var(--sp-xl));
        padding-bottom: var(--sp-xl);
    }

    .steps-lean {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--sp-lg) var(--sp-md);
    }
}

@media (max-width: 480px) {
    .steps-lean {
        grid-template-columns: 1fr;
        gap: var(--sp-md);
    }
}
