/* iRCM Chatbot v8.3 — Fixed styles */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

#ircm-root, #ircm-root *, #ircm-root *::before, #ircm-root *::after {
    box-sizing: border-box !important;
    margin: 0; padding: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif !important;
    line-height: normal;
}

/* ── Welcome Bubble (White style) ── */
#ircm-bubble {
    position: fixed !important;
    bottom: 90px !important;
    right: 24px !important;
    width: 280px !important;
    background: #fff !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 24px rgba(0,0,0,.15) !important;
    border: 1px solid #e8e8e8 !important;
    padding: 18px 20px 18px 20px !important;
    z-index: 2147483647 !important;
    cursor: pointer !important;
    display: none;
    flex-direction: column !important;
    gap: 0 !important;
}
#ircm-bubble.ircm-bubble-show {
    display: flex !important;
    animation: ircmUp .25s ease !important;
}

/* Bubble close X */
#ircm-bbl-x {
    position: absolute !important;
    top: 8px !important;
    right: 10px !important;
    background: none !important;
    border: none !important;
    color: #aaa !important;
    font-size: 15px !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 2px 5px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    display: block !important;
}
#ircm-bbl-x:hover { color: #555 !important; }

/* Bubble text */
.ircm-bbl-title {
    margin: 0 0 10px 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #111 !important;
    line-height: 1.4 !important;
    padding-right: 20px !important;
}
.ircm-bbl-body {
    margin: 0 0 8px 0 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #444 !important;
    line-height: 1.6 !important;
}
.ircm-bbl-body:last-child { margin-bottom: 0 !important; }

/* ── Toggle Button ── */
#ircm-btn {
    position: fixed !important;
    bottom: 24px !important; right: 24px !important;
    width: 56px !important; height: 56px !important;
    border-radius: 50% !important;
    background: #1b3d5f !important;
    border: none !important; cursor: pointer !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.28) !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    z-index: 2147483647 !important;
    transition: transform .2s !important;
    padding: 0 !important;
}
#ircm-btn:hover { transform: scale(1.07) !important; }
#ircm-btn svg { width: 26px !important; height: 26px !important; fill: #fff !important; }

#ircm-dot {
    position: absolute !important; top: -2px !important; right: -2px !important;
    background: #e74c3c !important; color: #fff !important;
    width: 20px !important; height: 20px !important; border-radius: 50% !important;
    font-size: 11px !important; font-weight: 700 !important;
    display: none; align-items: center !important; justify-content: center !important;
    border: 2px solid #fff !important;
}

/* ── Chat Window ── */
#ircm-win {
    position: fixed !important;
    bottom: 90px !important; right: 24px !important;
    width: 320px !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 24px rgba(0,0,0,.15) !important;
    border: 1px solid #e8e8e8 !important;
    z-index: 2147483646 !important;
    display: none !important;
    flex-direction: column !important;
    overflow: hidden !important;
}
#ircm-win.ircm-show {
    display: flex !important;
    animation: ircmUp .2s ease !important;
}
@keyframes ircmUp {
    from { opacity:0; transform:translateY(8px); }
    to   { opacity:1; transform:translateY(0); }
}

/* ── Chat Header ── */
#ircm-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 16px !important;
    background: linear-gradient(135deg, #1b3d5f 0%, #2a5f8f 100%) !important;
    border-radius: 12px 12px 0 0 !important;
    flex-shrink: 0 !important;
    gap: 10px !important;
    box-sizing: border-box !important;
}
#ircm-hdr-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 !important;
    min-width: 0 !important;
}
#ircm-hdr-avatar {
    position: relative !important;
    flex-shrink: 0 !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(255,255,255,0.18) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid rgba(255,255,255,0.35) !important;
}
#ircm-hdr-dot {
    position: absolute !important;
    bottom: 1px !important;
    right: 1px !important;
    width: 10px !important;
    height: 10px !important;
    background: #22c55e !important;
    border-radius: 50% !important;
    border: 2px solid #1b3d5f !important;
    display: block !important;
}
#ircm-hdr-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    min-width: 0 !important;
}
#ircm-header-title {
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    text-align: left !important;
}
#ircm-hdr-sub {
    color: rgba(255,255,255,0.82) !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

/* Close X button */
#ircm-x {
    background: rgba(255,255,255,0.15) !important;
    border: none !important;
    color: #fff !important;
    font-size: 14px !important;
    cursor: pointer !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    transition: background .15s !important;
}
#ircm-x:hover { background: rgba(255,255,255,0.28) !important; }

/* ── Messages area ── */
#ircm-msgs {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 22px 18px 14px !important;
    display: flex !important; flex-direction: column !important; gap: 8px !important;
    background: #fff !important;
    min-height: 100px !important;
    max-height: 320px !important;
}
#ircm-msgs::-webkit-scrollbar { width: 3px !important; }
#ircm-msgs::-webkit-scrollbar-thumb { background: #eee !important; border-radius: 3px !important; }

/* Bot messages */
.ircm-msg-bot {
    color: #222 !important;
    font-size: 13.5px !important;
    line-height: 1.65 !important;
    align-self: flex-start !important;
    max-width: 100% !important;
    animation: ircmFd .18s ease !important;
}
.ircm-msg-bot p { margin: 0 0 8px !important; }
.ircm-msg-bot p:first-child { font-weight: 600 !important; font-size: 14px !important; }
.ircm-msg-bot p:last-child { margin: 0 !important; }

/* User messages */
.ircm-msg-usr {
    background: #1b3d5f !important; color: #fff !important;
    border-radius: 14px 2px 14px 14px !important;
    padding: 8px 12px !important; font-size: 13px !important;
    align-self: flex-end !important; max-width: 85% !important;
    animation: ircmFd .18s ease !important; word-break: break-word !important;
}

