/* Cost Estimator — [nxtorigin_event_cost_estimator]
   Dark-glass styling, mirroring the platform's nxtorigin-* component look. */

/* Border-box everywhere: the viewport-bounded columns cap their height with
   max-height — in content-box that cap excludes the 24px panel padding, so
   the bottom row (the Download PDF / Request CTAs) rendered below the
   viewport, unreachable by the internal scroll. */
.nxtorigin-cost-estimator,
.nxtorigin-cost-estimator * {
    box-sizing: border-box;
}

.nxtorigin-cost-estimator {
    --nxt-cc-canvas: var(--nx-bg, #060b18);
    --nxt-cc-bg: var(--nx-panel, rgba(11, 19, 41, 0.94));
    --nxt-cc-field: var(--nx-bg, #08101f);
    --nxt-cc-border: var(--nx-border, rgba(194, 206, 219, 0.16));
    --nxt-cc-text: var(--nx-text, #ffffff);
    --nxt-cc-muted: var(--nx-text-soft, #c2cedb);
    --nxt-cc-subtle: var(--nx-text-soft, #8899ad);
    --nxt-cc-primary: var(--nx-emerald, #06d6a0);
    --nxt-cc-accent: var(--nx-cyan, #22d3ee);
    --nxt-cc-hero-glow: rgba(34, 211, 238, 0.09);
    --nxt-cc-panel-shadow: 0 18px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.025);
    --nxt-cc-currency-border: rgba(34, 211, 238, 0.35);
    --nxt-cc-step-border: rgba(34, 211, 238, 0.55);
    --nxt-cc-focus-ring: 0 0 0 3px rgba(34, 211, 238, 0.16);
    --nxt-cc-card-bg: rgba(16, 27, 53, 0.72);
    --nxt-cc-success-border: rgba(6, 214, 160, 0.42);
    --nxt-cc-success-bg: rgba(6, 214, 160, 0.07);
    --nxt-cc-error-bg: rgba(239, 68, 68, 0.15);
    --nxt-cc-error-border: rgba(239, 68, 68, 0.4);
    box-sizing: border-box;
    max-width: none;
    width: auto;
    /* Full-bleed breakout from the theme content column — same mechanics as
       .nx-console-shell. The canonical token values are baked in as fallbacks
       because the console-layout stylesheet does not load on this public
       front-end page, where the tokens are otherwise undefined. */
    margin-inline: calc(50% - 50vw);
    padding-inline: var(--nx-console-gutter, clamp(18px, 2.5vw, 42px));
    padding-block: var(--nx-console-block-gap, clamp(24px, 3.2vh, 40px)) 64px;
    color: var(--nxt-cc-text);
    font-size: 15px;
    line-height: 1.5;
}

/* Two-column layout: form left (25%), live estimate right (75%) */
@media (min-width: 900px) {
    .nxtorigin-cost-estimator {
        display: grid;
        grid-template-columns: minmax(280px, 1fr) minmax(0, 3fr);
        gap: 20px;
        align-items: start;
    }

    /* App-style split view: both columns take the explicit height the JS
       measured from their real on-page position (--nxt-cc-col-height, bottom
       pinned 24px above the viewport), and long content scrolls INSIDE each
       panel. No position:sticky — the grid parent is exactly as tall as the
       columns, so sticky has no travel room here and silently does nothing.
       The max-height is only the no-JS fallback. */
    .nxtorigin-cost-estimator__form,
    .nxtorigin-cost-estimator__results {
        margin-top: 0;
        height: var(--nxt-cc-col-height, auto);
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: color-mix(in srgb, var(--nxt-cc-accent) 35%, transparent) transparent;
    }

    .nxtorigin-cost-estimator__form::-webkit-scrollbar,
    .nxtorigin-cost-estimator__results::-webkit-scrollbar {
        width: 8px;
    }

    .nxtorigin-cost-estimator__form::-webkit-scrollbar-thumb,
    .nxtorigin-cost-estimator__results::-webkit-scrollbar-thumb {
        border-radius: 8px;
        background: color-mix(in srgb, var(--nxt-cc-accent) 30%, transparent);
    }

    .nxtorigin-cost-estimator__form::-webkit-scrollbar-track,
    .nxtorigin-cost-estimator__results::-webkit-scrollbar-track {
        background: transparent;
    }

    /* The draft banner is a direct grid child — without this it occupies the
       form's column cell and shoves form/results out of shape until it is
       removed. It must always read as a full-width row above both panels. */
    .nxtorigin-cost-estimator__draft-banner {
        grid-column: 1 / -1;
    }
}

.nxtorigin-cost-estimator__placeholder {
    color: var(--nxt-cc-muted);
    text-align: center;
    padding: 40px 12px;
    font-size: 14px;
}

.nxtorigin-cost-estimator__form,
.nxtorigin-cost-estimator__results {
    background:
        radial-gradient(circle at top right, var(--nxt-cc-hero-glow), transparent 34%),
        linear-gradient(145deg, var(--nxt-cc-bg), var(--nxt-cc-canvas));
    border: 1px solid var(--nxt-cc-border);
    border-radius: 14px;
    padding: 24px;
    backdrop-filter: blur(6px);
    box-shadow: var(--nxt-cc-panel-shadow);
}

.nxtorigin-cost-estimator__results {
    margin-top: 20px;
}

/* In-flight recalculation: dim the previous estimate under a "Refreshing…"
   label so stale numbers are never read as current. The label is anchored
   near the top because the results panel scrolls on desktop. */
.nxtorigin-cost-estimator__results.is-refreshing {
    position: relative;
    pointer-events: none;
}

.nxtorigin-cost-estimator__results.is-refreshing > :not(.nxtorigin-cost-estimator__refreshing) {
    opacity: 0.35;
    transition: opacity 0.15s ease;
}

.nxtorigin-cost-estimator__refreshing {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 90px;
    color: var(--nxt-cc-accent);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    z-index: 2;
}

.nxtorigin-cost-estimator__row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

/* Top bar: compact currency picker pinned to the cost estimator's top right */
.nxtorigin-cost-estimator__topbar {
    display: flex;
    justify-content: flex-end;
    margin: -6px -6px 10px 0;
}

.nxtorigin-cost-estimator select.nxtorigin-cost-estimator__currency {
    width: auto;
    padding: 5px 8px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    color: var(--nxt-cc-accent);
    border-color: var(--nxt-cc-currency-border);
    cursor: pointer;
}

/* Progressive steps: blocks reveal one by one (updateSteps() in the JS) */
.nxt-cc-step {
    margin-bottom: 16px;
}

.nxt-cc-step[hidden] {
    display: none !important;
}

.nxt-cc-step__label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nxt-cc-step__num {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--nxt-cc-step-border);
    color: var(--nxt-cc-accent);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.nxtorigin-cost-estimator__field {
    flex: 1 1 240px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nxtorigin-cost-estimator__field label,
.nxtorigin-cost-estimator__stakeholders legend {
    font-weight: 600;
    color: var(--nxt-cc-text);
}

.nxtorigin-cost-estimator select,
.nxtorigin-cost-estimator input[type="number"] {
    background: var(--nxt-cc-field);
    border: 1px solid var(--nxt-cc-border);
    border-radius: 8px;
    color: var(--nxt-cc-text);
    padding: 10px 12px;
    font-size: 15px;
}

.nxtorigin-cost-estimator select:focus,
.nxtorigin-cost-estimator input[type="number"]:focus {
    outline: none;
    border-color: var(--nxt-cc-accent);
    box-shadow: var(--nxt-cc-focus-ring);
}

.nxtorigin-cost-estimator select option {
    color: var(--nx-text-soft, #111827);
}

.nxtorigin-cost-estimator__stakeholders {
    border: none;
    padding: 0;
    margin: 0 0 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nxtorigin-cost-estimator__stakeholders legend {
    margin-bottom: 10px;
    padding: 0;
}

/* Empty state: the picked event type has no mapped participant roles */
.nxt-cc-no-stakeholders {
    margin: 0;
    padding: 12px 14px;
    border: 1px dashed var(--nxt-cc-border);
    border-radius: 10px;
    color: var(--nxt-cc-muted);
    font-size: 13px;
}

.nxt-cc-no-stakeholders[hidden] {
    display: none !important;
}

/* Stakeholder configuration card: a quiet row that opens into a labeled grid */
.nxtorigin-cost-estimator__card {
    border: 1px solid var(--nxt-cc-border);
    border-radius: 10px;
    background: var(--nxt-cc-card-bg);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.nxtorigin-cost-estimator__card.is-open {
    border-color: var(--nxt-cc-success-border);
    background: var(--nxt-cc-success-bg);
}

.nxtorigin-cost-estimator__card-head {
    display: flex;
    align-items: flex-start; /* checkbox tops-aligns with the name when a hint line follows */
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}

.nxtorigin-cost-estimator__card-head input[type="checkbox"] {
    accent-color: var(--nxt-cc-primary);
    width: 16px;
    height: 16px;
    margin-top: 3px;
}

.nxtorigin-cost-estimator__card-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nxtorigin-cost-estimator__card-name {
    font-weight: 600;
}

/* Stakeholder description (wp_stakeholder_master.description) under the name */
.nxtorigin-cost-estimator__card-hint {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--nxt-cc-muted);
}

.nxtorigin-cost-estimator__card-body {
    padding: 0 16px 14px;
    border-top: 1px solid var(--nxt-cc-border);
}

.nxtorigin-cost-estimator__card-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px 18px;
    padding-top: 12px;
}

.nxtorigin-cost-estimator__card-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nxtorigin-cost-estimator__card-field label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--nxt-cc-muted);
}

.nxt-cc-stakeholder-count {
    width: 150px;
}

.nxt-cc-plan-count {
    width: 120px;
}

.nxt-cc-plan-type {
    width: 220px;
}

.nxtorigin-cost-estimator__plan-hint {
    margin: 10px 0 0;
    color: var(--nxt-cc-muted);
    font-size: 12px;
    line-height: 1.5;
}

.nxtorigin-cost-estimator__card-field .nxt-cc-stakeholder-managers {
    width: 90px;
}

.nxtorigin-cost-estimator__admin-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--nxt-cc-text);
    font-size: 14px;
    cursor: pointer;
    padding-bottom: 9px;
}

.nxtorigin-cost-estimator__admin-check--top {
    padding: 10px 0;
}

.nxtorigin-cost-estimator__field--check {
    flex: 0 1 180px;
}

.nxtorigin-cost-estimator__admin-check input[type="checkbox"] {
    accent-color: var(--nxt-cc-primary);
    width: 15px;
    height: 15px;
}

/* Booth placement (hall tiers) — a sub-section inside the card */
.nxtorigin-cost-estimator__hall-split {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--nxt-cc-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    font-size: 13px;
}

.nxtorigin-cost-estimator__hall-split-title {
    flex-basis: 100%;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--nxt-cc-muted);
}

.nxtorigin-cost-estimator__hall-tier {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--nxt-cc-muted);
}

.nxtorigin-cost-estimator__hall-tier input {
    width: 90px;
    padding: 6px 8px;
    font-size: 13px;
}

/* Live streaming (AWS IVS) sub-panel reuses the hall-split layout; its
   tier select just needs room for the tier names. */
.nxtorigin-cost-estimator__hall-tier select {
    width: auto;
    max-width: 260px;
    padding: 6px 8px;
    font-size: 13px;
}

.nxtorigin-cost-estimator__hall-split-hint {
    flex-basis: 100%;
    color: var(--nxt-cc-muted);
    font-size: 12px;
}

.nxtorigin-cost-estimator__submit,
.nxtorigin-cost-estimator__cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--nxt-cc-primary), var(--nxt-cc-accent));
    color: var(--nx-text-soft, #03131a);
    border: none;
    border-radius: 999px;
    padding: 11px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.nxtorigin-cost-estimator__submit:hover,
.nxtorigin-cost-estimator__cta-btn:hover {
    opacity: 0.85;
}

.nxtorigin-cost-estimator__submit:disabled {
    opacity: 0.5;
    cursor: wait;
}

.nxtorigin-cost-estimator__status {
    margin-top: 6px;
    color: var(--nxt-cc-muted);
    font-size: 13px;
    min-height: 20px;
    transition: opacity 0.15s ease;
}

.nxtorigin-cost-estimator__status.is-busy {
    color: var(--nxt-cc-accent);
}

.nxtorigin-cost-estimator__error {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--nxt-cc-error-bg);
    border: 1px solid var(--nxt-cc-error-border);
    color: var(--nx-rose, #fca5a5);
}

/* Draft restore banner — an accidental refresh offers the half-filled
   estimate back, never restores silently (mirrors the intake form's
   PM HOST #264 banner). */
.nxtorigin-cost-estimator__draft-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--nxt-cc-accent) 45%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--nxt-cc-accent) 10%, transparent);
    color: var(--nxt-cc-text);
}

