/* ──────────────────────────────────────────────
   RushRooms Chatbot — global styles
   Loaded once via /includes/chatbot.php
   Scoped to .rr-chat-root and chat-* utility classes.

   No physical left/right properties anywhere — all directional CSS uses
   logical equivalents (inset-inline-*, padding-inline-*, margin-inline-*,
   border-*-radius logical corners, text-align: start/end). The widget
   auto-flips for RTL based on the document's `dir` attribute.
   ────────────────────────────────────────────── */

/* ── Animations ── */
@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes chatMsgFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes chatFormSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes chatAuthCardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes chatAuthShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}
@keyframes chatAuthCheckDraw {
  from { stroke-dashoffset: 26; }
  to   { stroke-dashoffset: 0; }
}
@keyframes chatAuthRingPulse {
  0%   { transform: scale(0.6); opacity: 0.55; }
  100% { transform: scale(1.6);  opacity: 0; }
}
@keyframes chatOtpPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes chatStepFill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes chatTypingPulse {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}
@keyframes chatFabPulseRing {
  0%   { transform: scale(1); opacity: 0.45; }
  100% { transform: scale(1.65); opacity: 0; }
}
@keyframes chatStatusPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
@keyframes chatSpin {
  to { transform: rotate(360deg); }
}
/* Auth CTA chip (when bot returns routeTo) */
.chat-route-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block-start: 8px;
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
}
.chat-route-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(244,63,94,0.40);
}

/* Rental-review CTA (when bot returns rent_object) */
.chat-rental-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-block-start: 8px;
  padding: 9px 16px;
  border: 0;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.chat-rental-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(244,63,94,0.45) !important;
}
.chat-rental-cta:active { transform: scale(0.97); }

/* ── Loader spinner helper ── */
.chat-spin {
  display: inline-flex;
  animation: chatSpin 1s linear infinite;
}

/* ── FAB pulse ring ── */
.chat-fab-pulse {
  animation: chatFabPulseRing 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── Status dot ── */
.chat-status-dot {
  animation: chatStatusPulse 2s ease-in-out infinite;
}

/* ── Hover / active micro-interactions ── */
.chat-fab-btn:hover    { transform: scale(1.06) !important; }
.chat-fab-btn:active   { transform: scale(0.96) !important; }
.chat-header-btn:hover { background: rgba(255,255,255,0.14) !important; }
.chat-header-btn:active{ transform: scale(0.92); }

.chat-new-conv-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -4px rgba(244,63,94,0.42) !important;
}
.chat-new-conv-btn:active:not(:disabled) { transform: scale(0.98); }

.chat-suggestion-btn:hover {
  background: rgba(244,63,94,0.14) !important;
  border-color: rgba(244,63,94,0.30) !important;
}

.chat-send-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -2px rgba(244,63,94,0.40);
}
.chat-send-btn:not(:disabled):active { transform: scale(0.94); }

.chat-product-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 24px -8px rgba(244,63,94,0.18) !important;
  border-color: rgba(244,63,94,0.25) !important;
}

.chat-load-more-btn:hover { background: rgba(244,63,94,0.08) !important; }
.chat-close-pill:hover { background: rgba(0,0,0,0.05) !important; }

.chat-form-submit:hover {
  opacity: 0.94;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px -4px rgba(244,63,94,0.45) !important;
}
.chat-form-submit:active { transform: scale(0.98) !important; }

.chat-conv-item .chat-conv-card:hover {
  background: rgba(244,63,94,0.05) !important;
  border-color: rgba(244,63,94,0.15) !important;
}
.chat-conv-item:hover .chat-delete-btn { opacity: 1 !important; }
.chat-delete-btn { opacity: 0; transition: opacity 0.18s ease, background 0.15s ease, color 0.15s ease; }
.chat-delete-btn:hover {
  background: #fef2f2 !important;
  color: #ef4444 !important;
}

.chat-carousel-prev:hover,
.chat-carousel-next:hover {
  transform: translateY(-50%) scale(1.06);
  box-shadow: 0 4px 14px rgba(244,63,94,0.20) !important;
}
.chat-carousel-next:hover { transform: translateY(-50%) scale(1.06); }

