/* ==========================================================================
   EFEKTO - guide.css
   Asystent: postac z trzech belek sygnetu. Pozycje w oknie liczy JS
   (transform translate na .guide), tu tylko wyglad i to, po ktorej
   stronie postaci otwiera sie dymek (data-strona: prawo|lewo|dol|dok|gora|gora-prawo).
   ========================================================================== */

.guide {
  position: fixed;
  top: 0; left: 0;
  z-index: var(--z-guide);
  width: 3.5rem; height: 3.5rem;       /* rozmiar postaci - dymek wystaje poza */
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  will-change: transform;
}
.guide[data-ready] { opacity: 1; }
.no-js .guide { display: none; }
html.menu-open .guide { opacity: 0; pointer-events: none; }

/* --- Postac --- */
.guide__face {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.5rem; height: 3.5rem;
  padding: 0;
  background: var(--surface-1);
  border: 1.5px solid var(--brand-blue);
  border-radius: 33%;
  box-shadow: 0 14px 30px -12px rgba(2, 8, 20, 0.55), 0 0 0 5px var(--accent-wash);
  cursor: pointer;
  transform-origin: 50% 100%;           /* przysiad i ladowanie od "stop" */
}
.guide__face:hover { box-shadow: 0 14px 30px -12px rgba(2, 8, 20, 0.55), 0 0 0 7px var(--accent-wash); }
.guide__face svg { width: 2.3rem; height: 2.3rem; overflow: visible; }
.guide__bar { fill: var(--brand-blue); }
.guide__eye { fill: var(--surface-1); }
.guide__smile { stroke: var(--surface-1); }

/* Mruganie - zyje, nawet kiedy siedzi w rogu */
.guide__eye { transform-box: fill-box; transform-origin: center; animation: mrug 5.5s infinite; }
@keyframes mrug { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }

/* --- Dymek rozmowy --- */
.guide__bubble {
  position: absolute;
  width: min(21rem, calc(100vw - 2rem));
  padding: var(--space-m);
  padding-right: 2.4rem;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  box-shadow: 0 30px 60px -24px rgba(2, 8, 20, 0.6);
}
.guide__bubble[hidden] { display: none; }

.guide[data-strona="prawo"] .guide__bubble { left: calc(100% + 0.8rem); top: 0; border-top-left-radius: 0.4rem; }
.guide[data-strona="lewo"]  .guide__bubble { right: calc(100% + 0.8rem); top: 0; border-top-right-radius: 0.4rem; }
.guide[data-strona="dol"]   .guide__bubble { top: calc(100% + 0.7rem); left: 50%; translate: -50% 0; }
.guide[data-strona="dok"]   .guide__bubble { right: 0; bottom: calc(100% + 0.8rem); border-bottom-right-radius: 0.4rem; }
.guide[data-strona="gora"]  .guide__bubble { right: 0; bottom: calc(100% + 0.7rem); border-bottom-right-radius: 0.4rem; }
.guide[data-strona="gora-prawo"] .guide__bubble { left: 0; bottom: calc(100% + 0.7rem); border-bottom-left-radius: 0.4rem; }

/* Na telefonie dymek zawsze pod postacia, na cala szerokosc ekranu.
   --gx to aktualne x postaci (ustawia JS), wiec dymek nie ucieka za krawedz. */
@media (max-width: 40rem) {
  .guide[data-strona="dol"] .guide__bubble,
  .guide[data-strona="prawo"] .guide__bubble,
  .guide[data-strona="lewo"] .guide__bubble {
    top: calc(100% + 0.7rem);
    right: auto;
    left: calc(1rem - var(--gx, 0px));
    translate: none;
    width: calc(100vw - 2rem);
  }
  .guide[data-strona="gora"] .guide__bubble,
  .guide[data-strona="gora-prawo"] .guide__bubble {
    right: auto;
    left: calc(1rem - var(--gx, 0px));
    width: calc(100vw - 2rem);
  }
}

.guide__text { margin: 0 0 var(--space-s); color: var(--text); line-height: 1.45; }

.guide__close {
  position: absolute;
  top: 0.55rem; right: 0.55rem;
  display: grid; place-items: center;
  width: 1.8rem; height: 1.8rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.guide__close:hover { background: var(--surface-2); color: var(--text); }

.guide__actions { display: grid; gap: 0.4rem; }
.guide__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  color: var(--text);
  font-size: var(--step--1);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.guide__btn:hover { border-color: var(--brand-blue); background: var(--accent-wash); color: var(--text); }
.guide__btn--main { background: var(--brand-blue); border-color: var(--brand-blue); color: var(--brand-black); font-weight: 500; }
.guide__btn--main:hover { background: var(--brand-blue); color: var(--brand-black); filter: brightness(1.08); }
.guide__btn--quiet { border-color: transparent; color: var(--text-muted); text-decoration: underline; text-underline-offset: 0.2em; }
.guide__btn--icon svg { width: 1.25rem; height: 1.25rem; flex: none; }

/* Dwa duze przyciski obok siebie: Formularz / WhatsApp */
.guide__actions:has(.guide__btn--icon) { grid-template-columns: 1fr 1fr; }
.guide__actions:has(.guide__btn--icon) .guide__btn--quiet { grid-column: 1 / -1; }
.guide__btn--icon { flex-direction: column; justify-content: center; padding: 0.85rem 0.6rem; text-align: center; }
.guide__btn--icon svg { width: 1.6rem; height: 1.6rem; }

/* --- Przypomnienie, kiedy siedzi w rogu --- */
.guide__nudge {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.7rem);
  width: max-content;
  max-width: min(17rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.65rem 0.9rem;
  background: var(--surface-1);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-m) var(--radius-m) 0.4rem var(--radius-m);
  box-shadow: 0 20px 40px -20px rgba(2, 8, 20, 0.55);
  color: var(--text);
  font-size: var(--step--1);
  line-height: 1.4;
  cursor: pointer;
}
.guide__nudge[hidden] { display: none; }

/* --- Pole, przy ktorym stoi asystent w formularzu --- */
.guide-cel {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
  box-shadow: 0 0 0 8px var(--accent-wash);
  transition: box-shadow var(--dur-base) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .guide__eye { animation: none; }
}

/* Imie w dymku - Efi ma byc kims, nie widzetem */
.guide__name {
  margin: 0 0 0.25rem;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent);
}

/* Pasek odliczania: jesli nikt nic nie kliknie, Efi sam idzie dalej */
.guide__bubble.is-odliczanie::after {
  content: "";
  position: absolute;
  left: 1rem; right: 1rem; bottom: 0.45rem;
  height: 3px;
  border-radius: 3px;
  background: var(--brand-blue);
  transform-origin: left center;
  animation: guideOdlicz var(--odliczanie, 10s) linear forwards;
}
.guide__bubble.is-odliczanie { padding-bottom: calc(var(--space-m) + 0.4rem); }
@keyframes guideOdlicz { from { transform: scaleX(1); } to { transform: scaleX(0); } }

