/* assistant.css — visual layer for the inline scenario assistant (assistant.js).
   Colors, radii and typography come from the landing design tokens (:root vars
   defined by the page). Bubble/pill layout adapted from the inline-chat prototype. */

/* Container reserves ~first-node height so the animated playback causes no CLS.
   (min-height tuned to the greeting node: 2 bubbles + 3 full-width pills at 360px.) */
[data-assistant] {
  display: block;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 40px;
  min-height: 627px; /* measured: greeting (2 bubbles + 4 pills + restart + branding) at 360-375px viewport, 2026-07-18 copy */
  box-sizing: border-box;
}
@media (min-width: 760px) {
  [data-assistant] { min-height: 468px; } /* greeting node is shorter with row pills (2026-07-18 copy) */
}

/* short attention pulse when an external CTA scrolls the visitor to the widget */
[data-assistant] { transition: box-shadow 0.4s; }
[data-assistant].rw-as-highlight { box-shadow: 0 0 0 3px rgba(13, 27, 110, 0.22); border-radius: 14px; }

.rw-as-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rw-as-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border);
}
.rw-as-title {
  font-family: 'Raleway', sans-serif; font-weight: 700;
  font-size: 15px; letter-spacing: 0.05em; color: var(--text-dark);
}

.rw-as-thread { display: flex; flex-direction: column; gap: 10px; }
.rw-as-msg { display: flex; }
.rw-as-bubble {
  max-width: 92%;
  padding: 12px 14px; border-radius: 16px;
  font-family: 'Open Sans', sans-serif; font-size: 15px; line-height: 1.55;
  color: var(--text-body);
}
.rw-as-bot .rw-as-bubble { background: var(--bg-light); border-top-left-radius: 6px; }
.rw-as-user { justify-content: flex-end; }
.rw-as-user .rw-as-bubble { background: var(--navy); color: var(--white); border-top-right-radius: 6px; }

/* typing dots */
.rw-as-typing {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--white); border: 1px solid var(--border);
}
.rw-as-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--navy);
  opacity: .2; animation: rwAsBlink 1.2s infinite;
}
.rw-as-dot:nth-child(2) { animation-delay: .2s; }
.rw-as-dot:nth-child(3) { animation-delay: .4s; }
@keyframes rwAsBlink {
  0%, 100% { opacity: .2; transform: translateY(0); }
  50%      { opacity: .9; transform: translateY(-2px); }
}

/* option pills: full-width column on mobile (44px+ tap targets), wrap row on desktop */
.rw-as-pills { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 2px; align-items: flex-end; }
.rw-as-pill {
  width: 100%;
  min-height: 44px;
  background: var(--navy); color: var(--white);
  border: none; cursor: pointer;
  padding: 13px 18px; border-radius: 999px;
  text-align: left; font-family: 'Open Sans', sans-serif; font-size: 15px;
  transition: background 0.2s;
}
.rw-as-pill:hover { background: var(--navy-light); }
.rw-as-pill:active { transform: translateY(1px); }
@media (min-width: 760px) {
  .rw-as-pills { flex-direction: row; flex-wrap: wrap; }
  .rw-as-pill { width: auto; }
}

/* WhatsApp CTA — always the last option, rendered as its own full-width green
   button rather than a third item in the pill list (assistant v3, 2026-09-06):
   the last slot in a list gets fewer clicks by default, so a distinct element
   (divider + solid fill) compensates instead of blending in. */
.rw-as-wa-cta { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.rw-as-wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 44px; box-sizing: border-box;
  background: #25D366; color: #fff; border: none; cursor: pointer;
  padding: 13px 18px; border-radius: 999px;
  font-family: 'Open Sans', sans-serif; font-size: 15px; font-weight: 600;
  transition: background 0.2s;
}
.rw-as-wa-btn:hover { background: #1ebe5d; }
.rw-as-wa-btn:active { transform: translateY(1px); }
.rw-as-wa-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.rw-as-wa-caption {
  margin-top: 6px; text-align: center;
  font-family: 'Open Sans', sans-serif; font-size: 11px; color: var(--text-muted);
}
.rw-as-wa-caption a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.rw-as-wa-caption a:hover { color: var(--text-body); }

/* Booking node: "(Riga time)" note + compact time-slot grid (slots stay
   compact even on mobile — 16 full-width buttons would be a wall) */
.rw-as-booking-note { font-family: 'Open Sans', sans-serif; font-size: 11px; color: var(--text-muted); text-align: right; margin: 6px 0 0; }
.rw-as-pills.rw-as-slots { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
.rw-as-pill.rw-as-slot { width: auto; min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; }

/* leadform node: inline email-only capture (consent above, email+Send row below —
   mirrors .rw-as-pills' right-aligned, mobile-first-column convention) */
.rw-as-leadform { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 2px; }
.rw-as-lf-consent {
  display: flex; align-items: flex-start; gap: 8px;
  font-family: 'Open Sans', sans-serif; font-size: 12px; line-height: 1.4;
  color: var(--text-muted); cursor: pointer;
}
.rw-as-lf-consent input[type="checkbox"] {
  width: 16px; height: 16px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--navy);
}
.rw-as-lf-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.rw-as-lf-row { display: flex; flex-direction: column; gap: 10px; }
.rw-as-lf-field { display: flex; flex-direction: column; flex: 1 1 auto; }
.rw-as-lf-email {
  min-height: 44px; width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--white); padding: 12px 14px;
  font-family: 'Open Sans', sans-serif; font-size: 16px; /* 16px avoids iOS auto-zoom */
  color: var(--text-body); outline: none;
  transition: border-color 0.2s;
}
.rw-as-lf-email:focus { border-color: var(--navy); }
.rw-as-lf-email.rw-as-lf-invalid { border-color: #c0392b; }
.rw-as-lf-error {
  min-height: 15px; margin-top: 4px;
  font-family: 'Open Sans', sans-serif; font-size: 12px; color: #c0392b;
}
.rw-as-lf-send {
  min-height: 44px;
  background: var(--navy); color: var(--white);
  border: none; cursor: pointer;
  padding: 13px 18px; border-radius: 999px;
  font-family: 'Open Sans', sans-serif; font-size: 15px; font-weight: 600;
  transition: background 0.2s, opacity 0.2s;
}
.rw-as-lf-send:hover:not(:disabled) { background: var(--navy-light); }
.rw-as-lf-send:disabled { opacity: 0.45; cursor: not-allowed; }
@media (min-width: 760px) {
  .rw-as-lf-row { flex-direction: row; align-items: flex-start; }
  .rw-as-lf-send { flex: 0 0 auto; }
}

/* Branding footer — permanent muted line at the bottom of the widget (in flow,
   after the thread; grows down with the dialog, never an overlay) */
.rw-as-branding {
  margin-top: 14px;
  text-align: center;
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
}
.rw-as-branding a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.rw-as-branding a:hover { color: var(--text-body); }

/* "Start over" — small muted control under the active node's pills */
.rw-as-restart-row { display: flex; justify-content: flex-end; margin: 2px 0 0; }
.rw-as-restart {
  background: none; border: none; cursor: pointer;
  padding: 8px 6px;
  font-family: 'Open Sans', sans-serif; font-size: 12px;
  color: var(--text-muted);
  text-decoration: underline; text-underline-offset: 2px;
}
.rw-as-restart:hover { color: var(--text-body); }