.chat-reopen-form-btn:hover { transform: translateY(-1px); }
.chat-reopen-form-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
  font-size: 12px;
  font-weight: 600;
}

/* ── Scrollbar styling ── */
.chat-messages-scroll,
.chat-conversation-scroll,
.chat-form-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.14) transparent;
  /* Don't bubble scroll up to the page when the inner list is scrolled to its
     edge — prevents the entire site from scrolling while inside the chat. */
  overscroll-behavior: contain;
}
.chat-messages-scroll::-webkit-scrollbar,
.chat-conversation-scroll::-webkit-scrollbar,
.chat-form-scroll::-webkit-scrollbar {
  width: 5px; height: 5px;
}
.chat-messages-scroll::-webkit-scrollbar-track,
.chat-conversation-scroll::-webkit-scrollbar-track,
.chat-form-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages-scroll::-webkit-scrollbar-thumb,
.chat-conversation-scroll::-webkit-scrollbar-thumb,
.chat-form-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.14);
  border-radius: 10px;
}
.chat-messages-scroll::-webkit-scrollbar-thumb:hover,
.chat-conversation-scroll::-webkit-scrollbar-thumb:hover,
.chat-form-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(244,63,94,0.40);
}

/* ── Carousel scroller: hide scrollbar visually but keep the area scrollable ── */
.chat-product-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-inline: contain;
}
.chat-product-scroll::-webkit-scrollbar { display: none; }

/* ── HTML content inside message bubbles ── */
.chat-html-content p { margin: 0 0 0.5em; }
.chat-html-content p:last-child { margin-block-end: 0; }
.chat-html-content strong { font-weight: 600; }
.chat-html-content em { font-style: italic; }
.chat-html-content ul,
.chat-html-content ol { padding-inline-start: 1.25em; margin: 0.4em 0; }
.chat-html-content li { margin-block-end: 0.25em; }
.chat-html-content a {
  text-decoration: underline;
  opacity: 0.9;
  overflow-wrap: anywhere;
}
.chat-html-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: rgba(0,0,0,0.06);
  border-radius: 5px;
  padding: 0.15em 0.4em;
}
.chat-html-content h1,
.chat-html-content h2,
.chat-html-content h3 {
  font-weight: 600;
  margin: 0.5em 0 0.25em;
}
.prose-invert .chat-html-content code {
  background: rgba(255,255,255,0.18);
}
.prose-invert .chat-html-content a { color: inherit; }

/* ── RTL flip for direction-aware icons ──
   Any element tagged `data-chat-flip-rtl` (e.g., the back-button chevron and
   the carousel arrows) is mirrored horizontally when the widget sits in an
   RTL document. CSS is the only thing that touches direction — JS stays
   direction-agnostic. */
.rr-chat-root[dir="rtl"] [data-chat-flip-rtl] { transform: scaleX(-1); }
/* The "next" carousel arrow already has rotate(180deg) applied; cancel the
   double-flip by reversing the scale on top of that rotate. */
.rr-chat-root[dir="rtl"] .chat-carousel-next [data-chat-flip-rtl] {
  transform: scaleX(-1) rotate(180deg);
}

