/* Admin-only AI assistant panel on the legacy quotation forms.
   Visual language matches the approved mockup (.superpowers/brainstorm/inkee-ai-stepper.html):
   Inkee AI logo as FAB, a panel above it, black header, one guided step at a time. */

.assistant-fab {
    position: fixed;
    left: 26px;
    bottom: 26px;
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    z-index: 1050;
    animation: assistant-wave .9s ease-in-out 1s;
}

.assistant-fab img {
    display: block;
    border-radius: 50%;
}

.assistant-fab:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

/* On the img, not the button: swapping the button's animation would replay the load wave on mouseout. */
.assistant-fab:hover img {
    animation: assistant-wave .9s ease-in-out;
}

.assistant-chat {
    position: fixed;
    left: 26px;
    bottom: 96px;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: 76vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,.22);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dddddd;
    z-index: 1050;
}

.assistant-chat.aperta {
    display: flex;
}

.assistant-chat-header {
    background: #111111;
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.assistant-chat-title {
    font-weight: 600;
    font-size: 14px;
}

.assistant-chat-sub {
    font-size: 11px;
    opacity: .85;
}

.assistant-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    opacity: .85;
}

.assistant-modo {
    display: contents;
}

.assistant-chat-messages {
    padding: 14px;
    overflow-y: auto;
    flex: 1;
    background: #fbfbfa;
}

.assistant-warning {
    margin-top: 8px;
    font-size: 12px;
    color: #8a6d3b;
    background: #fcf8e3;
    border: 1px solid #faebcc;
    border-radius: 4px;
    padding: 7px 9px;
}

/* ---- step 0: the free-text prompt, only screen with a composer ---- */

.assistant-esempio {
    font-style: italic;
    color: #8b9296;
}

.assistant-chat-composer {
    border-top: 1px solid #dddddd;
    padding: 10px;
    display: flex;
    background: #fff;
}

.assistant-chat-input,
.assistant-campo-input {
    flex: 1;
    height: 38px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    padding: 0 10px;
    font-size: 13px;
}

.assistant-chat-composer .assistant-chat-input {
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.assistant-chat-send {
    background: #111111;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 600;
}

/* ---- guided steps: what's filled in so far, advice, pastilles ---- */

.assistant-capito {
    border: 1px solid #e3e3e3;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 16px 0 12px;
    background: #f8f8f8;
}

.assistant-capito ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 12.5px;
}

.assistant-capito li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
    border-bottom: 1px dotted #e6e6e6;
}

.assistant-capito li:last-child {
    border-bottom: none;
}

