/* Embedded B2B tools — aligned with homepage .simulator-card */

/* Layout fallback when only prism-tools.css is loaded in tool section */
.simulator-card {
    background: hsl(var(--card, 0 0% 100%));
    box-shadow: var(--shadow-hero, 0 10px 40px hsl(247 75% 56% / 0.12));
    border: 1px solid hsl(var(--prism-primary, 215 43% 18%) / 0.2);
    border-radius: 1rem;
    padding: 2rem;
}

.simulator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.simulator-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.simulator-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground, 215 43% 18%));
}

.simulator-title h3 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.calculator-icon,
.trending-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.results-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground, 215 43% 18%));
}

.results-title h3 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.simulator-results {
    display: flex;
    flex-direction: column;
    min-height: 16rem;
}

.simulator-card .prism-tool__fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.simulator-card .field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.simulator-card .field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}

.simulator-card .field-input,
.simulator-card input,
.simulator-card select,
.simulator-card textarea {
    width: 100%;
    max-width: none;
    padding: 0.625rem 0.75rem;
    border: 1px solid hsl(var(--input));
    border-radius: 0.5rem;
    font: inherit;
    font-size: 0.9375rem;
    color: hsl(var(--foreground));
    background: hsl(var(--card));
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.simulator-card .field-input:focus,
.simulator-card input:focus,
.simulator-card select:focus,
.simulator-card textarea:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.simulator-card .btn {
    margin-top: 0.25rem;
}

.prism-tool {
    width: 100%;
    padding: 0;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--prism-primary) / 0.2);
    border-radius: 1rem;
    box-shadow: var(--shadow-hero, 0 10px 40px hsl(247 75% 56% / 0.12));
    overflow: hidden;
    min-height: var(--tool-min-h, auto);
}

.prism-tool--sim {
    padding: 1.75rem;
}

/* Nested inside homepage-style .simulator-card (B2B embedded tools) */
.simulator-card .prism-tool {
    border: none;
    box-shadow: none;
    background: transparent;
    min-height: auto;
}

.simulator-card .prism-tool--sim {
    padding: 0;
}

.simulator-card .prism-tool__grid {
    gap: 2.5rem;
}

.prism-tool__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.prism-tool__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.prism-tool__icon {
    font-size: 1.5rem;
    line-height: 1;
}

.prism-tool h3,
.prism-tool__header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    line-height: 1.3;
}

.prism-tool__fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.prism-tool .field-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.prism-tool .field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}

.prism-tool .field-input,
.prism-tool input,
.prism-tool select,
.prism-tool textarea {
    width: 100%;
    max-width: none;
    padding: 0.625rem 0.75rem;
    border: 1px solid hsl(var(--input));
    border-radius: 0.5rem;
    font: inherit;
    font-size: 0.9375rem;
    color: hsl(var(--foreground));
    background: hsl(var(--card));
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prism-tool .field-input:focus,
.prism-tool input:focus,
.prism-tool select:focus,
.prism-tool textarea:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.prism-tool .btn {
    margin-top: 0.25rem;
}

.prism-tool__hint {
    margin: 1rem 0 0;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.45;
}

.prism-tool__intro {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: hsl(var(--muted-foreground));
}

.prism-tool__fields--scroll {
    max-height: 22rem;
    overflow-y: auto;
    padding-right: 0.35rem;
    margin-bottom: 1rem;
}

.prism-tool__fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 0.875rem;
}

