/* ==========================================================================
   rahav-chat.css — دستیار پاسخگوی لندینگ جشنواره (نسخهٔ درون هیرو)
   همهٔ قواعد زیر #rahav-landing اسکوپ شده‌اند.
   ========================================================================== */

#rahav-landing .hero__assistant{display:flex;justify-content:center;min-width:0}
#rahav-landing .rf-chat{position:relative;width:100%;max-width:460px;margin-inline:auto}
#rahav-landing .rf-chat__panel{
  display:flex;flex-direction:column;
  width:100%;
  height:clamp(450px,56vh,560px);
  background:linear-gradient(180deg,#101722 0%,#0B1017 100%);
  color:var(--cream);
  border:1px solid rgba(42,111,107,.28);
  border-radius:22px;
  box-shadow:0 30px 90px -30px rgba(0,0,0,.85),inset 0 1px 0 rgba(237,230,216,.05);
  overflow:hidden;
}

#rahav-landing .rf-chat__head{
  display:flex;align-items:center;gap:.7rem;
  padding:.9rem 1rem .85rem;
  border-bottom:1px solid rgba(237,230,216,.08);
  background:rgba(237,230,216,.025);
}
#rahav-landing .rf-chat__avatar{
  display:grid;place-items:center;flex:none;
  width:40px;height:40px;border-radius:14px;
  color:#EDE6D8;
  background:linear-gradient(135deg,#1D2B45,#162236);
  box-shadow:0 10px 24px -12px rgba(42,111,107,.8);
}
#rahav-landing .rf-chat__avatar svg{width:21px;height:21px}
#rahav-landing .rf-chat__who{display:grid;gap:.12rem;min-width:0}
#rahav-landing .rf-chat__who strong{
  font-family:var(--font-display);font-weight:700;font-size:.98rem;
  color:var(--paper);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#rahav-landing .rf-chat__who span{font-size:.7rem;color:rgba(237,230,216,.5)}

#rahav-landing .rf-chat__clear{
  display:grid;place-items:center;flex:none;
  width:34px;height:34px;border-radius:10px;
  border:1px solid rgba(237,230,216,.1);
  background:rgba(237,230,216,.04);
  color:rgba(237,230,216,.62);
  cursor:pointer;
  margin-inline-start:auto;
  transition:color .25s,background .25s,border-color .25s;
}
#rahav-landing .rf-chat__clear svg{width:16px;height:16px}
#rahav-landing .rf-chat__clear:hover{
  color:var(--paper);background:rgba(42,111,107,.14);border-color:rgba(42,111,107,.35);
}
#rahav-landing .rf-chat__clear:disabled{opacity:.4;cursor:default;background:rgba(237,230,216,.04);border-color:rgba(237,230,216,.1);color:rgba(237,230,216,.62)}

#rahav-landing .rf-chat__log{
  flex:1 1 auto;
  display:flex;flex-direction:column;gap:.65rem;
  padding:1rem;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:rgba(42,111,107,.5) transparent;
}
#rahav-landing .rf-chat__log::-webkit-scrollbar{width:6px}
#rahav-landing .rf-chat__log::-webkit-scrollbar-thumb{background:rgba(42,111,107,.45);border-radius:99px}

#rahav-landing .rf-msg{
  max-width:90%;
  padding:.68rem .85rem;
  border-radius:15px;
  font-size:.84rem;line-height:1.95;
  white-space:pre-line;
  overflow-wrap:anywhere;
  animation:rf-msg-in .3s var(--ease-out);
}
@keyframes rf-msg-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
#rahav-landing .rf-msg--bot{
  align-self:flex-start;
  background:rgba(237,230,216,.055);
  border:1px solid rgba(237,230,216,.075);
  border-start-start-radius:5px;
  color:rgba(237,230,216,.88);
}
#rahav-landing .rf-msg--user{
  align-self:flex-end;
  background:linear-gradient(135deg,#1D2B45,#162236);
  border-end-end-radius:5px;
  color:#EDE6D8;font-weight:600;
}
#rahav-landing .rf-msg a{color:#DDE9E4;text-decoration:underline;text-underline-offset:3px}
#rahav-landing .rf-msg--note{
  align-self:center;
  max-width:100%;
  background:transparent;
  border:1px dashed rgba(42,111,107,.38);
  color:rgba(237,230,216,.66);
  font-size:.72rem;
  line-height:1.8;
  padding:.38rem .6rem;
  border-radius:10px;
  text-align:center;
}

