/* ============================================================
   assistente.chat.css – Central Chat Area + Input (V4 Final)
   Clean, modern, grows to 6 lines, premium feel
   ============================================================ */

/* Messages container */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  background: #ffffff;
  scroll-behavior: smooth;
}

/* Message row */
.message-row {
  width: 100%;
  display: flex;
  animation: fadeIn 0.28s ease-out forwards;
}

.message-row-user { justify-content: flex-end; }
.message-row-assistant { justify-content: flex-start; }

/* Bubbles */
.message-bubble {
  max-width: 78%;
  padding: 0.95rem 1.3rem;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.48;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}

.message-bubble-user {
  background: #eafaf1;
  color: #064e3b;
  border-bottom-right-radius: 6px;
}

.message-bubble-assistant {
  background: #f8f9fa;
  color: #1f2937;
  border-bottom-left-radius: 6px;
}

/* Input area – the beautiful growing one */
.chat-input {
  padding: 1rem 1.2rem;
  background: #ffffff;
}

.chat-input-inner {
  display: flex;
  align-items: flex-end;
  gap: 0.9rem;
  background: #f9fafb;
  border-radius: 18px;
  padding: 0.85rem 1.1rem;
  border: 1.5px solid transparent;
  transition: all 0.22s ease;
}

.chat-input-inner:focus-within {
  border-color: #10b981;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.12);
}

#chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-size: 15px;
  line-height: 1.5;
  min-height: 24px;
  max-height: 148px;     /* ~6 lines */
  padding: 6px 0;
  font-family: inherit;
  color: #111827;
}

#chat-textarea::placeholder {
  color: #9ca3af;
}

.chat-send-button {
  width: 50px;
  height: 50px;
  background: #075e37;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
  white-space: nowrap;
}

.chat-send-button:hover:not(:disabled) {
  background: #059669;
  transform: scale(1.08);
}

.chat-send-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}


/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar – subtle */
.chat-messages::-webkit-scrollbar {
  width: 7px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
  border-radius: 4px;
}

/* =========================
   Personalization Modal (pz-*)
   ========================= */

.pz-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  overscroll-behavior: contain;
}

.pz-modal[aria-hidden="false"] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pz-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 0;
}

.pz-card {
  position: relative;
  z-index: 1;

  width: min(980px, 94vw);
  max-height: 92vh;
  margin: 0;

  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
  overflow: hidden;

  display: flex;
  flex-direction: column;

  font-family: inherit;
  color: rgba(0,0,0,0.86);
}



/* ---------- Header ---------- */

.pz-head {
  display: flex;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  align-items: flex-start;
}

.pz-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pz-subtitle {
  margin: 0.4rem 0 0;
  color: rgb(0,133,35);
  line-height: 1.4;
  font-size: 0.98rem;
}

.pz-meta{
  font-size: 0.86rem;
  color: rgba(0,0,0,0.48);
  line-height: 1.35;
}


.pz-close {
  margin-left: auto;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: rgba(0,0,0,0.55);
  padding: 0.2rem 0.4rem;
  border-radius: 10px;
}
.pz-close:hover { background: rgba(0,0,0,0.06); }

/* ---------- Progress ---------- */

.pz-progress {
  padding: 0.85rem 1.35rem 0.95rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.pz-progress-bar {
  height: 10px;
  background: rgba(0,0,0,0.10);
  border-radius: 999px;
  overflow: hidden;
}

.pz-progress-fill {
  height: 100%;
  background: #2a604f;
  width: 0%;
  transition: width 220ms ease;
}

.pz-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.55rem;
  font-size: 0.9rem;
  color: rgba(0,0,0,0.62);
}

/* ---------- Body ---------- */

.pz-body {
  display: grid;
  grid-template-columns: 170px 1fr;
  min-height: 0;
  flex: 1;
}

/* ---------- Steps ---------- */

.pz-steps {
  border-right: 1px solid rgba(0,0,0,0.08);
  padding: 0.65rem;
  background: #fbfbfb;
  overflow: auto;      /* so steps can scroll if needed */
  min-height: 0;       /* CRITICAL */
}

.pz-step {
  width: 100%;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.52rem;
  border: 1px solid rgba(0,0,0,0.10);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 0.42rem;
  text-align: left;
}

.pz-step.active{
  border-color: transparent;
  box-shadow: none;
  background: var(--pz-step-grad, var(--pz-dot-active, #2a604f));
  color: #fff;
}

.pz-step-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.18);
}

.pz-step.active .pz-step-dot{
  background: rgba(255,255,255,0.92);
}

