/**
 * Funnel shared chrome (spec 012, FR-029 — Figma is the source of truth).
 *
 * Auto-enqueued by FunnelController on funnel requests. This file owns the
 * page-level chrome every step screen shares: the breadcrumb bar, the
 * main-column + sidebar layout grid, the step header, the enrollment summary
 * sidebar, primary buttons, form fields, and the validation error notice.
 * Step screens add their own funnel-*.css for screen-specific markup.
 *
 * Everything is scoped under .cu-funnel (the <main> element in tpl-funnel.php).
 */

.cu-funnel {
    background-color: var(--beige, #f9f1d7);
    color: var(--text-body-color, #4f2a10);
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
}

/* ---------- container + layout grid ---------- */

.cu-funnel .cu-funnel__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

/* Main column + summary sidebar (account / payment screens). */
.cu-funnel .cu-funnel__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 48px;
    align-items: start;
}

.cu-funnel .cu-funnel__sidebar {
    border-left: 1px solid rgba(89, 38, 11, 0.15);
    padding-left: 40px;
    min-width: 0;
}

.cu-funnel .cu-funnel__main {
    min-width: 0;
}

/* ---------- breadcrumb bar (markup: partials/breadcrumb.php) ---------- */

.cu-funnel .cu-funnel-breadcrumb {
    border-bottom: 1px solid rgba(89, 38, 11, 0.12);
    margin-bottom: 8px;
}

.cu-funnel .cu-funnel-breadcrumb__list {
    max-width: 1140px;
    margin: 0 auto;
    padding: 14px 24px;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.cu-funnel .cu-funnel-breadcrumb__item {
    color: var(--text-body-color, #4f2a10);
}

.cu-funnel .cu-funnel-breadcrumb__item + .cu-funnel-breadcrumb__item::before {
    content: "/";
    margin: 0 10px;
    color: rgba(79, 42, 16, 0.4);
}

.cu-funnel .cu-funnel-breadcrumb__item a {
    color: var(--text-body-color, #4f2a10);
    text-decoration: none;
}

.cu-funnel .cu-funnel-breadcrumb__item a:hover,
.cu-funnel .cu-funnel-breadcrumb__item a:focus {
    color: var(--bs-heading-color, #751144);
    text-decoration: underline;
}

.cu-funnel .cu-funnel-breadcrumb__item.is-current span {
    color: var(--bs-heading-color, #751144);
    font-weight: 700;
}

/* ---------- step header (partials/step-header.php) ---------- */

.cu-funnel .cu-step-header {
    margin: 40px 0 28px;
}

.cu-funnel .cu-step-header__back {
    display: inline-block;
    color: var(--text-body-color, #4f2a10);
    font-size: 0.9375rem;
    text-decoration: none;
    margin-bottom: 6px;
}

.cu-funnel .cu-step-header__back:hover,
.cu-funnel .cu-step-header__back:focus {
    color: var(--bs-heading-color, #751144);
    text-decoration: underline;
}

.cu-funnel .cu-step-header__title {
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    font-size: clamp(1.75rem, 4vw, 2.375rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--bs-heading-color, #751144);
    margin: 6px 0 10px;
}

.cu-funnel .cu-step-header__subtitle {
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--text-body-color, #4f2a10);
    margin: 0;
}

.cu-funnel .cu-step-header__subtitle a {
    color: var(--bs-heading-color, #751144);
    text-decoration: underline;
}

/* ---------- buttons (Figma primary: full maroon, rounded 8px) ---------- */

.cu-funnel .cu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: "Proza Libre", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    border: none;
    border-radius: 8px;
    padding: 14px 28px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.cu-funnel .cu-btn--primary {
    background-color: var(--purple, #750444);
    color: var(--beige, #f9f1d7);
}

.cu-funnel .cu-btn--primary:hover,
.cu-funnel .cu-btn--primary:focus {
    background-color: #8c1554;
    color: var(--beige, #f9f1d7);
}

.cu-funnel .cu-btn--primary:disabled,
.cu-funnel .cu-btn--primary[aria-disabled="true"] {
    background-color: rgba(117, 4, 68, 0.45);
    cursor: not-allowed;
}

.cu-funnel .cu-btn--block {
    display: flex;
    width: 100%;
}

/* ---------- form fields (Figma: light fields, thin warm border) ---------- */

.cu-funnel .cu-field {
    margin-bottom: 18px;
}

.cu-funnel .cu-field label,
.cu-funnel .cu-field__label {
    display: block;
    font-family: "Proza Libre", sans-serif;
    font-size: 0.875rem;
    color: var(--text-body-color, #4f2a10);
    margin-bottom: 6px;
}

.cu-funnel .cu-field input[type="text"],
.cu-funnel .cu-field input[type="email"],
.cu-funnel .cu-field input[type="password"],
.cu-funnel .cu-field input[type="number"],
.cu-funnel .cu-field input[type="tel"],
.cu-funnel .cu-field select,
.cu-funnel .cu-field textarea {
    width: 100%;
    background-color: #fffdf7;
    border: 1px solid #d9cbb8;
    border-radius: 8px;
    padding: 12px 14px;
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1rem;
    color: var(--text-body-color, #4f2a10);
    box-shadow: none;
}

.cu-funnel .cu-field input::placeholder,
.cu-funnel .cu-field textarea::placeholder {
    color: rgba(79, 42, 16, 0.4);
}

.cu-funnel .cu-field input:focus,
.cu-funnel .cu-field select:focus,
.cu-funnel .cu-field textarea:focus {
    border-color: var(--purple, #750444);
    outline: 2px solid rgba(117, 4, 68, 0.15);
    outline-offset: 0;
}

/* Two side-by-side fields (First / Last name). Stacks on small screens. */
.cu-funnel .cu-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Checkbox + inline label (terms acceptance). */
.cu-funnel .cu-field--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cu-funnel .cu-field--checkbox input[type="checkbox"] {
    margin-top: 4px;
    accent-color: var(--purple, #750444);
    flex-shrink: 0;
}

.cu-funnel .cu-field--checkbox label {
    display: inline;
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    font-size: 0.9375rem;
    margin-bottom: 0;
}

/* ---------- validation error notice (conductor step_error()) ---------- */

.cu-funnel .cu-funnel-error {
    background-color: rgba(117, 4, 68, 0.08);
    border: 1px solid rgba(117, 4, 68, 0.35);
    border-left: 4px solid var(--purple, #750444);
    border-radius: 8px;
    color: var(--bs-heading-color, #751144);
    font-size: 0.9375rem;
    line-height: 1.5;
    padding: 12px 16px;
    margin: 0 0 20px;
}

/* ---------- enrollment summary (partials/enrollment-summary.php) ---------- */

.cu-funnel .cu-enrollment-summary {
    margin-top: 40px;
}

.cu-funnel .cu-enrollment-summary__eyebrow {
    font-size: 0.8125rem;
    color: rgba(79, 42, 16, 0.65);
    margin: 0 0 4px;
}

.cu-funnel .cu-enrollment-summary__course {
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--bs-heading-color, #751144);
    margin: 0 0 4px;
}

.cu-funnel .cu-enrollment-summary__format {
    font-size: 0.875rem;
    color: var(--text-body-color, #4f2a10);
    margin: 0 0 16px;
}

.cu-funnel .cu-enrollment-summary__details {
    list-style: none;
    margin: 0 0 16px;
    padding: 16px 0 0;
    border-top: 1px solid rgba(89, 38, 11, 0.15);
}

.cu-funnel .cu-enrollment-summary__details li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.cu-funnel .cu-enrollment-summary__details li::before {
    content: "";
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--purple, #750444);
    transform: translateY(-1px);
}

.cu-funnel .cu-enrollment-summary__pricing {
    border-top: 1px solid rgba(89, 38, 11, 0.15);
    padding-top: 16px;
}

.cu-funnel .cu-enrollment-summary__price-label {
    font-size: 0.8125rem;
    color: rgba(79, 42, 16, 0.65);
    margin: 0 0 2px;
}

.cu-funnel .cu-enrollment-summary__price {
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--bs-heading-color, #751144);
    margin: 0 0 6px;
}

.cu-funnel .cu-enrollment-summary__price-note {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: rgba(79, 42, 16, 0.75);
    margin: 0 0 2px;
}

/* Gift variant: a bordered card (Figma 1:2353 right side). */
.cu-funnel .cu-enrollment-summary--gift {
    background-color: var(--light-beige, #fcf5df);
    border: 1px solid #e2d3b8;
    border-radius: 16px;
    padding: 24px;
}

.cu-funnel .cu-enrollment-summary--gift .cu-enrollment-summary__course {
    margin-bottom: 12px;
}

.cu-funnel .cu-enrollment-summary__note {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-body-color, #4f2a10);
    margin: 0 0 16px;
}

.cu-funnel .cu-enrollment-summary__note strong {
    font-weight: 700;
}

.cu-funnel .cu-enrollment-summary__pay {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid rgba(89, 38, 11, 0.15);
    padding-top: 16px;
}

.cu-funnel .cu-enrollment-summary__pay-label {
    font-family: "Proza Libre", sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-body-color, #4f2a10);
    margin: 0;
}

.cu-funnel .cu-enrollment-summary__pay-seats {
    font-size: 0.8125rem;
    color: rgba(79, 42, 16, 0.7);
    margin: 2px 0 0;
}

.cu-funnel .cu-enrollment-summary__pay-total {
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bs-heading-color, #751144);
    margin: 0;
    white-space: nowrap;
}

/* ---------- gift seat-quantity stepper (Figma 1:2290 right card) ---------- */

.cu-funnel .cu-gift-seats__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid rgba(89, 38, 11, 0.15);
    padding: 14px 0;
}

.cu-funnel .cu-gift-seats__row:last-child {
    padding-bottom: 0;
}

.cu-funnel .cu-gift-seats__label {
    font-size: 0.8125rem;
    color: rgba(79, 42, 16, 0.65);
    margin: 0;
}

.cu-funnel .cu-gift-seats__price {
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--bs-heading-color, #751144);
    margin: 0;
    white-space: nowrap;
}

.cu-funnel .cu-gift-seats__stepper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cu-funnel .cu-gift-seats__btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--purple, #750444);
    color: var(--beige, #f9f1d7);
    border: none;
    border-radius: 6px;
    font-family: "Proza Libre", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.cu-funnel .cu-gift-seats__btn:hover,
.cu-funnel .cu-gift-seats__btn:focus {
    background-color: #8c1554;
}

.cu-funnel .cu-gift-seats__input {
    width: 48px;
    background: none;
    border: none;
    text-align: center;
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-body-color, #4f2a10);
    -moz-appearance: textfield;
    appearance: textfield;
}

.cu-funnel .cu-gift-seats__input::-webkit-outer-spin-button,
.cu-funnel .cu-gift-seats__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cu-funnel .cu-gift-seats__input:focus {
    outline: 2px solid rgba(117, 4, 68, 0.25);
    border-radius: 4px;
}

.cu-funnel .cu-gift-seats__total-label {
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-body-color, #4f2a10);
    margin: 0;
}

.cu-funnel .cu-gift-seats__total {
    font-family: "Palatino", "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--bs-heading-color, #751144);
    margin: 0;
    white-space: nowrap;
}

/* ---------- responsive ---------- */

@media (max-width: 991.98px) {
    .cu-funnel .cu-funnel__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .cu-funnel .cu-funnel__sidebar {
        border-left: none;
        border-top: 1px solid rgba(89, 38, 11, 0.15);
        padding-left: 0;
        padding-top: 24px;
        margin-top: 32px;
    }

    .cu-funnel .cu-enrollment-summary {
        margin-top: 0;
    }
}

@media (max-width: 767.98px) {
    .cu-funnel .cu-funnel__inner {
        padding: 0 16px 48px;
    }

    .cu-funnel .cu-funnel-breadcrumb__list {
        padding: 12px 16px;
        font-size: 0.875rem;
    }

    .cu-funnel .cu-step-header {
        margin: 28px 0 20px;
    }

    .cu-funnel .cu-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .cu-funnel .cu-enrollment-summary--gift {
        padding: 20px 16px;
    }
}

/* ---------- form error states (rendered by funnel.js) ---------- */

/* Fields that failed validation: thick red border. */
.cu-funnel input.has-error,
.cu-funnel select.has-error,
.cu-funnel textarea.has-error {
    border: 2px solid #b3261e !important;
}

/* Per-field message, red under the field it belongs to. */
.cu-funnel .cu-field-error {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    line-height: 1.4;
    font-weight: 600;
    color: #b3261e;
}

/* Banner at the top of the form: the site's notice box (beige, soft inset
   shadow) with an X badge and red text. */
.cu-funnel .cu-form-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background-color: #faf0d7;
    box-shadow: inset 0 0 6px #59260b75;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: #b3261e;
}

.cu-funnel .cu-form-error::before {
    content: "\2715";
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    background: #b3261e;
    color: #faf0d7;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* Live validation states (password fields): red while the rules are not
   met, green once they are. Same weight as .has-error so they read as one
   system. */
.cu-funnel input.is-invalid {
    border: 2px solid #b3261e !important;
}

.cu-funnel input.is-valid {
    border: 2px solid #2e7d32 !important;
}