.prism-tool__fieldset legend {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.prism-tool__radios {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.prism-tool__radios label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
}

/* Stack layout — long questionnaires (résiliation, etc.):
   no forced scroll on the questions column, results stay in view on desktop. */
.prism-tool--stack .simulator-content {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.prism-tool--stack .simulator-inputs {
    min-width: 0;
}

.prism-tool--stack .simulator-results {
    position: sticky;
    top: 1.5rem;
    align-self: start;
}

/* Segmented Oui/Non control — reusable, no native radio disc. */
.prism-tool__segment {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 0.375rem;
    padding: 0.25rem;
    background: hsl(var(--muted, 210 40% 96%));
    border: 1px solid hsl(var(--border));
    border-radius: 0.625rem;
}

.prism-tool__segment-opt {
    position: relative;
    display: inline-flex;
    margin: 0;
}

.prism-tool__segment-opt input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    border: 0;
    opacity: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
}

.prism-tool__segment-opt span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    padding: 0.4rem 1.1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.prism-tool__segment-opt input:checked + span {
    background: hsl(var(--prism-primary));
    color: hsl(var(--primary-foreground, 0 0% 100%));
    box-shadow: 0 1px 2px hsl(var(--prism-primary) / 0.35);
}

.prism-tool__segment-opt input:focus-visible + span {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.prism-tool__letter {
    width: 100%;
    min-height: 14rem;
    resize: vertical;
    font-size: 0.8125rem;
    line-height: 1.5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prism-tool__results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 16rem;
    padding: 1.25rem;
    border-radius: 0.75rem;
    background: var(--gradient-feature, linear-gradient(120deg, hsl(215 50% 99%), hsl(247 75% 99%)));
    border: 1px solid hsl(var(--border));
}

.prism-tool__results-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.prism-tool__results-header h4 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.prism-tool__placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: hsl(var(--muted-foreground));
    border: 1px dashed hsl(var(--border));
    border-radius: 0.5rem;
    background: hsl(var(--card) / 0.65);
}

.prism-tool__kpi {
    text-align: center;
    padding: 1.25rem 1rem;
    border-radius: 0.625rem;
    background: var(--gradient-card, hsl(var(--card)));
    border: 1px solid hsl(var(--prism-primary) / 0.2);
}

.prism-tool__kpi-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.35rem;
}

.prism-tool__kpi-value {
    display: block;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.05;
    color: hsl(var(--prism-primary));
}

.prism-tool__kpi-unit {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.prism-tool__detail {
    font-size: 0.875rem;
    line-height: 1.55;
    color: hsl(var(--muted-foreground));
}

.prism-tool__detail strong {
    color: hsl(var(--foreground));
}

.prism-tool__risks {
    margin: 0;
    padding: 0.875rem 1rem 0.875rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: hsl(var(--muted-foreground));
    background: hsl(var(--card) / 0.8);
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
}

.prism-tool__risks-title {
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
    margin-left: -0.5rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.prism-tool-output {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.prism-tool--sim .prism-tool-output {
    flex: 1;
}

.prism-tool-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: hsl(var(--prism-accent));
}

.prism-tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

@media (max-width: 768px) {
    .simulator-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .prism-tool--sim {
        padding: 1.25rem;
    }

    .prism-tool__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .prism-tool__results {
        min-height: auto;
    }

    .prism-tool--stack .simulator-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .prism-tool--stack .simulator-results {
        position: static;
    }
}

.b2b-channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
}

.b2b-channel-pick {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
    cursor: pointer;
}

.b2b-channel-rank {
    margin: 1rem 0 0;
    padding-left: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: hsl(var(--muted-foreground, 215 20% 40%));
}

/* ---------------------------------------------------------------------------
   Selects — apparence custom alignée sur les inputs (hauteur, chevron, focus)
--------------------------------------------------------------------------- */
.simulator-card select,
.prism-tool select {
    appearance: none;
    -webkit-appearance: none;
    height: 2.75rem;
    padding-top: 0;
    padding-bottom: 0;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem 1rem;
    cursor: pointer;
}

.simulator-card select:hover,
.prism-tool select:hover {
    border-color: hsl(var(--prism-primary, 215 43% 18%) / 0.4);
}

.simulator-card select::-ms-expand,
.prism-tool select::-ms-expand {
    display: none;
}

/* ---------------------------------------------------------------------------
   Quiz Oui / Non (widgets JS) — verre minimaliste tech
   Markup généré : .simulator-card.b2b-yesno-quiz > .b2b-yesno-quiz__item
   > .b2b-yesno-quiz__q + .b2b-yesno-quiz__answers > label > input[radio]
--------------------------------------------------------------------------- */
.simulator-card.b2b-yesno-quiz {
    background: linear-gradient(155deg, hsl(220 45% 99% / 0.92), hsl(247 60% 98% / 0.78));
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid hsl(var(--prism-primary, 215 43% 18%) / 0.12);
}

.simulator-card.b2b-yesno-quiz .b2b-yesno-quiz__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    margin-top: 0.75rem;
    padding: 1rem 1.25rem;
    background: hsl(0 0% 100% / 0.65);
    border: 1px solid hsl(var(--border, 214 32% 91%) / 0.9);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px hsl(215 43% 18% / 0.04);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.simulator-card.b2b-yesno-quiz .b2b-yesno-quiz__item:hover {
    border-color: hsl(var(--prism-primary, 215 43% 18%) / 0.25);
}

.simulator-card.b2b-yesno-quiz .b2b-yesno-quiz__item.is-answered {
    border-color: hsl(var(--prism-accent, 247 75% 56%) / 0.35);
    background: hsl(0 0% 100% / 0.85);
    box-shadow: 0 2px 8px hsl(247 75% 56% / 0.07);
}

.simulator-card.b2b-yesno-quiz .b2b-yesno-quiz__q {
    flex: 1 1 18rem;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    color: hsl(var(--foreground, 215 43% 18%));
}

.b2b-yesno-quiz__answers {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 0.375rem;
    padding: 0.25rem;
    background: hsl(var(--muted, 210 40% 96%) / 0.8);
    border: 1px solid hsl(var(--border, 214 32% 91%));
    border-radius: 0.625rem;
}

.b2b-yesno-quiz__answers label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    padding: 0.4rem 1rem;
    border-radius: 0.45rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground, 215 20% 40%));
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.b2b-yesno-quiz__answers label:hover {
    color: hsl(var(--foreground, 215 43% 18%));
}