.nxtorigin-cost-estimator__draft-banner.is-note {
    border-color: var(--nxt-cc-success-border);
    background: var(--nxt-cc-success-bg);
    color: var(--nxt-cc-primary);
    font-weight: 600;
}

.nxtorigin-cost-estimator__draft-text {
    flex: 1 1 240px;
    font-weight: 600;
}

.nxtorigin-cost-estimator__draft-btn {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.nxtorigin-cost-estimator__draft-btn:hover {
    filter: brightness(1.1);
}

.nxtorigin-cost-estimator__draft-btn.is-restore {
    background: var(--nxt-cc-accent);
    color: var(--nx-btn-text, #06222b);
}

.nxtorigin-cost-estimator__draft-btn.is-discard {
    background: transparent;
    border-color: color-mix(in srgb, var(--nxt-cc-text) 35%, transparent);
    color: inherit;
}

.nxtorigin-cost-estimator__summary {
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--nxt-cc-accent);
}

.nxtorigin-cost-estimator__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.nxtorigin-cost-estimator__table th,
.nxtorigin-cost-estimator__table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--nxt-cc-border);
    text-align: left;
    color: var(--nxt-cc-text);
}

/* Column alignment: Line item hard-left, Amount hard-right — !important so
   theme/Elementor table rules can't recenter them. */