/* ── Mobile-first responsive ──
   Handle notch/dynamic island and virtual keyboard using:
   - dvh: dynamic viewport height (changes when keyboard opens)
   - env(safe-area-inset-*): safe area for notch/dynamic island
   - svh: smallest viewport height fallback for older browsers
*/
@media (max-width: 640px) {
  .rr-chat-root .chat-container {
    inset-block-end: max(12px, env(safe-area-inset-bottom, 12px)) !important;
    inset-inline-end: max(12px, env(safe-area-inset-end, 12px)) !important;
    inset-inline-start: max(12px, env(safe-area-inset-start, 12px)) !important;
    padding: 0 !important;
  }
  .rr-chat-root .chat-window {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    height: min(560px, calc(100dvh - 120px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))) !important;
    margin-block-end: 8px !important;
    box-shadow: 0 20px 50px -8px rgba(244,63,94,0.20) !important;
    border-radius: 16px !important;
  }
  .rr-chat-root .chat-container.is-open .chat-fab-wrapper {
    display: flex !important;
    justify-content: flex-end;
    width: 100%;
  }
  .rr-chat-root .chat-header-root {
    padding-top: max(14px, env(safe-area-inset-top, 0px)) !important;
  }
  .rr-chat-root .chat-input-root {
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
  }
  .rr-chat-root .chat-messages-scroll {
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 480px) {
  .rr-chat-root .chat-container {
    inset-block-end: max(8px, env(safe-area-inset-bottom, 8px)) !important;
    inset-inline-end: 8px !important;
    inset-inline-start: 8px !important;
  }
  .rr-chat-root .chat-window {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    height: min(calc(100dvh - 100px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)), calc(100svh - 100px)) !important;
    margin-block-end: 6px !important;
    border-radius: 14px !important;
  }
  .rr-chat-root .chat-container.is-open .chat-fab-wrapper {
    padding: 0 !important;
  }
}

/* Landscape orientation on mobile - compact height */
@media (max-width: 640px) and (orientation: landscape) {
  .rr-chat-root .chat-window {
    height: min(calc(100dvh - 80px), calc(100svh - 80px)) !important;
    max-height: calc(100dvh - 80px) !important;
  }
  .rr-chat-root .chat-header-root {
    padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 8px !important;
  }
  .rr-chat-root .chat-input-root > div:first-child {
    padding-top: 6px !important;
  }
}

/* Handle keyboard visible state via JS - supplement with CSS when focused */
.rr-chat-root.chat-keyboard-visible .chat-window {
  height: min(calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)), calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))) !important;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
}

/* Small mobile screens */
@media (max-width: 360px) {
  .rr-chat-root .chat-window {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
    border-radius: 12px !important;
  }
  .rr-chat-root .chat-container {
    inset-inline-end: 6px !important;
    inset-inline-start: 6px !important;
  }
}

/* ── Number-input: hide the native spinner so our custom +/- stepper is the
   sole UI. The native one is inconsistent across browsers and visually
   incompatible with the brand. ── */
.chat-num-input::-webkit-inner-spin-button,
.chat-num-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.chat-num-input { -moz-appearance: textfield; appearance: textfield; }

/* Number stepper button hover */
[data-number-step]:hover { background: rgba(244,63,94,0.10) !important; }
[data-number-step]:active { transform: scale(0.94); }

/* ── Refined microinteractions ── */
.chat-form-card { will-change: transform, opacity; }
.chat-form-scroll { scroll-padding-block: 8px; }

