/*!
 * assets/css/chat.css — self-hosted live chat widget (Phase 2c).
 * Public-website styling: Freight Sans / Times LT, brand blue #3a8dde,
 * limed-spruce #36404a, desert-storm #ededec. Scoped under #au-chat.
 */
#au-chat {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    font-family: "FreightSans", "Freight Sans", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #36404a;
}

#au-chat .au-chat-launcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    padding: 14px 24px;
    background: #3a8dde;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
#au-chat .au-chat-launcher:hover {
    background: #3bbfad;
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}
#au-chat .au-chat-launcher:focus-visible { outline: 3px solid #4ac1e0; outline-offset: 2px; }
#au-chat .au-chat-launcher svg { flex: none; }

#au-chat .au-chat-badge {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    /* White on #ff8300 was 2.47:1. #C93030 is the same red the admin chat
       inbox already uses for unread rows (5.32:1). */
    background: #C93030;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid #fff;
}

#au-chat .au-chat-panel {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 0;
    bottom: 64px;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    border: 1px solid #dee2e6;
}

#au-chat .au-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #36404a;
    color: #fff;
}
#au-chat .au-chat-head strong {
    font-family: "Times LT Roman", "Times LT", serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.012em;
    display: block;
    line-height: 1.2;
}
#au-chat .au-chat-status { display: block; font-size: 12.5px; opacity: 0.9; margin-top: 3px; font-family: inherit; }
#au-chat .au-chat-status.is-online::before { content: "\25CF  "; color: #3bbfad; }
#au-chat .au-chat-status.is-offline::before { content: "\25CF  "; color: #ffb37a; }
#au-chat .au-chat-close {
    border: 0; background: transparent; color: #fff;
    font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px;
    opacity: 0.85;
}
#au-chat .au-chat-close:hover { opacity: 1; }

#au-chat .au-chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #ededec;
}
#au-chat .au-chat-msg { margin-bottom: 12px; display: flex; flex-direction: column; }
#au-chat .au-chat-who { font-size: 11.5px; color: #6c757d; margin-bottom: 3px; font-weight: 600; }
#au-chat .au-chat-body {
    display: inline-block;
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 14.5px;
    line-height: 1.5;
    background: #fff;
    color: #1f2429;
    border: 1px solid #dee2e6;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}
#au-chat .au-chat-time { font-size: 10.5px; color: #6c757d; margin-top: 3px; }
#au-chat .au-chat-visitor { align-items: flex-end; }
#au-chat .au-chat-visitor .au-chat-body { background: #3a8dde; color: #fff; border-color: #3a8dde; }
#au-chat .au-chat-visitor .au-chat-time { align-self: flex-end; }
#au-chat .au-chat-agent { align-items: flex-start; }
#au-chat .au-chat-system { align-items: center; }
#au-chat .au-chat-sys {
    font-size: 12.5px; color: #495057; text-align: center;
    background: #fff; border: 1px solid #dee2e6;
    border-radius: 10px; padding: 8px 12px; line-height: 1.5;
}

#au-chat form { padding: 12px 14px 14px; border-top: 1px solid #dee2e6; background: #fff; }
#au-chat input[type="text"],
#au-chat input[type="email"],
#au-chat textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    color: #1f2429;
    background: #fff;
    line-height: 1.45;
}
#au-chat input[type="text"]:focus,
#au-chat input[type="email"]:focus,
#au-chat textarea:focus {
    outline: none;
    border-color: #3a8dde;
    box-shadow: 0 0 0 3px rgba(58, 141, 222, 0.18);
}
#au-chat textarea { resize: vertical; min-height: 64px; }

/* Placeholders must be clearly visible on white fields. The theme sets every
   placeholder site-wide to white (for its dark Marketo forms), which made the
   chat fields look broken — white on white. These ID-scoped rules win on
   specificity and restore a readable grey in every engine. */
#au-chat input::placeholder,
#au-chat textarea::placeholder {
    color: #6c757d;
    opacity: 1;
}
#au-chat input::-webkit-input-placeholder,
#au-chat textarea::-webkit-input-placeholder {
    color: #6c757d;
    opacity: 1;
}
#au-chat input::-moz-placeholder,
#au-chat textarea::-moz-placeholder {
    color: #6c757d;
    opacity: 1;
}
#au-chat input:-ms-input-placeholder,
#au-chat textarea:-ms-input-placeholder {
    color: #6c757d;
    opacity: 1;
}
#au-chat input::-ms-input-placeholder,
#au-chat textarea::-ms-input-placeholder {
    color: #6c757d;
    opacity: 1;
}

#au-chat button[type="submit"] {
    width: 100%;
    padding: 14px 20px;
    border: 0;
    border-radius: 4px;
    background: #3a8dde;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.2s ease;
}
#au-chat button[type="submit"]:hover { background: #3bbfad; }
#au-chat button[type="submit"]:disabled { opacity: 0.6; cursor: default; }
#au-chat button[type="submit"]:focus-visible { outline: 3px solid #4ac1e0; outline-offset: 2px; }

#au-chat .au-chat-error {
    display: none;
    margin: 0 0 10px;
    padding: 9px 12px;
    border-radius: 4px;
    background: #fdecea;
    border-left: 4px solid #e53e3e;
    color: #9b2c2c;
    font-size: 13.5px;
    line-height: 1.45;
}
#au-chat .au-chat-hp { position: absolute; left: -9999px; }
#au-chat .au-chat-note { margin: 8px 0 0; font-size: 12px; color: #6c757d; text-align: center; }

@media (max-width: 480px) {
    #au-chat { right: 12px; bottom: 12px; }
    #au-chat .au-chat-panel { width: calc(100vw - 24px); height: 70vh; }
    #au-chat .au-chat-launcher { padding: 12px 20px; font-size: 15px; }
}

@media print { #au-chat { display: none !important; } }

/* The site's fullscreen mobile menu (.mobile-nav.active, z-index 9999) must
   never have a floating chat button sitting over/beside it. */
body:has(.mobile-nav.active) #au-chat { display: none; }

/* Respect users who prefer reduced motion / high contrast. */
@media (prefers-reduced-motion: reduce) {
    #au-chat .au-chat-launcher { transition: none; }
}
@media (prefers-contrast: more) {
    #au-chat .au-chat-body { border-color: #1f2429; }
    #au-chat .au-chat-status { opacity: 1; }
    #au-chat input::placeholder,
    #au-chat textarea::placeholder { color: #495057; }
}
