/* Reworked "request" section (templates/request.php): a two-column "chatbot + form"
   layout that mirrors .chatbot__layout on the Optoguide page. Loaded site-wide. */

.request.-chatbot {
    /* CSS vars the embedded [optoguide] widget needs (optoguide-chatbot.css declares
       them on .content.chatbot; here the widget lives inside .request instead). */
    --og-primary: #18d8c7;
    --og-primary-dark: #365463;
    --og-text-dark: #1b2429;
    --og-agent-bg: #f2f5f6;
    --og-border: #e2e8ea;
    --og-muted: #4a5a63;
}

/* Admin-entered heading + description, shown as a full-width intro above the columns */
.request.-chatbot .request__intro {
    max-width: 760px;
    margin: 0 0 28px;
}

.request.-chatbot .request__intro .description {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.7);
}

.request.-chatbot .request-shortcode {
    min-width: 0;
}

/* Two columns only from $lg (1024px) up; below that the base .request styles stack
   the section and the whole form is shown (no height cap, no scroll). */
@media (min-width: 1024px) {
    .request.-chatbot .request__wrapper {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 32px;
        align-items: start;
    }

    /* Left column: drop the sticky text-column styling — just hold the widget */
    .request.-chatbot .request-shortcode {
        position: static;
        top: auto;
        grid-column: auto;
        padding-left: 0;
    }

    /* Right column: form fills its half */
    .request.-chatbot .request-form {
        grid-column: auto;
        padding-right: 0;
        min-width: 0;
    }

    /* Cap the form fields to the chatbot height and scroll them internally with a
       thin branded scrollbar. .thanks-container stays an overlay over .form-wrapper. */
    .request.-chatbot .request-form .form-wrapper .form {
        max-height: 640px;                 /* = .optoguide__window height */
        overflow-y: auto;
        padding-right: 10px;               /* room for the scrollbar */
        scrollbar-width: thin;             /* Firefox */
        scrollbar-color: var(--og-primary) transparent;
    }

    .request.-chatbot .request-form .form-wrapper .form::-webkit-scrollbar {
        width: 6px;                        /* thinner than the chat's 8px */
    }

    .request.-chatbot .request-form .form-wrapper .form::-webkit-scrollbar-track {
        background: transparent;
    }

    .request.-chatbot .request-form .form-wrapper .form::-webkit-scrollbar-thumb {
        background: var(--og-primary);
        border-radius: 6px;
    }
}

/* ---------------------------------------------------------------------------
   Multistep form: heading, step indicator, cf7mls step buttons
   --------------------------------------------------------------------------- */

.request.-chatbot .formsDesc {
    margin-bottom: 24px;
}

.request.-chatbot .formsDesc_title {
    font-size: clamp(28px, 2.6vw, 44px);
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.request.-chatbot .formsDesc_desc {
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
}

/* Step indicator */
.request-steps {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px;
    padding: 14px 20px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.08);
    list-style: none;
}

.request-steps__item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
    color: rgba(255, 255, 255, 0.85);
}

/* Connector between steps */
.request-steps__item:not(:last-child)::after {
    content: "";
    flex: 1 1 40px;
    min-width: 24px;
    height: 1px;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, 0.28);
}

.request-steps__item:not(:last-child) {
    flex: 1 1 auto;
}

.request-steps__num {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--og-border, #cdd6d9);
    color: #1b2429;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.25s ease;
}

.request-steps__label {
    white-space: nowrap;
    transition: color 0.25s ease;
}