/* Suggestion chip enter — subtle stagger */
.chat-suggestion-btn {
  animation: chatMsgFadeIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.chat-suggestion-btn:nth-child(2) { animation-delay: 0.04s; }
.chat-suggestion-btn:nth-child(3) { animation-delay: 0.08s; }
.chat-suggestion-btn:nth-child(4) { animation-delay: 0.12s; }
.chat-suggestion-btn:nth-child(n+5) { animation-delay: 0.16s; }

/* Conversation list rows enter with a subtle lift */
.chat-conv-item {
  animation: chatMsgFadeIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.chat-conv-item:nth-child(2) { animation-delay: 0.04s; }
.chat-conv-item:nth-child(3) { animation-delay: 0.07s; }
.chat-conv-item:nth-child(4) { animation-delay: 0.10s; }
.chat-conv-item:nth-child(n+5) { animation-delay: 0.13s; }

/* Form submit button: subtle press feedback */
.chat-form-submit:active { transform: scale(0.98) !important; }

/* ── Auth form — refined detail layer ── */
.chat-auth-card {
  position: relative;
  animation: chatAuthCardIn 0.42s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.chat-auth-card.is-error .chat-auth-otp-row { animation: chatAuthShake 0.42s ease-in-out; }

.chat-auth-step-track {
  position: relative;
  height: 2px;
  background: rgba(0,0,0,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.chat-auth-step-fill {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  width: 50%;
  background: linear-gradient(90deg, #f43f5e, #f97316);
  border-radius: 2px;
  transform-origin: left center;
  animation: chatStepFill 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.rr-chat-root[dir="rtl"] .chat-auth-step-fill { transform-origin: right center; }
.chat-auth-step-fill.is-full { width: 100%; }

.chat-auth-step-dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: -0.01em;
  background: #fff;
  color: #a1a1aa;
  border: 1.5px solid rgba(0,0,0,0.10);
  transition: all 0.25s ease;
  font-variant-numeric: tabular-nums;
}
.chat-auth-step-dot.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #f43f5e 0%, #f97316 100%);
  box-shadow: 0 4px 10px -3px rgba(244,63,94,0.45);
}
.chat-auth-step-dot.is-done {
  color: #f43f5e;
  border-color: #f43f5e;
  background: #fff5f7;
}

.chat-auth-icon-wrap {
  position: relative;
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(244,63,94,0.10), rgba(249,115,22,0.08));
  border: 1px solid rgba(244,63,94,0.18);
  color: #f43f5e;
  flex-shrink: 0;
}
.chat-auth-icon-wrap::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: 14px;
  border: 2px solid rgba(244,63,94,0.35);
  opacity: 0;
  animation: chatAuthRingPulse 2.4s ease-out infinite;
}

.chat-auth-field {
  position: relative;
  display: flex;
  align-items: stretch;
  background: #fafafa;
  border: 1.5px solid rgba(0,0,0,0.06);
  border-radius: 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.chat-auth-field.is-focused {
  border-color: #f43f5e;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(244,63,94,0.10);
}
.chat-auth-field-prefix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 12px;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: #18181b;
  letter-spacing: -0.005em;
  border-inline-end: 1px solid rgba(0,0,0,0.06);
  background: linear-gradient(180deg, rgba(244,63,94,0.04), transparent);
}
.chat-auth-field-prefix .chat-auth-flag {
  font-size: 14px;
  line-height: 1;
}
.chat-auth-field input {
  flex: 1; min-width: 0;
  padding: 12px 13px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: #18181b;
  background: transparent;
  border: 0;
  outline: 0;
  direction: ltr;
  text-align: start;
}
.chat-auth-field input::placeholder { color: #a1a1aa; font-weight: 400; }

.chat-auth-floating-label {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  padding: 0 4px;
  font-size: 12px;
  font-weight: 500;
  color: #a1a1aa;
  pointer-events: none;
  background: transparent;
  letter-spacing: -0.005em;
  transition: all 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.chat-auth-field.has-prefix .chat-auth-floating-label { inset-inline-start: 70px; }
.chat-auth-field.is-focused .chat-auth-floating-label,
.chat-auth-field.is-filled .chat-auth-floating-label {
  inset-block-start: 0;
  transform: translateY(-50%) scale(0.84);
  background: #ffffff;
  color: #f43f5e;
  font-weight: 600;
}

.chat-auth-otp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  direction: ltr;
}
.chat-auth-otp-row .chat-auth-otp-sep {
  width: 12px;
  align-self: center;
  height: 1.5px;
  background: rgba(0,0,0,0.10);
  border-radius: 2px;
  order: 3;
}
.chat-auth-otp-box {
  flex: 1 1 calc(16.666% - 5px);
  min-width: 32px;
  max-width: 48px;
  height: 44px;
  text-align: center;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 17px; font-weight: 700;
  color: #18181b;
  background: #fafafa;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  outline: 0;
  letter-spacing: 0;
  caret-color: #f43f5e;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.chat-auth-otp-box:nth-child(n+4) { order: 4; }
.chat-auth-otp-box:nth-child(3) { order: 2; }
.chat-auth-otp-box:nth-child(6) { order: 5; }
.chat-auth-otp-box.is-filled {
  background: #fff;
  border-color: rgba(244,63,94,0.35);
  animation: chatOtpPop 0.24s ease-out;
}
.chat-auth-otp-box:focus {
  background: #fff;
  border-color: #f43f5e;
  box-shadow: 0 0 0 4px rgba(244,63,94,0.12);
}

.chat-auth-cta {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 12px 16px;
  border-radius: 13px;
  border: 0;
  background: linear-gradient(135deg, #f43f5e 0%, #f97316 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow:
    0 6px 18px -6px rgba(244,63,94,0.55),
    inset 0 1px 0 rgba(255,255,255,0.20);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.chat-auth-cta::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.chat-auth-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px -6px rgba(244,63,94,0.55),
    inset 0 1px 0 rgba(255,255,255,0.20);
}
.chat-auth-cta:hover::before { transform: translateX(100%); }
.chat-auth-cta:active:not(:disabled) { transform: scale(0.98); }
.chat-auth-cta:disabled { opacity: 0.65; cursor: not-allowed; }

.chat-auth-ghost {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: #f43f5e;
  letter-spacing: -0.01em;
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s ease, color 0.15s ease;
}
.chat-auth-ghost:hover { background: rgba(244,63,94,0.08); }
.chat-auth-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin-block-start: 4px;
  color: #a1a1aa;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chat-auth-divider::before,
.chat-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.10), transparent);
}

.chat-auth-register {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  color: #18181b;
  background: rgba(0,0,0,0.025);
  border: 1px solid rgba(0,0,0,0.06);
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: all 0.18s ease;
}
.chat-auth-register:hover {
  background: rgba(244,63,94,0.06);
  border-color: rgba(244,63,94,0.20);
  color: #f43f5e;
  transform: translateY(-1px);
}
.chat-auth-register .chat-auth-register-arrow {
  display: inline-flex;
  transition: transform 0.18s ease;
}
.chat-auth-register:hover .chat-auth-register-arrow { transform: translateX(2px); }
.rr-chat-root[dir="rtl"] .chat-auth-register:hover .chat-auth-register-arrow { transform: translateX(-2px); }

.chat-auth-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 500;
  color: #a1a1aa;
  letter-spacing: 0.005em;
  padding-block-start: 2px;
}

.chat-auth-success-ring {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow:
    0 10px 24px -6px rgba(16,185,129,0.50),
    inset 0 1px 0 rgba(255,255,255,0.25);
}
.chat-auth-success-ring::before {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(16,185,129,0.40);
  animation: chatAuthRingPulse 1.6s ease-out infinite;
}
.chat-auth-success-check {
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  animation: chatAuthCheckDraw 0.55s cubic-bezier(0.65, 0, 0.4, 1) 0.15s forwards;
}

.chat-auth-error,
.chat-auth-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 500;
  text-align: start;
  letter-spacing: -0.005em;
}
.chat-auth-error {
  background: linear-gradient(135deg, #fef2f2, #fff1f2);
  border: 1px solid #fecaca;
  color: #991b1b;
}
.chat-auth-notice {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  color: #166534;
}
.chat-auth-error svg,
.chat-auth-notice svg { flex-shrink: 0; }

/* ── Accessibility: respect reduced-motion ── */
@media (max-width: 400px) {
  .chat-auth-card {
    border-radius: 14px;
  }
  .chat-auth-card .chat-auth-otp-row {
    gap: 4px;
  }
  .chat-auth-card .chat-auth-otp-box {
    height: 40px;
    font-size: 15px;
    flex: 1 1 calc(16.666% - 4px);
    min-width: 28px;
  }
  .chat-auth-card .chat-auth-field-prefix {
    padding-inline: 10px;
    font-size: 11.5px;
  }
  .chat-auth-card .chat-auth-field input {
    padding: 11px 11px;
    font-size: 12.5px;
  }
  .chat-auth-card .chat-auth-field.has-prefix .chat-auth-floating-label {
    inset-inline-start: 64px;
  }
  .chat-auth-card .chat-auth-cta {
    padding: 11px 14px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rr-chat-root *,
  .rr-chat-root *::before,
  .rr-chat-root *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