.pz-step.is-complete .pz-step-dot{
  background: var(--pz-dot-active, #2a604f);
  opacity: 0.65;
}


.pz-step-text {
  font-weight: 700;
  font-size: 0.86rem;
  color: inherit;
}

/* ---------- Content ---------- */

.pz-content {
  padding: 1.35rem 1.45rem 1.3rem;
  overflow: auto;      /* scrolls inside modal */
  min-height: 0;       /* CRITICAL */
  -webkit-overflow-scrolling: touch;
}

.pz-kicker{
  display: none;
  margin: 0;
}

.pz-kicker-main{
  font-weight: 900;
  color: rgba(0,0,0,0.78);
}

.pz-kicker-sub{
  font-weight: 700;
  font-size: 0.86rem;
  color: rgba(0,0,0,0.55);
}

.pz-question {
  margin: 0 0 1.6rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pz-help{
  margin: 0 0 1.05rem;
  color: rgba(0,0,0,0.70);
  line-height: 1.45;
  font-size: 0.95rem;

  background: rgba(42,96,79,0.06);
  border: 1px solid rgba(42,96,79,0.10);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}

/* ---------- Options ---------- */

.pz-options{
  display: grid;
  gap: 0;                         /* options become one grouped block */
  margin-bottom: 0.75rem;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;               /* keeps the “single balloon” edges clean */
}

.pz-option{
  border: 0;
  border-radius: 0;
  padding: 0.75rem 0.7rem;
  background: transparent;             /* no row borders */
  cursor: pointer;
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.pz-option:hover,
.pz-option.is-selected{
  background: rgba(42,96,79,0.06);     /* hover + selected highlight */
}

.pz-option input {
  margin: 0;
  transform: scale(1.05);
  accent-color: #2a604f;
}

.pz-option-title {
  font-weight: 850;
  margin: 0;
  font-size: 0.95rem;
  color: rgba(0,0,0,0.78);
}

/* We no longer show per-option descriptions (single panel below handles it) */
.pz-option-desc {
  display: none;
}

/* ---------- Free text ---------- */

.pz-free {
  margin: 0.35rem 0 1.1rem;
}

.pz-label {
  display: block;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: rgba(0,0,0,0.78);
}

.pz-textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.14);
  padding: 0.8rem 0.9rem;
  font: inherit;
  resize: vertical;
  min-height: 90px;
}

/* ---------- Actions ---------- */

.pz-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin-top: 0.7rem;
}

.pz-actions-right {
  display: flex;
  gap: 0.6rem;
}

.pz-btn {
  border-radius: 12px;
  padding: 0.64rem 0.9rem;
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.pz-btn.ghost:hover { background: rgba(0,0,0,0.05); }

.pz-btn.primary {
  background: #2a604f;
  border-color: #2a604f;
  color: #fff;
}
.pz-btn.primary:hover { filter: brightness(0.95); }

.pz-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pz-footnote {
  margin: 0.85rem 0 0;
  color: rgba(0,0,0,0.52);
  font-size: 0.9rem;
}

/* ---------- Mobile ---------- */

@media (max-width: 780px) {
  .pz-card {
    width: 100vw;
    height: 100vh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .pz-body {
    grid-template-columns: 1fr;
  }

  .pz-steps {
    display: none;
  }

  .pz-content {
    padding: 1.1rem 1rem 1.05rem;
  }

  .pz-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pz-actions-right {
    width: 100%;
    justify-content: space-between;
  }

  .pz-btn {
    width: 100%;
  }
}


.pz-explain{
  border: 1px solid rgba(214,167,86,0.42);
  background: rgba(234,207,160,0.28);
  border-left: 6px solid rgba(214,167,86,0.78);
  border-radius: 14px;
  padding: 1.5rem 1rem;
  margin: 2.85rem 0 1.05rem;
}

.pz-explain-title {
  font-weight: 900;
  margin: 0 0 0.25rem;
  color: rgba(0,0,0,0.78);
}

.pz-explain-text {
  margin: 0;
  color: rgba(0,0,0,0.74);
  line-height: 1.5;
  font-size: 0.96rem;
}


/* ---------- Assistant Face ---------- */

.pz-avatar{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(42,96,79,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(42,96,79,0.18);
  flex: 0 0 auto;
  margin-top: 2px;
}

.pz-avatar-svg{
  width: 30px;
  height: 30px;
  display: block;
}

/* =========================
   Personalization embedded inside My Account (compact)
   Scope: only when .pz-* is rendered under .account-panel
   ========================= */

.account-panel .pz-modal{
  position: static;
  inset: auto;
  z-index: auto;
}

.account-panel .pz-modal[aria-hidden="false"]{
  display: block;
}

.account-panel .pz-overlay{
  display: none;
}

.account-panel .pz-card{
  width: 100%;
  max-width: 100%;
  max-height: none;
  height: auto;
  margin: 0;
  box-sizing: border-box;

  border-radius: 14px;
  box-shadow: none;
  border: 1px solid rgba(0,0,0,0.10);
}

.account-panel .pz-close{
  display: none;
}

.account-panel .pz-head{
  padding: 0.9rem 1rem;
  gap: 0.75rem;
}

.account-panel .pz-title{
  font-size: 1.1rem;
}

.account-panel .pz-subtitle{
  font-size: 0.92rem;
}

.account-panel .pz-progress{
  padding: 0.65rem 1rem 0.75rem;
}

.account-panel .pz-body{
  grid-template-columns: 1fr;
}

.account-panel .pz-steps{
  display: none;
}

.account-panel .pz-content{
  padding: 0.95rem 1rem 1rem;
  overflow: visible;
}

.account-panel .pz-question{
  font-size: 1.15rem;
  margin: 0 0 0.9rem;
}

.account-panel .pz-help{
  font-size: 0.9rem;
  padding: 0.65rem 0.75rem;
  margin: 0 0 0.8rem;
}

.account-panel .pz-option{
  padding: 0.62rem 0.65rem;
}

.account-panel .pz-actions{
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}


/* =========================================================
   Chat send button: prevent overflow + scale per language
   Relies on: <html lang="..."> being set by i18n (you already do this)
   ========================================================= */

.chat-send-button{
  padding: 0;
  line-height: 1;
  white-space: nowrap;
}

/* Default (English) stays at your existing 15px */
html[lang="fr"] .chat-send-button{ font-size: 12px; }
html[lang="de"] .chat-send-button{ font-size: 11px; }
html[lang="it"] .chat-send-button{ font-size: 12px; }
html[lang="es"] .chat-send-button{ font-size: 12px; }
html[lang="pt-BR"] .chat-send-button{ font-size: 11px; }
html[lang="pt-PT"] .chat-send-button{ font-size: 11px; }