.nxtorigin-cost-estimator__table th:first-child,
.nxtorigin-cost-estimator__table td:first-child {
    text-align: left !important;
}

.nxtorigin-cost-estimator__table th.nxt-cc-num,
.nxtorigin-cost-estimator__table td.nxt-cc-num {
    text-align: right !important;
    white-space: nowrap;
}

.nxtorigin-cost-estimator__table .nxt-cc-formula {
    color: var(--nxt-cc-muted);
    white-space: nowrap;
}

.nxtorigin-cost-estimator__table .nxt-cc-group td {
    font-weight: 700;
    color: var(--nxt-cc-accent);
    border-bottom: none;
    padding-top: 14px;
}

.nxtorigin-cost-estimator__table .nxt-cc-detail td {
    color: var(--nxt-cc-muted);
    font-size: 13px;
    border-bottom: 1px dashed var(--nxt-cc-border);
}

.nxtorigin-cost-estimator__table .nxt-cc-detail td:first-child {
    padding-left: 24px;
}

.nxtorigin-cost-estimator__table .nxt-cc-total td {
    font-weight: 700;
    font-size: 16px;
    border-top: 2px solid var(--nxt-cc-border);
    border-bottom: none;
}

.nxtorigin-cost-estimator__included,
.nxtorigin-cost-estimator__plans,
.nxtorigin-cost-estimator__note {
    margin-top: 14px;
    color: var(--nxt-cc-muted);
    font-size: 13px;
}

