/* Admin-only AI assistant panel on the legacy quotation forms (UCQuotationAssistant.ascx).
   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-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-invito {
    font-size: 13px;
    color: #626a6e;
    margin: 0 0 10px;
}

.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;
    }
}