#rahav-landing .rf-typing{align-self:flex-start;display:flex;gap:5px;padding:.8rem .95rem;border-radius:15px;background:rgba(237,230,216,.055);border:1px solid rgba(237,230,216,.075)}
#rahav-landing .rf-typing i{width:6px;height:6px;border-radius:50%;background:rgba(237,230,216,.55);animation:rf-dot 1s infinite}
#rahav-landing .rf-typing i:nth-child(2){animation-delay:.16s}
#rahav-landing .rf-typing i:nth-child(3){animation-delay:.32s}
@keyframes rf-dot{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-4px);opacity:1}}

#rahav-landing .rf-chat__chips{
  display:flex;gap:.4rem;flex-wrap:wrap;
  padding:.1rem 1rem .7rem;
}
#rahav-landing .rf-chat__chips button{
  font-family:inherit;font-size:.72rem;
  padding:.38rem .62rem;border-radius:999px;
  border:1px solid rgba(42,111,107,.28);
  background:rgba(42,111,107,.08);
  color:#DDE9E4;cursor:pointer;
  transition:background .25s,border-color .25s,color .25s;
}
#rahav-landing .rf-chat__chips button:hover{background:rgba(42,111,107,.18);border-color:rgba(42,111,107,.5);color:var(--paper)}

#rahav-landing .rf-chat__form{
  display:flex;align-items:flex-end;gap:.5rem;
  padding:.75rem 1rem .35rem;
  border-top:1px solid rgba(237,230,216,.07);
}
#rahav-landing .rf-chat__form textarea{
  flex:1 1 auto;min-width:0;
  resize:none;max-height:88px;
  padding:.6rem .75rem;
  border-radius:12px;
  border:1px solid rgba(237,230,216,.1);
  background:rgba(237,230,216,.045);
  color:var(--paper);font-family:inherit;font-size:.82rem;line-height:1.7;
}
#rahav-landing .rf-chat__form textarea::placeholder{color:rgba(237,230,216,.35)}
#rahav-landing .rf-chat__form textarea:focus{outline:none;border-color:rgba(42,111,107,.55);box-shadow:0 0 0 3px rgba(42,111,107,.12)}
#rahav-landing .rf-chat__send{
  display:grid;place-items:center;flex:none;
  width:42px;height:42px;border-radius:12px;
  border:1px solid rgba(237,230,216,.14);
  background:linear-gradient(135deg,var(--teal),var(--brand));
  color:#EDE6D8;cursor:pointer;
  transition:transform .25s,box-shadow .25s;
}
#rahav-landing .rf-chat__send svg{width:19px;height:19px}
#rahav-landing .rf-chat__send:hover{transform:translateY(-1px);box-shadow:0 10px 22px -10px rgba(42,111,107,.8)}
#rahav-landing .rf-chat__send:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}

#rahav-landing .rf-chat__note{
  padding:.15rem 1rem .7rem;
  font-size:.62rem;line-height:1.7;
  color:rgba(237,230,216,.34);
  text-align:center;
}
#rahav-landing .rf-chat__sr{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

#rahav-landing .rf-chat__clear:focus-visible,
#rahav-landing .rf-chat__send:focus-visible,
#rahav-landing .rf-chat__chips button:focus-visible{
  outline:2px solid #DDE9E4;outline-offset:3px;
}

@media (max-width:900px){
  #rahav-landing .hero__assistant{margin-top:28px}
  #rahav-landing .rf-chat{max-width:560px}
  #rahav-landing .rf-chat__panel{height:clamp(430px,56vh,520px)}
}

@media (max-width:600px){
  #rahav-landing .rf-chat__panel{
    height:clamp(460px,68vh,620px);
    height:clamp(460px,68dvh,620px);
    border-radius:20px;
  }
  #rahav-landing .rf-chat__who span{font-size:.66rem}

  /* گفتگو باید خوانا و قابل اسکرول باشد */
  #rahav-landing .rf-chat__log{padding:.9rem;gap:.6rem}
  #rahav-landing .rf-msg{font-size:.94rem;line-height:1.95;max-width:94%}

  /* پرسش‌های پیشنهادی: یک ردیف قابل اسکرول به‌جای چند ردیف */
  #rahav-landing .rf-chat__chips{
    flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;
    scrollbar-width:none;padding:.15rem 1rem .65rem;gap:.3rem;
  }
  #rahav-landing .rf-chat__chips::-webkit-scrollbar{display:none}
  #rahav-landing .rf-chat__chips button{flex:none;font-size:.72rem;padding:.38rem .58rem}
  #rahav-landing .rf-chat__note{font-size:.68rem;padding:.2rem 1rem .85rem}
}

@media (prefers-reduced-motion:reduce){
  #rahav-landing .rf-msg,
  #rahav-landing .rf-typing i{animation:none}
  #rahav-landing .rf-chat__send{transition:none}
}
