/* ==========================================================================
   روزنة — AI guide (chat widget), sand & clay theme
   ========================================================================== */

/* ---------- Launcher ---------- */
/* a disc tucked into the bottom-right corner: only its inner part shows, and it leans out on hover */
.rz-ai-launch {
  position: fixed; z-index: 95; right: -34px; bottom: -34px;
  width: 112px; height: 112px; padding: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 38% 38%, #a07650, #5b3d24 72%);
  border: 2px solid rgba(226, 197, 151, .75);
  box-shadow: 0 0 0 6px rgba(239, 227, 207, .55), -10px -12px 34px -12px rgba(46, 33, 22, .55);
  overflow: visible; transition: transform .45s cubic-bezier(.16, 1, .3, 1), opacity .3s;
}
/* hidden over the hero video; it appears once the visitor scrolls down, and leaves again at the top */
html:not(.past-hero):not(.rz-ai-open) .rz-ai-launch { opacity: 0; pointer-events: none; transform: translateY(16px) scale(.9); }
.rz-ai-launch:hover, .rz-ai-launch:focus-visible { transform: translate(-8px, -8px); }
.rz-ai-launch:active { transform: translate(-4px, -4px) scale(.96); }
.rz-ai-launch__logo { position: absolute; left: 34%; top: 34%; width: 46px; height: auto; transform: translate(-50%, -50%); }
.rz-ai-launch::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1.5px solid rgba(168, 104, 60, .55); opacity: 0; pointer-events: none;
}
.past-hero .rz-ai-launch::after { animation: rzPulse 2.6s ease-out 3; }
@keyframes rzPulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
.rz-ai-launch__dot { display: none; position: absolute; top: 14px; left: 14px; width: 13px; height: 13px; border-radius: 50%; background: #4fae6c; border: 2px solid #f4eadb; }
.rz-ai-tip {
  position: absolute; right: calc(100% - 20px); top: 24%; transform: translateY(-50%) translateX(8px);
  white-space: nowrap; padding: 10px 16px; border-radius: 14px 14px 4px 14px;
  background: #f4eadb; color: #3a2a1b; font: 600 .95rem/1.4 var(--sans);
  box-shadow: 0 14px 30px -12px rgba(46, 33, 22, .45); opacity: 0; pointer-events: none;
  transition: opacity .4s, transform .4s;
}
.rz-ai-tip.is-on { opacity: 1; transform: translateY(-50%); }
.rz-ai-open .rz-ai-launch { transform: translate(30px, 30px) scale(.6); opacity: 0; pointer-events: none; }

/* ---------- Panel ---------- */
.rz-ai {
  position: fixed; z-index: 96; right: 22px; bottom: 22px;
  width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 44px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #f4eadb; color: #3a2a1b; border-radius: 26px;
  border: 1px solid rgba(58, 42, 27, .14);
  box-shadow: 0 40px 90px -30px rgba(46, 33, 22, .65);
  font-family: var(--sans); direction: rtl;
  clip-path: circle(0 at calc(100% - 10px) calc(100% - 10px)); visibility: hidden;
  transition: clip-path .38s cubic-bezier(.4, 0, 1, 1), visibility 0s linear .38s;
}
/* the chat grows out of the corner as a circle, then its contents settle in */
.rz-ai-open .rz-ai { clip-path: circle(150% at calc(100% - 10px) calc(100% - 10px)); visibility: visible;
  transition: clip-path .75s cubic-bezier(.16, 1, .3, 1), visibility 0s; }
.rz-ai__top, .rz-ai__log, .rz-ai__chips, .rz-ai__form, .rz-ai__note { opacity: 0; transform: translateY(14px); transition: opacity .2s, transform .2s; }
.rz-ai-open .rz-ai__top, .rz-ai-open .rz-ai__log, .rz-ai-open .rz-ai__chips, .rz-ai-open .rz-ai__form, .rz-ai-open .rz-ai__note {
  opacity: 1; transform: none; transition: opacity .5s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1); }
