/* ========================================
   IMC SMART RFQ
   ======================================== */

.imc-rfq {
    --ink: #111827;
    --muted: #667085;
    --line: #e5e7eb;
    --panel: #fff;
    --soft: #f7f8fa;
    --accent: #111827;

    max-width: 920px;
    margin: 64px auto;
    font-family: inherit;
    color: var(--ink);
}

.imc-rfq * {
    box-sizing: border-box;
}

/* HEADER */

.imc-rfq__eyebrow {
    font-size: 12px;
    letter-spacing: .16em;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 10px;
}

.imc-rfq__title {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
    letter-spacing: -.035em;
    margin: 0 0 14px;
    font-weight: 700;
}

.imc-rfq__sub {
    max-width: 720px;
    font-size: 18px;
    line-height: 1.6;
    color: var(--muted);
    margin: 0 0 26px;
}

/* MAIN CARD */

.imc-rfq__card {
    position: relative;
    margin-top: 32px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(17, 24, 39, .10);
    border-radius: 24px;
    box-shadow: 0 18px 60px rgba(17, 24, 39, .09);
    overflow: hidden;
    backdrop-filter: blur(12px);
}

/* START OVER BUTTON */

.imc-rfq__reset {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 5;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    margin: 0 !important;
    padding: 6px 10px !important;

    background: transparent !important;
    border: none !important;
    border-radius: 8px;

    color: #64748b !important;
    font-family: inherit;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.4;

    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}

.imc-rfq__reset:hover {
    color: #111827 !important;
    background: #f3f4f6 !important;
}

/* CHAT THREAD */

.imc-rfq__thread {
    display: none;
    padding: 22px 22px 4px;
    max-height: 420px;
    overflow: auto;
}

.imc-rfq__thread.is-active {
    display: block;
}

.imc-rfq__msg {
    max-width: 82%;
    padding: 12px 15px;
    border-radius: 16px;
    margin: 0 0 12px;
    line-height: 1.45;
    font-size: 15px;
}

.imc-rfq__msg--user {
    margin-left: auto;
    background: #111827;
    color: #fff;
    border-bottom-right-radius: 5px;
}

.imc-rfq__msg--assistant {
    background: #f4f5f7;
    color: #1f2937;
    border-bottom-left-radius: 5px;
}

.imc-rfq__msg--typing {
    color: #667085;
    font-style: italic;
}

/* SUGGESTION BUTTONS */

.imc-rfq__suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 46px 22px 0;
}

.imc-rfq__suggestions button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 9px 13px;
    font: inherit;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: .18s;
}

.imc-rfq__suggestions button:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    background: #fafafa;
}

/* INPUT AREA */

.imc-rfq__composer {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    padding: 18px 18px 16px;
}

.imc-rfq__composer textarea {
    flex: 1;
    resize: none;
    min-height: 64px;
    max-height: 180px;
    border: 0;
    outline: 0;
    background: var(--soft);
    border-radius: 17px;
    padding: 18px;
    font: inherit;
    font-size: 17px;
    line-height: 1.45;
    color: var(--ink);
    box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .05);
}

.imc-rfq__composer textarea::placeholder {
    color: #98a2b3;
}

/* MICROPHONE AND SEND BUTTONS */

.imc-rfq__actions {
    display: flex;
    gap: 8px;
}

.imc-rfq__mic,
.imc-rfq__send {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: .18s;
}

.imc-rfq__mic {
    background: #f2f4f7;
    color: #344054;
}

.imc-rfq__send {
    background: #111827;
    color: #fff;
}

.imc-rfq__mic:hover,
.imc-rfq__send:hover {
    transform: translateY(-1px);
}

.imc-rfq__mic.is-listening {
    box-shadow: 0 0 0 5px rgba(17, 24, 39, .10);
    animation: imcPulse 1.3s infinite;
}

.imc-rfq__mic svg,
.imc-rfq__send svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

@keyframes imcPulse {
    50% {
        box-shadow: 0 0 0 10px rgba(17, 24, 39, .03);
    }
}

/* FOOTER AND PROGRESS */