@keyframes ircmFd {
    from { opacity:0; transform:translateY(3px); }
    to   { opacity:1; transform:translateY(0); }
}

/* Typing dots */
.ircm-typing {
    display: flex !important; gap: 4px !important;
    align-items: center !important; padding: 4px 0 !important;
}
.ircm-typing span {
    width: 6px !important; height: 6px !important; background: #ccc !important;
    border-radius: 50% !important; animation: ircmBnc 1.1s infinite !important; display: block !important;
}
.ircm-typing span:nth-child(2) { animation-delay:.18s !important; }
.ircm-typing span:nth-child(3) { animation-delay:.36s !important; }
@keyframes ircmBnc {
    0%,60%,100%{ transform:translateY(0); }
    30%        { transform:translateY(-5px); }
}

/* Option buttons */
.ircm-card { width: 100% !important; animation: ircmFd .2s ease !important; }
.ircm-card-title {
    font-size: 13.5px !important; font-weight: 600 !important;
    color: #222 !important; margin-bottom: 8px !important;
}
.ircm-card-btn {
    display: block !important; width: 100% !important;
    background: #fff !important;
    border: 1px solid #e0e3e8 !important;
    border-radius: 7px !important;
    color: #1b3d5f !important;
    padding: 9px 12px !important;
    font-size: 13px !important; font-weight: 500 !important;
    text-align: left !important; cursor: pointer !important;
    margin-bottom: 5px !important;
    transition: background .1s, border-color .1s !important;
}
.ircm-card-btn:hover:not(:disabled) { background: #f5f8ff !important; border-color: #1b3d5f !important; }
.ircm-card-btn:disabled { opacity: .4 !important; cursor: default !important; }

/* ── Input area ── */
#ircm-inp-wrap {
    padding: 10px 12px !important;
    border-top: 1px solid #f0f0f0 !important;
    background: #fff !important;
    display: none !important;
    gap: 0 !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    position: relative !important;
}
#ircm-inp-wrap.ircm-on { display: flex !important; }

#ircm-inp {
    flex: 1 !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 10px 44px 10px 12px !important;
    font-size: 13px !important;
    outline: none !important;
    color: #333 !important;
    background: #fff !important;
    transition: border-color .15s !important;
}
#ircm-inp:focus { border-color: #bbb !important; }
#ircm-inp.ircm-err { border-color: #e74c3c !important; }
#ircm-inp::placeholder { color: #bbb !important; }

#ircm-send {
    position: absolute !important;
    right: 20px !important;
    background: none !important;
    border: 2px solid #ccc !important;
    border-radius: 50% !important;
    color: #aaa !important;
    width: 30px !important; height: 30px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    transition: border-color .15s, color .15s !important;
    padding: 0 !important;
}
#ircm-send:hover { border-color: #1b3d5f !important; color: #1b3d5f !important; }

/* Powered by */
#ircm-pow {
    text-align: center !important; padding: 7px !important;
    font-size: 10px !important; color: #ddd !important;
    background: #fff !important; border-top: 1px solid #f8f8f8 !important;
    flex-shrink: 0 !important;
}

/* Thank you screen */
.ircm-thankyou { text-align: center !important; padding: 20px 16px !important; }
.ircm-thankyou-check {
    width: 48px !important; height: 48px !important; background: #22c55e !important;
    border-radius: 50% !important; margin: 0 auto 10px !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    font-size: 22px !important; color: #fff !important;
}
.ircm-thankyou h3 { font-size: 14px !important; color: #1b3d5f !important; margin: 0 0 6px !important; }
.ircm-thankyou p  { font-size: 12.5px !important; color: #666 !important; line-height: 1.6 !important; margin: 0 0 4px !important; }
.ircm-thankyou .ircm-phone { margin-top: 8px !important; font-size: 11.5px !important; color: #999 !important; }
.ircm-thankyou .ircm-ty-note { margin-top: 10px !important; font-size: 12px !important; color: #888 !important; }

/* Summary card — email-style breakdown */
.ircm-summary {
    background: #f5f7fa !important;
    border: 1px solid #dce3ec !important;
    border-radius: 8px !important;
    margin: 12px 0 8px !important;
    overflow: hidden !important;
    text-align: left !important;
}
.ircm-summary-row {
    display: flex !important;
    align-items: center !important;
    padding: 8px 12px !important;
    border-bottom: 1px solid #dce3ec !important;
    font-size: 12px !important;
}
.ircm-summary-row:last-child { border-bottom: none !important; }
.ircm-summary-row:nth-child(odd)  { background: #ffffff !important; }
.ircm-summary-row:nth-child(even) { background: #f5f7fa !important; }
.ircm-summary-label {
    font-weight: 700 !important;
    color: #1b3d5f !important;
    min-width: 96px !important;
    font-size: 11.5px !important;
}
.ircm-summary-value {
    color: #444 !important;
    font-size: 12px !important;
    flex: 1 !important;
}

/* Error message */
.ircm-msg-err {
    background: #fff3f3 !important;
    color: #c0392b !important;
    border: 1px solid #fcc !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 12.5px !important;
    align-self: flex-start !important;
    max-width: 100% !important;
    animation: ircmFd .18s ease !important;
    line-height: 1.5 !important;
}

@media (max-width: 400px) {
    #ircm-win { width: calc(100vw - 16px) !important; right: 8px !important; bottom: 84px !important; }
    #ircm-bubble { width: calc(100vw - 48px) !important; right: 8px !important; }
}