.rz-ai-open .rz-ai__top { transition-delay: .12s; }
.rz-ai-open .rz-ai__log { transition-delay: .2s; }
.rz-ai-open .rz-ai__chips { transition-delay: .26s; }
.rz-ai-open .rz-ai__form { transition-delay: .32s; }
.rz-ai-open .rz-ai__note { transition-delay: .36s; }
/* WhatsApp card inside the chat */
.rz-ai__cta { display: grid; gap: 10px; }
.rz-ai__wa { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; background: #2f8f55; color: #f5ead8; font-weight: 700; font-size: 1rem; text-decoration: none; transition: background-color .2s, transform .15s; }
.rz-ai__wa:hover { background: #267a48; }
.rz-ai__wa:active { transform: scale(.97); }
.rz-ai__wa svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rz-ai__wa small { margin-inline-start: auto; font-weight: 500; font-size: .85rem; opacity: .85; }

.rz-ai__top {
  flex: none; position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 60px;
  background: radial-gradient(120% 140% at 90% 0%, #9c7048, #5b3d24 70%); color: #f5ead8;
}
.rz-ai__badge { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(46, 33, 22, .3); border: 1px solid rgba(226, 197, 151, .5); }
.rz-ai__badge img { width: 34px; height: auto; }
.rz-ai__title { line-height: 1.35; }
.rz-ai__title strong { display: block; font-family: var(--display); font-size: 1.4rem; font-weight: 700; color: #f5ead8; }
.rz-ai__status { display: flex; align-items: center; gap: 7px; font-size: .78rem; color: rgba(245, 234, 216, .82); }
.rz-ai__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #6fd08e; }
.rz-ai__close {
  position: absolute; top: 50%; left: 14px; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(46, 33, 22, .3); color: #f5ead8; display: grid; place-items: center; transition: background-color .2s;
}
.rz-ai__close:hover { background: rgba(46, 33, 22, .55); }
.rz-ai__close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

.rz-ai__log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.rz-ai__msg { max-width: 88%; padding: 12px 15px; border-radius: 18px; font-size: .95rem; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.rz-ai__msg--bot { align-self: flex-start; background: #efe3cf; border: 1px solid rgba(58, 42, 27, .1); border-top-right-radius: 6px; font-size: 1.02rem; line-height: 1.95; }
.rz-ai__msg--me { align-self: flex-end; background: #8b6542; color: #f5ead8; border-top-left-radius: 6px; font-weight: 500; }
.rz-ai__typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.rz-ai__typing i { width: 7px; height: 7px; border-radius: 50%; background: #a8683c; animation: rzDots 1.1s infinite ease-in-out; }
.rz-ai__typing i:nth-child(2) { animation-delay: .15s; }
.rz-ai__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rzDots { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.rz-ai__chips { display: flex; gap: 8px; padding: 4px 16px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.rz-ai__chips::-webkit-scrollbar { display: none; }
.rz-ai__chip {
  flex: none; padding: 8px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .85rem;
  background: transparent; color: #6c4a2e; border: 1px solid rgba(108, 74, 46, .35); transition: background-color .2s, color .2s;
}
.rz-ai__chip:hover { background: #8b6542; color: #f5ead8; }

.rz-ai__form { flex: none; display: flex; align-items: flex-end; gap: 8px; margin: 0 12px 6px; padding: 6px; border-radius: 18px; background: #efe3cf; border: 1px solid rgba(58, 42, 27, .14); }
.rz-ai__form:focus-within { border-color: rgba(139, 101, 66, .6); }
.rz-ai__input { flex: 1; resize: none; max-height: 110px; padding: 9px 10px; border: 0; background: transparent; color: #3a2a1b; font: inherit; font-size: .95rem; line-height: 1.6; outline: none; }
.rz-ai__input::placeholder { color: rgba(58, 42, 27, .45); }
.rz-ai__send { flex: none; width: 42px; height: 42px; border-radius: 14px; border: 0; cursor: pointer; display: grid; place-items: center; background: #8b6542; color: #f5ead8; transition: opacity .2s, transform .2s; }
.rz-ai__send:disabled { opacity: .4; cursor: default; }
.rz-ai__send svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: scaleX(-1); }
.rz-ai__note { flex: none; margin: 0; padding: 2px 16px 12px; text-align: center; font-size: .7rem; color: rgba(58, 42, 27, .5); }

/* keep the hero "discover" cue clear of the launcher */

@media (max-width: 600px) {
  .rz-ai-launch { right: -30px; bottom: -30px; width: 98px; height: 98px; }
  .rz-ai-launch__logo { width: 40px; }
  .rz-ai { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .rz-ai-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rz-ai-launch::after { animation: none !important; }
  .rz-ai, .rz-ai-open .rz-ai { transition: none; }
  .rz-ai__top, .rz-ai__log, .rz-ai__chips, .rz-ai__form, .rz-ai__note { transition: none !important; }
}