.request-steps__item.is-current > .request-steps__num,
.request-steps__item.is-done > .request-steps__num {
    background-color: var(--og-primary, #18d8c7);
}

.request-steps__item.is-current > .request-steps__label,
.request-steps__item.is-done > .request-steps__label {
    color: var(--og-primary, #18d8c7);
}

.request-steps__item.is-done:not(:last-child)::after {
    height: 2px;
    background-color: var(--og-primary, #18d8c7);
}

.request-steps__item.is-done {
    cursor: pointer;
}

.request-steps__item.is-done:hover > .request-steps__label {
    color: var(--og-primary, #18d8c7);
}

/* Divider between the indicator and the fields */
.request.-chatbot .request-form .form-wrapper .form {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding-top: 28px;
}

/* cf7mls step buttons — override the plugin's default blue/grey floats */
.request-form .cf7mls-btns {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 32px;
}

.request-form .cf7mls-btns .cf7mls_next.action-button,
.request-form .cf7mls-btns .cf7mls_back.action-button {
    float: none;
    margin: 0;
    min-width: 0;
    padding: 20px 32px;
    border: 0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.request-form .cf7mls-btns .cf7mls_next.action-button {
    flex: 1 1 0;
    background-color: var(--og-primary, #18d8c7);
    color: #1b2429;
}

.request-form .cf7mls-btns .cf7mls_next.action-button:hover {
    opacity: 1;
    background-color: #92e5dd;
}

.request-form .cf7mls-btns .cf7mls_back.action-button {
    flex: 1 1 0;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
}

.request-form .cf7mls-btns .cf7mls_back.action-button:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.16);
}

.request-form .cf7mls-btns .cf7mls_next.action-button img {
    width: 20px;
    height: 20px;
    margin-left: 8px;
    vertical-align: middle;
}

.request-form .cf7mls-btns.cf7mls-btns-last-step {
    display: flex;
    margin-top: 0;
}

@media (max-width: 767px) {
    .request-steps {
        gap: 8px;
        padding: 12px 14px;
    }

    /* Only the active step keeps its label on narrow screens */
    .request-steps__item:not(.is-current) > .request-steps__label {
        display: none;
    }

    .request-form .cf7mls-btns .cf7mls_next.action-button,
    .request-form .cf7mls-btns .cf7mls_back.action-button {
        flex: 1 1 auto;
        padding: 16px 20px;
    }
}

/* Step 2: last row is 1/3 + 2/3 (Environment + Beam shape) */
.request-form .multi-input.-uneven > .input {
    flex: 1 1 0;
    min-width: 0;
}

.request-form .multi-input.-uneven > .input:last-child {
    flex: 2 1 0;
}

/* Step 3: Back sits next to the submit button (moved there by request-steps.js),
   the consent checkbox keeps its own full-width row above them. */
.request-form .submit-wrapper {
    flex-wrap: wrap;
    gap: 24px 20px;
}

.request-form .submit-wrapper .--checkbox {
    flex: 1 0 100%;
}

.request-form .submit-wrapper .cf7mls-btns-last-step {
    flex: 1 1 0;
    margin: 0;
}

.request-form .submit-wrapper .button.submit {
    flex: 1 1 0;
    max-width: none;
    text-transform: uppercase;
}

@media (max-width: 767px) {
    .request-form .multi-input.-uneven > .input,
    .request-form .multi-input.-uneven > .input:last-child {
        flex: 1 0 100%;
    }

    .request-form .submit-wrapper {
        flex-direction: row;
        align-items: center;
    }
}

/* Last step: no internal scroll — the form grows past the chatbot height instead */
@media (min-width: 1024px) {
    .request.-chatbot .request-form .form-wrapper.-no-cap .form {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}

/* ---------------------------------------------------------------------------
   Standalone page variant (page-chatbot.php → /optoguide/): the section is the
   whole page, so it needs to clear the fixed header.
   --------------------------------------------------------------------------- */

.request.-chatbot.-page {
    padding-top: 160px;
}

.request.-chatbot.-page .request__intro {
    max-width: 860px;
}

@media (max-width: 1023px) {
    .request.-chatbot.-page {
        padding-top: 120px;
    }
}

/* ---------------------------------------------------------------------------
   Success state (.form-wrapper.-valid, set by custom-solutions.js on wpcf7mailsent).
   The base .request styles only fade out .form; this variant also has the heading
   and the step indicator inside the card, so they have to go too — otherwise the
   thank-you overlay is drawn on top of them.
   updateFormHeight() shrinks the card to the height of .thanks-container, so the
   faded-out form is clipped instead of leaving a hole underneath.
   --------------------------------------------------------------------------- */

.request.-chatbot .request-form .form-wrapper.-valid {
    overflow: hidden;
}

.request.-chatbot .request-form .form-wrapper.-valid .formsDesc,
.request.-chatbot .request-form .form-wrapper.-valid .request-steps {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}