.imc-rfq__footer {
    border-top: 1px solid var(--line);
    padding: 11px 18px 14px;
    font-size: 12px;
    color: #7c8492;
}

.imc-rfq__progress {
    height: 3px;
    background: #eef0f3;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}

.imc-rfq__progress span {
    display: block;
    width: 8%;
    height: 100%;
    background: #111827;
    border-radius: 99px;
    transition: width .35s ease;
}

.imc-rfq__card.is-complete .imc-rfq__progress span {
    width: 100% !important;
}

.imc-rfq__card.is-busy .imc-rfq__send {
    opacity: .5;
    pointer-events: none;
}

/* MOBILE */

@media (max-width: 640px) {

    .imc-rfq {
        margin: 38px 0;
    }

    .imc-rfq__title {
        font-size: 38px;
    }

    .imc-rfq__sub {
        font-size: 16px;
    }

    .imc-rfq__card {
        border-radius: 18px;
        margin-top: 24px;
    }

    .imc-rfq__reset {
        top: 10px;
        right: 12px;
        font-size: 11px !important;
    }

    .imc-rfq__suggestions {
        overflow: auto;
        flex-wrap: nowrap;
        padding: 44px 14px 0;
        padding-right: 10px;
    }

    .imc-rfq__suggestions button {
        white-space: nowrap;
    }

    .imc-rfq__composer {
        gap: 8px;
        padding: 14px;
    }

    .imc-rfq__composer textarea {
        min-height: 58px;
        font-size: 16px;
        padding: 16px;
    }

    .imc-rfq__mic,
    .imc-rfq__send {
        width: 42px;
        height: 42px;
    }

    .imc-rfq__msg {
        max-width: 91%;
    }
}

/* IMC Smart RFQ — Start over button redesign */

/* Allow the button to sit beneath the progress footer */
.imc-rfq__card {
    display: flex;
    flex-direction: column;
}

/* Move Start over to the bottom-right */
.imc-rfq__reset,
.imc-rfq__restart,
.imc-rfq [data-reset] {
    position: static !important;
    align-self: flex-end;
    order: 10;
    margin: 0 24px 18px 0 !important;
    padding: 4px 0 !important;

    background: transparent !important;
    border: none !important;
    box-shadow: none !important;

    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer;
}

/* Subtle hover effect */
.imc-rfq__reset:hover,
.imc-rfq__restart:hover,
.imc-rfq [data-reset]:hover {
    color: #111827 !important;
    text-decoration: underline;
}

/* Start a new request — subtle bottom link */

.imc-rfq__reset {
    position: static !important;
    display: block;
    align-self: flex-end;
    width: auto !important;

    margin: 0 24px 18px auto !important;
    padding: 4px 0 !important;

    background: transparent !important;
    border: none !important;
    box-shadow: none !important;

    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.5;
    cursor: pointer;
}

.imc-rfq__reset:hover {
    color: #111827 !important;
    text-decoration: underline;
}

/* ==========================================
   IMC SMART RFQ — ANIMATED TYPING INDICATOR
   ========================================== */

.imc-rfq__msg--typing {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    width: fit-content;
    max-width: 90%;

    padding: 14px 18px;

    font-size: 13px;
    line-height: 1.5;
}

/* Three animated dots */

.imc-rfq__typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.imc-rfq__typing-dots span {
    display: block;

    width: 6px;
    height: 6px;

    border-radius: 50%;
    background: #64748b;

    animation: imcTypingPulse 1.3s infinite ease-in-out;
}

.imc-rfq__typing-dots span:nth-child(2) {
    animation-delay: 0.18s;
}

.imc-rfq__typing-dots span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes imcTypingPulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Status text */

.imc-rfq__typing-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 400;

    opacity: 1;
    transition: opacity 0.18s ease;
}

.imc-rfq__typing-label.is-changing {
    opacity: 0;
}

/* Accessibility: reduced motion */

@media (prefers-reduced-motion: reduce) {

    .imc-rfq__typing-dots span {
        animation: none;
        opacity: 0.7;
    }

    .imc-rfq__typing-label {
        transition: none;
    }

}