/* ==========================================================================
   LP02 · UNIT 2 · YOUR CLIENTS WILL ASK YOU FIRST
   --------------------------------------------------------------------------
   Visual idea: the question arrives in the advisor's own chat.
   • Scene: a warm photo of a business owner at work, with a glass chat
     window floating over it. The chat carries no invented copy — only
     symbols: the client's bubble (document + question mark), a typing
     indicator, then the advisor's answer with the Fatorly mark tucked
     BEHIND the bubble (a technology partner behind you).
   • A dashed "exit" arrow leaving the chat is crossed out: the client is
     not sent somewhere else.
   • Copy column: title, first sentence, and the second sentence in a
     highlighted card.
   Static fallback: every bubble visible, typing indicator hidden.
   ========================================================================== */

.ask {
  background: linear-gradient(180deg, #F7F5F1 0%, var(--c-cloud) 100%);
}

.ask__decor {
  background:
    radial-gradient(ellipse 40% 50% at 95% 30%, rgba(0, 169, 182, 0.10), transparent 70%),
    radial-gradient(ellipse 35% 40% at 0% 90%, rgba(242, 178, 92, 0.12), transparent 70%);
}

[dir="rtl"] .ask__decor {
  scale: -1 1;
}

.ask__grid {
  display: grid;
  gap: clamp(3rem, 6vw, 4.5rem);
  align-items: center;
}

@media (min-width: 48rem) {
  .ask__grid {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

/* ---------------------------------------------------------------------------
   Copy column
   --------------------------------------------------------------------------- */
.ask__copy {
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
  text-align: center;
}

@media (min-width: 48rem) {
  .ask__copy {
    justify-items: start;
    text-align: start;
  }
}

.ask__copy .t-body {
  max-inline-size: 32rem;
}

/* Second sentence: a highlighted "partner behind you" card */
.ask__answer {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  max-inline-size: 32rem;
  padding: var(--space-lg);
  border-radius: var(--r-card);
  background-color: var(--c-white);
  box-shadow: var(--shadow-md);
  text-align: start;
}

/* Stacked icon: the F mark sitting behind a person glyph */
.ask__answer-icon {
  position: relative;
  flex-shrink: 0;
  inline-size: 3rem;
  block-size: 3rem;
}

.ask__answer-icon img {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  inline-size: 2rem;
  block-size: 2rem;
  padding: 0.25rem;
  border-radius: 9px;
  background-color: var(--c-white);
  box-shadow: var(--shadow-sm);
}

.ask__answer-icon span {
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  display: grid;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: 50%;
  border: 3px solid var(--c-white);
  background-color: var(--c-navy);
  color: var(--c-teal);
}

.ask__answer-icon svg {
  inline-size: 1.05rem;
  block-size: 1.05rem;
}

.ask__answer p {
  font-weight: 500;
  color: var(--c-ink);
}

/* ---------------------------------------------------------------------------
   Scene: photo backdrop + floating chat window
   --------------------------------------------------------------------------- */
.ask__scene {
  position: relative;
  inline-size: min(100%, 34rem);
  margin-inline: auto;
}

.ask__photo {
  overflow: hidden;
  border-radius: clamp(1.25rem, 3vw, 1.75rem);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 48rem) {
  .ask__photo {
    aspect-ratio: 11 / 9;
    inline-size: 88%;
    margin-inline-start: auto;
  }
}

.ask__photo img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* Chat window */
.chat {
  position: relative;
  z-index: 2;
  display: grid;
  gap: var(--space-sm);
  inline-size: calc(100% - 2rem);
  margin-block-start: -5rem;
  margin-inline: auto;
  padding: var(--space-md);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background-color: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 48rem) {
  .chat {
    position: absolute;
    inset-block-end: -2.5rem;
    inset-inline-start: 0;
    inline-size: 68%;
    margin: 0;
  }
}

.chat__bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-block-end: var(--space-sm);
  border-block-end: 1px solid var(--c-ink-a10);
}

.chat__avatar {
  position: relative;
  flex-shrink: 0;
  inline-size: 2.25rem;
  block-size: 2.25rem;
}

.chat__avatar img {
  inline-size: 100%;
  block-size: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* "Online" dot */
.chat__avatar::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  inline-size: 0.6rem;
  block-size: 0.6rem;
  border-radius: 50%;
  border: 2px solid var(--c-white);
  background-color: #22C55E;
}

.chat__skeleton {
  display: grid;
  gap: 0.3rem;
  flex: 1;
}

.chat__skeleton span {
  display: block;
  block-size: 0.45rem;
  border-radius: var(--r-pill);
  background-color: var(--c-ink-a10);
}

.chat__skeleton span:first-child { inline-size: 45%; background-color: var(--c-ink-a20); }
.chat__skeleton span:last-child  { inline-size: 28%; }

.chat__bar-icon {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  color: var(--c-slate);
}

/* Messages */
.msg {
  display: flex;
  align-items: flex-end;
  gap: var(--space-xs);
}

.msg--out {
  justify-content: flex-end;
}

.msg__avatar {
  flex-shrink: 0;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
}

.msg__bubble {
  position: relative;
  display: grid;
  gap: 0.4rem;
  min-inline-size: 9rem;
  max-inline-size: 78%;
  padding: 0.75rem 0.875rem;
  border-radius: 16px;
}

.msg--in .msg__bubble {
  border-end-start-radius: 4px;
  background-color: var(--c-cloud);
}

.msg--out .msg__bubble {
  border-end-end-radius: 4px;
  background-color: var(--c-navy);
}

/* Bubble content: symbol row + skeleton lines (no invented copy) */
.msg__symbols {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.msg__symbols svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
}

.msg--in .msg__symbols { color: var(--c-deep-teal); }
.msg--out .msg__symbols { color: var(--c-teal); }

.msg__q {
  display: grid;
  place-items: center;
  inline-size: 1.5rem;
  block-size: 1.5rem;
  border-radius: 50%;
  background-color: var(--c-deep-teal);
  color: var(--c-white);
  font-family: var(--ff-display);
  font-size: 0.875rem;
  font-weight: 700;
}

.msg__line {
  display: block;
  block-size: 0.45rem;
  border-radius: var(--r-pill);
}

.msg--in .msg__line  { background-color: rgba(11, 31, 68, 0.14); }
.msg--out .msg__line { background-color: rgba(255, 255, 255, 0.22); }
.msg__line--short { inline-size: 60%; }

/* Fatorly mark tucked BEHIND the advisor's answer */
.msg__partner {
  position: absolute;
  inset-block-start: -0.9rem;
  inset-inline-start: -0.9rem;
  z-index: -1;
  display: grid;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: 10px;
  background-color: var(--c-white);
  box-shadow: 0 0 0 3px rgba(0, 169, 182, 0.35), var(--shadow-md);
}

.msg__partner img {
  inline-size: 70%;
}

/* Read receipt */
.msg__meta {
  display: flex;
  justify-content: flex-end;
  color: var(--c-teal);
}

.msg__meta svg {
  inline-size: 1rem;
  block-size: 1rem;
}

/* Typing indicator (advisor side) */
.typing {
  display: none;
  align-items: center;
  justify-content: flex-end;
}

.typing__dots {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.625rem 0.75rem;
  border-radius: 14px;
  border-end-end-radius: 4px;
  background-color: rgba(2, 17, 58, 0.08);
}

.typing__dots span {
  inline-size: 0.4rem;
  block-size: 0.4rem;
  border-radius: 50%;
  background-color: var(--c-slate);
  animation: typing-bounce 1.1s var(--ease-in-out) infinite;
}

.typing__dots span:nth-child(2) { animation-delay: 0.15s; }
.typing__dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { translate: 0 0; opacity: 0.5; }
  30%           { translate: 0 -4px; opacity: 1; }
}

/* Crossed-out "somewhere else" exit */
.ask__exit {
  position: absolute;
  z-index: 3;
  inset-block-start: 1.25rem;
  inset-inline-start: 1.25rem;
  display: grid;
  place-items: center;
  inline-size: 3.25rem;
  block-size: 3.25rem;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.8);
  background-color: rgba(2, 17, 58, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--c-white);
}

@media (min-width: 48rem) {
  .ask__exit {
    inset-inline-start: calc(12% + 1.25rem);
  }
}

.ask__exit svg {
  inline-size: 1.375rem;
  block-size: 1.375rem;
}

[dir="rtl"] .ask__exit svg {
  scale: -1 1;
}

.ask__exit-x {
  position: absolute;
  inset-block-end: -0.25rem;
  inset-inline-end: -0.25rem;
  display: grid;
  place-items: center;
  inline-size: 1.4rem;
  block-size: 1.4rem;
  border-radius: 50%;
  border: 2px solid var(--c-white);
  background-color: #E5484D;
}

.ask__exit-x svg {
  inline-size: 0.75rem;
  block-size: 0.75rem;
}

/* Desktop leaves room below the floating chat */
@media (min-width: 48rem) {
  .ask__scene {
    padding-block-end: 2.5rem;
  }
}