.nxtorigin-cost-estimator__plans ul {
    margin: 6px 0 0 18px;
    padding: 0;
}

.nxtorigin-cost-estimator__contact {
    padding: 12px;
    font-size: 16px;
}

.nxtorigin-cost-estimator__cta {
    margin-top: 18px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nxtorigin-cost-estimator__pdf-btn {
    display: inline-block;
    background: transparent;
    color: var(--nxt-cc-accent);
    border: 1px solid var(--nxt-cc-accent);
    border-radius: 999px;
    padding: 10px 26px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.nxtorigin-cost-estimator__pdf-btn:hover {
    background: var(--nxt-cc-accent);
    color: var(--nx-text-soft, #03131a);
}

.nxtorigin-cost-estimator__pdf-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.nxtorigin-cost-estimator :is(a, button, input, select):focus-visible {
    outline: 2px solid var(--nxt-cc-accent) !important;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .nxtorigin-cost-estimator * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Below the two-column breakpoint the results panel is full-width but the
   Formula column is still visible — let formulas wrap (they are nowrap on
   desktop only for tidiness) and keep any residual overflow scrolling
   inside the panel instead of widening the page. */
@media (max-width: 899px) {
    .nxtorigin-cost-estimator__results {
        overflow-x: auto;
    }

    .nxtorigin-cost-estimator__table .nxt-cc-formula {
        white-space: normal;
    }
}

@media (max-width: 600px) {
    .nxtorigin-cost-estimator__card-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .nxt-cc-stakeholder-count,
    .nxtorigin-cost-estimator__card-field .nxt-cc-stakeholder-managers {
        width: 100%;
    }

    .nxtorigin-cost-estimator__admin-check {
        padding-bottom: 0;
    }

    .nxtorigin-cost-estimator__table .nxt-cc-formula {
        display: none;
    }

    /* Sub-panel rows (booth placement + live streaming) stack label-over-
       control so the tier select / number inputs never overflow the card. */
    .nxtorigin-cost-estimator__hall-tier {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 5px;
    }

    .nxtorigin-cost-estimator__hall-tier input,
    .nxtorigin-cost-estimator__hall-tier select {
        width: 100%;
        max-width: none;
    }
}
