/* ============================================================
   BRODCO BUILT-IN WARDROBES — Triage Chatbot Styles
   Theme: Dark Ink (#141414) & Brodco Red (#D31A1F)
   ============================================================ */

.brodco-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #141414;
  -webkit-font-smoothing: antialiased;
}

/* Floating Launcher Button */
.brodco-chat-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #141414;
  color: #FFFFFF;
  border: 2px solid #D31A1F;
  border-radius: 32px;
  padding: 10px 18px 10px 12px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(20, 20, 20, 0.35);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.brodco-chat-launcher:hover {
  background: #242424;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(20, 20, 20, 0.45);
}

.brodco-chat-launcher:active {
  transform: translateY(0);
}

.brodco-launcher-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #D31A1F;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
  position: relative;
}

.brodco-launcher-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.brodco-launcher-pulse {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #00E676;
  border: 2px solid #141414;
  border-radius: 50%;
}

.brodco-launcher-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.brodco-launcher-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: #FFFFFF;
}

.brodco-launcher-sub {
  font-size: 0.72rem;
  color: #B5B5B5;
  line-height: 1.2;
}

/* Chat Window Box */
.brodco-chat-box {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 110px);
  background: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(20, 20, 20, 0.28), 0 0 0 1px rgba(20, 20, 20, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.brodco-chat-box.brodco-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.brodco-chat-header {
  background: #141414;
  color: #FFFFFF;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #D31A1F;
}

.brodco-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brodco-header-avatar {
  width: 36px;
  height: 36px;
  background: #D31A1F;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #FFFFFF;
  letter-spacing: -0.5px;
}

.brodco-header-titles h4 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #FFFFFF;
  line-height: 1.15;
}

.brodco-header-status {
  font-size: 0.72rem;
  color: #A6A6A6;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.brodco-status-dot {
  width: 6px;
  height: 6px;
  background: #00E676;
  border-radius: 50%;
  display: inline-block;
}

.brodco-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brodco-btn-icon {
  background: transparent;
  border: none;
  color: #B5B5B5;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.brodco-btn-icon:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
}

/* Chat Body (Messages Stream) */
.brodco-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #F5F5F5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.brodco-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: brodcoFadeIn 0.22s ease-out;
}

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

.brodco-msg.brodco-bot {
  align-self: flex-start;
}

.brodco-msg.brodco-user {
  align-self: flex-end;
}

.brodco-msg-bubble {
  padding: 11px 15px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.brodco-msg.brodco-bot .brodco-msg-bubble {
  background: #FFFFFF;
  color: #141414;
  border-bottom-left-radius: 2px;
  border: 1px solid #E2E2E2;
}

.brodco-msg.brodco-user .brodco-msg-bubble {
  background: #141414;
  color: #FFFFFF;
  border-bottom-right-radius: 2px;
}

/* Options Container */
.brodco-options-container {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
  animation: brodcoFadeIn 0.22s ease-out;
}

.brodco-option-btn {
  background: #FFFFFF;
  border: 1.5px solid #E2E2E2;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #141414;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.16s ease;
}

.brodco-option-btn:hover {
  border-color: #D31A1F;
  background: #FBE7E7;
  color: #A81216;
  transform: translateX(3px);
}


/* Direct Call Banner */
.brodco-call-card {
  background: #FBE7E7;
  border: 1.5px solid #D31A1F;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 6px 0;
  text-align: center;
}

.brodco-call-card h5 {
  margin: 0 0 4px;
  color: #A81216;
  font-size: 0.95rem;
  font-weight: 800;
}

.brodco-call-card p {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: #585858;
}

.brodco-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #D31A1F;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s ease;
  box-sizing: border-box;
}

.brodco-call-btn:hover {
  background: #A81216;
}

/* Form Container inside Chat */
.brodco-form-card {
  background: #FFFFFF;
  border: 1px solid #E2E2E2;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brodco-input-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brodco-input-field label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #585858;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.brodco-input-field input,
.brodco-input-field select,
.brodco-input-field textarea {
  width: 100%;
  border: 1.5px solid #E2E2E2;
  border-radius: 4px;
  padding: 9px 10px;
  font-size: 0.86rem;
  font-family: inherit;
  color: #141414;
  background: #FFFFFF;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.brodco-input-field input:focus,
.brodco-input-field select:focus,
.brodco-input-field textarea:focus {
  outline: none;
  border-color: #D31A1F;
}

.brodco-area-status {
  min-height: 17px;
  margin: 2px 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #6B6B6B;
}

.brodco-area-status.is-valid {
  color: #0E6238;
  font-weight: 700;
}

.brodco-area-status.is-invalid {
  color: #A91D1D;
  font-weight: 700;
}

.brodco-input-field input.service-area-invalid {
  border-color: #C62828;
  background: #FFF8F8;
}

.brodco-submit-btn {
  background: #D31A1F;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  margin-top: 4px;
}

.brodco-submit-btn:hover {
  background: #A81216;
  transform: translateY(-1px);
}

.brodco-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Success Confirmation State */
.brodco-success-card {
  background: #EAF8F1;
  border: 1.5px solid #00C853;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.brodco-success-icon {
  width: 36px;
  height: 36px;
  background: #00C853;
  color: #FFFFFF;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.brodco-success-card h5 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
  color: #0E6238;
}

.brodco-success-card p {
  margin: 0;
  font-size: 0.82rem;
  color: #1C4D35;
  line-height: 1.45;
}

/* Footer / Hotline Bar */
.brodco-chat-footer {
  padding: 9px 14px;
  background: #FFFFFF;
  border-top: 1px solid #E2E2E2;
  text-align: center;
  font-size: 0.74rem;
  color: #777;
}

.brodco-chat-footer a {
  color: #D31A1F;
  text-decoration: none;
  font-weight: 700;
}

/* Mobile Responsive: collapse the wide pill launcher to an icon-only bubble
   so it stops overlapping page content at phone widths. */
@media (max-width: 700px) {
  .brodco-launcher-text {
    display: none;
  }

  .brodco-chat-launcher {
    width: 58px;
    height: 58px;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

@media (max-width: 480px) {
  .brodco-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .brodco-chat-box {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* ------------------------------------------------------------
   Bottom clearance for the fixed chat launcher.
   The launcher is position:fixed (bottom 24px desktop / 16px mobile,
   ~58px tall) so without reserved space it covers the footer and the
   last content. Extend the footer's dark area to clear it.
   ------------------------------------------------------------ */
footer { padding-bottom: 104px !important; }

@media (max-width: 480px) {
  footer { padding-bottom: 92px !important; }
}