.b2b-yesno-quiz__answers input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.b2b-yesno-quiz__answers label:has(input:checked) {
    background: hsl(var(--prism-primary, 215 43% 18%));
    color: hsl(var(--primary-foreground, 0 0% 100%));
    box-shadow: 0 1px 3px hsl(var(--prism-primary, 215 43% 18%) / 0.35);
}

.b2b-yesno-quiz__answers label:has(input:focus-visible) {
    outline: 2px solid hsl(var(--ring, 247 75% 56%));
    outline-offset: 2px;
}

/* Compteur de progression (x / n) */
.simulator-card.b2b-yesno-quiz [data-tunnel-counter],
.simulator-card.b2b-yesno-quiz [data-quiz-counter] {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: hsl(var(--prism-primary, 215 43% 18%) / 0.06);
    border: 1px solid hsl(var(--prism-primary, 215 43% 18%) / 0.12);
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: hsl(var(--muted-foreground, 215 20% 40%));
}

.b2b-yesno-quiz__score {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    background: hsl(var(--prism-accent, 247 75% 56%) / 0.08);
    border: 1px solid hsl(var(--prism-accent, 247 75% 56%) / 0.18);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .simulator-card.b2b-yesno-quiz .b2b-yesno-quiz__item {
        align-items: flex-start;
        flex-direction: column;
    }
}

.b2b-gift-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 1.25rem;
}

.b2b-gift-phase {
    flex: 1 1 7rem;
    min-width: 6.5rem;
    padding: 0.75rem 0.5rem;
    border: 2px solid hsl(var(--border, 214 32% 91%));
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    text-align: center;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.b2b-gift-phase.is-active {
    border-color: hsl(var(--prism-primary, 247 75% 56%));
    background: hsl(var(--prism-accent, 247 75% 56%) / 0.08);
}

.b2b-gift-phase__month {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: hsl(var(--muted-foreground, 215 20% 40%));
}

.b2b-gift-phase__label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.b2b-gift-detail {
    padding: 1rem 1.125rem;
    border-radius: 0.5rem;
    background: hsl(var(--muted, 210 40% 96%));
    font-size: 0.9375rem;
    line-height: 1.55;
}
