/* ==========================================================================
   روزنة — 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;
  /* a dark seal: engraved gold rings spread out from the logo, like light through a window */
  background:
    radial-gradient(circle at 34% 34%, rgba(198, 169, 100, .2) 0, transparent 44%),
    repeating-radial-gradient(circle at 34% 34%, rgba(198, 169, 100, .1) 0 1px, transparent 1.5px 8px),
    #1f150c;
  border: 1px solid #c6a964;
  box-shadow: 0 0 0 4px #efe3cf, 0 0 0 5px rgba(198, 169, 100, .7), -12px -14px 30px -14px rgba(30, 20, 10, .55);
  overflow: visible; transition: transform .45s cubic-bezier(.16, 1, .3, 1), opacity .3s, box-shadow .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); box-shadow: 0 0 0 4px #efe3cf, 0 0 0 5px #c6a964, 0 0 34px -2px rgba(198, 169, 100, .5), -12px -14px 30px -14px rgba(30, 20, 10, .55); }
.rz-ai-launch:active { transform: translate(-4px, -4px) scale(.96); }
.rz-ai-launch__logo { position: absolute; left: 34%; top: 34%; width: 60px; height: auto; transform: translate(-50%, -50%); filter: drop-shadow(0 0 8px rgba(198, 169, 100, .5)); }
.rz-ai-launch::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1.5px solid rgba(198, 169, 100, .65); 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 button inside the chat: a solid green pill with a white icon disc */
.rz-ai__cta { align-self: stretch; padding-top: 2px; }
.rz-ai__wa { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; border-radius: 999px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #2fd672 0%, #1fb459 55%, #128c46 100%);
  box-shadow: 0 14px 28px -14px rgba(18, 140, 70, .85), inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -2px 0 rgba(0, 0, 0, .12);
  transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s, filter .25s; }
.rz-ai__wa::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(120%); animation: rzShine 1.4s .4s cubic-bezier(.4, 0, .2, 1) 1; pointer-events: none; }
@keyframes rzShine { to { transform: translateX(-120%); } }
.rz-ai__wa:hover { transform: translateY(-2px); filter: saturate(1.08) brightness(1.04); box-shadow: 0 18px 32px -14px rgba(18, 140, 70, .9), inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -2px 0 rgba(0, 0, 0, .12); }
.rz-ai__wa:active { transform: scale(.98); }
.rz-ai__wa-ic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #fff; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .3); }
.rz-ai__wa-ic svg { width: 26px; height: 26px; fill: #1fb459; }
.rz-ai__wa-tx { flex: 1; display: grid; gap: 1px; line-height: 1.45; }
.rz-ai__wa-tx b { font-size: 1.02rem; font-weight: 700; }
.rz-ai__wa-tx small { font-size: .8rem; color: rgba(255, 255, 255, .88); }
.rz-ai__wa-go { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.rz-ai__wa-go svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.rz-ai__wa:hover .rz-ai__wa-go svg { transform: translateX(-3px); }

/* the page behind the chat dims and stays still */
.rz-ai-shade { position: fixed; inset: 0; z-index: 95; background: rgba(30, 20, 12, .38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s linear .35s; }
.rz-ai-open .rz-ai-shade { opacity: 1; visibility: visible; transition: opacity .45s, visibility 0s; }
html.rz-ai-open { overflow: hidden; }
.rz-ai__log { overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(139, 101, 66, .35) transparent; }
.rz-ai__log::-webkit-scrollbar { width: 6px; }
.rz-ai__log::-webkit-scrollbar-thumb { background: rgba(139, 101, 66, .35); border-radius: 6px; }

.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); } }

/* starter questions under the greeting; they leave with the first question */
.rz-ai__sugg { display: grid; gap: 8px; margin-top: 2px; transition: opacity .25s, transform .25s; }
.rz-ai__sugg.is-gone { opacity: 0; transform: translateY(6px); }
.rz-ai__sugg-h { font-size: .78rem; font-weight: 600; color: #7a6650; padding-inline: 4px; }
.rz-ai__chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 14px; cursor: pointer;
  font: inherit; font-size: .92rem; text-align: start; color: #3a2a1b; background: #fbf6ee; border: 1px solid rgba(108, 74, 46, .18);
  transition: background-color .2s, border-color .2s, color .2s; }
.rz-ai__chip svg { flex: none; width: 16px; height: 16px; fill: none; stroke: #a8683c; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s, stroke .2s; }
.rz-ai__chip:hover { background: #8b6542; border-color: #8b6542; color: #f5ead8; }
.rz-ai__chip:hover svg { stroke: #f5ead8; transform: translateX(-3px); }

.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: 52px; }
  .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; }
}