.assistant-capito-riga {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.assistant-capito-k {
    color: #626a6e;
}

.assistant-capito-v {
    font-weight: 600;
    color: #222222;
    text-align: right;
}

.assistant-capito-auto {
    font-weight: 400;
    color: #8b9296;
    font-size: 11.5px;
}

/* The model's own short "why this value" sentence (QuotationFieldAssignment.Note) - discreet, never competing with the value above it. */
.assistant-capito-nota {
    font-size: 11.5px;
    color: #9a9a9a;
    line-height: 1.4;
}

.assistant-consiglio {
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0 0 10px;
}

.assistant-scelte {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.assistant-scelta {
    border: 1px solid #111111;
    color: #111111;
    background: #fff;
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    width: 100%;
}

.assistant-scelta:hover {
    background: #f3f3f3;
}

/* ---- Number/Text questions: no options to click, an input replaces the pastilles ---- */

.assistant-campo {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.assistant-campo-riga {
    display: flex;
    gap: 8px;
}

.assistant-campo-conferma {
    background: #111111;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 600;
}

.assistant-campo-conferma:hover {
    background: #2b2b2b;
}

/* ---- final screen: quotation card is done ---- */

.assistant-finito {
    text-align: center;
    padding: 6px 0 2px;
}

.assistant-finito-spunta {
    font-size: 26px;
    color: #3f6212;
    line-height: 1;
}

.assistant-finito-frase {
    font-size: 14px;
    font-weight: 600;
    margin: 8px 0 4px;
}

.assistant-finito-sotto {
    font-size: 12.5px;
    color: #626a6e;
    margin-bottom: 14px;
}

.assistant-finito-azioni {
    display: flex;
    justify-content: center;
}

.assistant-btn-calcola {
    background: #111111;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
}

.assistant-btn-calcola:hover {
    background: #2b2b2b;
}

.assistant-riparti {
    background: none;
    border: none;
    color: #626a6e;
    font-size: 12.5px;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    margin-top: 12px;
    padding: 4px;
}

.assistant-riparti:hover {
    color: #111111;
}

/* The model's advice on the question currently on screen (QuotationAssistantQuestion.Advice) -
   present enough to be read, quiet enough not to compete with the question above it. */
.assistant-suggerimento {
    font-size: 12.5px;
    line-height: 1.5;
    color: #6f767a;
    margin: -4px 0 12px;
    padding-left: 9px;
    border-left: 2px solid #e2e5e6;
}

/* ---- loading state: a guided step is a partial postback that waits for the model, so the
   panel says so and freezes its own controls until the new step replaces the DOM. The page
   stays free: the master's full-page UpdateProgress veil is not for this wait ---- */

body.assistant-pensa .loader {
    display: none;
}

.assistant-caricamento {
    display: none;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: #626a6e;
    margin: 0 0 12px;
}

.assistant-chat.caricamento .assistant-caricamento {
    display: flex;
}

.assistant-chat.caricamento .assistant-chat-messages > :not(.assistant-caricamento) {
    opacity: .45;
    pointer-events: none;
}

/* "Typing" dots, and whatever is still to be revealed after the typed text. */
.assistant-puntini {
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
}

.assistant-puntini span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8b9296;
    animation: assistant-puntino 1.2s ease-in-out infinite;
}

.assistant-puntini span:nth-child(2) {
    animation-delay: .2s;
}

.assistant-puntini span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes assistant-puntino {
    0%, 80%, 100% {
        opacity: .35;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

.assistant-in-arrivo {
    display: none !important;
}

@keyframes assistant-wave {
    0%, 100% {
        transform: rotate(0);
    }

    20% {
        transform: rotate(-14deg);
    }

    45% {
        transform: rotate(12deg);
    }

    70% {
        transform: rotate(-7deg);
    }

    85% {
        transform: rotate(4deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .assistant-fab {
        animation: none;
    }
}

/* AI panel on the home page: reuses the FAB, chat window and header
   from quotation-assistant.css; the chat layout (bubbles, product carousel, links) is here, scoped under .assistant-home. */

.assistant-home .assistant-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 560px;
}

.assistant-home .assistant-chat-messages > * {
    flex-shrink: 0;
}

.assistant-home .assistant-riga {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.assistant-home .assistant-riga-me {
    justify-content: flex-end;
}

.assistant-home .assistant-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex: none;
    margin-top: 2px;
}

.assistant-home .assistant-bolla {
    max-width: 82%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
}

.assistant-home .assistant-bolla-bot {
    background: #ffffff;
    border: 1px solid #e1dfd9;
    border-bottom-left-radius: 4px;
}

.assistant-home .assistant-bolla-me {
    background: #e6f1e8;
    border-bottom-right-radius: 4px;
}

.assistant-home .assistant-carosello {
    position: relative;
    margin-left: 30px;
}

.assistant-home .assistant-scorri {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 2px 2px 6px;
}

.assistant-home .assistant-scorri::-webkit-scrollbar {
    display: none;
}

.assistant-home .assistant-card {
    flex: 0 0 210px;
    scroll-snap-align: start;
    background: #ffffff;
    border: 1px solid #e1dfd9;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.assistant-home .assistant-card:hover {
    border-color: #111111;
}

.assistant-home .assistant-card-foto {
    aspect-ratio: 5 / 3;
    background: #f0efeb center / cover no-repeat;
}

.assistant-home .assistant-card-foto-vuota {
    display: none;
}

.assistant-home .assistant-card-corpo {
    padding: 9px 11px 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.assistant-home .assistant-card-titolo {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.assistant-home .assistant-pill-ai {
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #2d7a52;
    border: 1px solid currentColor;
    border-radius: 10px;
    padding: 1px 6px;
    white-space: nowrap;
}

.assistant-home .assistant-card-motivo {
    font-size: 12px;
    color: #626a6e;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.assistant-home .assistant-card-vai {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #111111;
}

.assistant-home .assistant-card-vai::after {
    content: " \2197";
}

.assistant-home .assistant-punti {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 2px;
}

.assistant-home .assistant-punti span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e1dfd9;
    display: block;
}

.assistant-home .assistant-punti span.on {
    background: #111111;
}

.assistant-home .assistant-freccia {
    position: absolute;
    top: 58px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #e1dfd9;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    font-size: 13px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.assistant-home .assistant-freccia-prev {
    left: -13px;
}

.assistant-home .assistant-freccia-next {
    right: -8px;
}

.assistant-home .assistant-suggerimenti {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-left: 30px;
    margin-top: 12px;
}

.assistant-home .assistant-suggerimenti small {
    font-size: 11px;
    color: #626a6e;
}

.assistant-home .assistant-suggerimento {
    font: inherit;
    font-size: 12.5px;
    color: #111111;
    background: none;
    border: none;
    border-bottom: 1px solid #e1dfd9;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
}

.assistant-home .assistant-suggerimento::before {
    content: "\2192  ";
    color: #626a6e;
}

.assistant-home .assistant-suggerimento:hover {
    border-color: #111111;
}

.assistant-home .assistant-pastiglia {
    align-self: flex-start;
    margin-left: 30px;
    margin-top: -6px;
    font-size: 12.5px;
    color: #111111;
    text-decoration: none;
    border-bottom: 1px solid #e1dfd9;
    max-width: calc(100% - 30px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assistant-home .assistant-pastiglia::before {
    content: "\2192  ";
    color: #626a6e;
}

.assistant-home .assistant-pastiglia::after {
    content: " \2197";
    color: #626a6e;
}

.assistant-home .assistant-pastiglia:hover {
    border-color: #111111;
}

.assistant-home .assistant-nascosto {
    display: none;
}

.assistant-home .assistant-riparti {
    align-self: center;
    font-size: 12px;
    font-weight: 500;
    color: #626a6e;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
}

.assistant-home .assistant-riparti:hover {
    color: #111111;
}

.assistant-home .assistant-chat-input:focus {
    outline: none;
    border-color: #111111;
}

@media (prefers-reduced-motion: reduce) {
    .assistant-home .assistant-scorri {
        scroll-behavior: auto;
    }
}

/* The "typing" dots are a bot bubble at the bottom of the thread, after the bubble the customer
   has just sent (both placed by home-assistant.js while the postback runs). Both rows carry
   .assistant-caricamento: hidden here with the same specificity as .assistant-riga, shown by
   the .caricamento rule of quotation-assistant.css, which is more specific. */
.assistant-home .assistant-caricamento {
    display: none;
    margin: 0;
}

.assistant-home .assistant-bolla-pensa {
    display: flex;
    align-items: center;
    padding: 12px;
}

.assistant-home .assistant-ordini {
    margin-left: 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.assistant-home .assistant-ordine {
    width: 380px;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid #e1dfd9;
    border-radius: 8px;
}

.assistant-home .assistant-ordine-testa {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    cursor: pointer;
    list-style: none;
}

.assistant-home .assistant-ordine-testa::-webkit-details-marker {
    display: none;
}

.assistant-home .assistant-ordine-numero {
    flex: none;
    font-weight: 600;
    font-size: 12.5px;
}

.assistant-home .assistant-ordine-prodotto {
    flex: 1;
    min-width: 0;
    font-size: 11.5px;
    color: #626a6e;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.assistant-home .assistant-ordine-freccia {
    flex: none;
    color: #9a9a94;
    font-size: 14px;
    line-height: 1;
    transition: transform .15s ease;
}

.assistant-home .assistant-ordine[open] .assistant-ordine-freccia {
    transform: rotate(90deg);
}

.assistant-home .assistant-ordine-pastiglia {
    flex: none;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: .03em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    border-radius: 10px;
    padding: 1px 7px;
    color: #2d7a52;
}

.assistant-home .assistant-ordine-pastiglia-ambra {
    color: #b96f12;
}

.assistant-home .assistant-ordine-corpo {
    padding: 0 12px 12px;
}

.assistant-home .assistant-ordine-meta {
    font-size: 11px;
    color: #9a9a94;
    margin-top: -4px;
}

.assistant-home .assistant-tappe {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin: 14px 0 2px;
}

.assistant-home .assistant-tappa {
    text-align: center;
    position: relative;
}

.assistant-home .assistant-tappa::before {
    content: "";
    position: absolute;
    top: 5px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #e1dfd9;
    z-index: 0;
}

.assistant-home .assistant-tappa:first-child::before {
    display: none;
}

.assistant-home .assistant-punto {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e1dfd9;
    margin: 0 auto 6px;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 3px #ffffff;
}

.assistant-home .assistant-tappa-etichetta {
    font-size: 9.5px;
    line-height: 1.2;
    color: #626a6e;
}

.assistant-home .assistant-tappa-data {
    font-size: 9px;
    line-height: 1.3;
    color: #9a9a94;
}

.assistant-home .assistant-tappa-fatta::before {
    background: #2d7a52;
}

.assistant-home .assistant-tappa-fatta .assistant-punto {
    background: #2d7a52;
}

.assistant-home .assistant-tappa-corrente::before {
    background: #2d7a52;
}

.assistant-home .assistant-tappa-corrente .assistant-punto {
    background: #111111;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, .13);
}

.assistant-home .assistant-tappa-corrente .assistant-tappa-etichetta {
    color: #111111;
    font-weight: 600;
}

.assistant-home .assistant-tappa-ferma::before {
    background: #b96f12;
}

.assistant-home .assistant-tappa-ferma .assistant-punto {
    background: #b96f12;
    box-shadow: 0 0 0 3px rgba(185, 111, 18, .16);
}

.assistant-home .assistant-tappa-ferma .assistant-tappa-etichetta {
    color: #b96f12;
    font-weight: 600;
}

.assistant-home .assistant-ordine-stato {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #e1dfd9;
    font-size: 12px;
    color: #626a6e;
}

.assistant-home .assistant-ordine-stato b {
    color: #111111;
    font-weight: 600;
}

.assistant-home .assistant-ordine-alert {
    margin-top: 9px;
    background: #fdf4e6;
    border: 1px solid #f0d9b0;
    border-radius: 6px;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.45;
}

.assistant-home .assistant-ordine-tracking {
    margin-top: 9px;
    background: #f4f6f4;
    border: 1px solid #e0e5e0;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 11.5px;
    color: #626a6e;
    line-height: 1.5;
}

.assistant-home .assistant-ordine-tracking b {
    color: #111111;
    font-weight: 600;
}

.assistant-home .assistant-ordine-tracking a {
    color: #111111;
}

.assistant-home .assistant-ordini-tutti {
    align-self: flex-start;
    font-size: 12.5px;
    color: #111111;
    text-decoration: none;
    border-bottom: 1px solid #e1dfd9;
}

.assistant-home .assistant-ordini-tutti::after {
    content: " \2197";
    color: #626a6e;
}

.assistant-home .assistant-ordini-tutti:hover {
    border-color: #111111;
}

.assistant-home .assistant-ordine-azioni {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.assistant-home .assistant-ordine-azioni span {
    display: inline-flex;
}

.assistant-home .assistant-ordine-azione {
    display: inline-block;
    background: #111111;
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border-radius: 16px;
    padding: 5px 13px;
}

.assistant-home .assistant-ordine-azione::after {
    content: " \2197";
}

.assistant-home .assistant-ordine-alert .assistant-ordine-azione {
    background: #b96f12;
}

.assistant-home .assistant-ordine-pastiglia-rossa {
    color: #b3261e;
}

.assistant-home .assistant-ordine-alert-rosso {
    background: #fdecea;
    border-color: #f3c9c4;
}

.assistant-home .assistant-ordine-alert-rosso .assistant-ordine-azione {
    background: #b3261e;
}

.assistant-home .assistant-ordine-alert .assistant-ordine-azione-secondaria,
.assistant-home .assistant-ordine-alert-rosso .assistant-ordine-azione-secondaria {
    background: transparent;
    color: #b3261e;
    border: 1px solid currentColor;
    padding: 4px 12px;
}
