/* Eucard Tag Agent — fullpage conversational (sem iframe, sem card, sem widget). */
:root {
  --lime: #bde63d;
  --blue: #008ecf;
  --green: #006644;
  --green-header: #008a5e;
  --green-text: #004c33;
  --ink: #142a20;
  --muted: #4a6b5a;
  --paper: #f5f8f3;
  --bubble: #fff;
  --snap: cubic-bezier(0.22, 1.18, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; min-height: 100%; }

body {
  font-family: Outfit, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* === header === */
.lb-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: linear-gradient(90deg, var(--green-header), #007a4f);
  color: #fff;
}

.lb-head__logo { height: 24px; width: auto; margin-right: 6px; }

.lb-head__agent { position: relative; width: 42px; height: 42px; flex: 0 0 42px; }

.lb-head__photo {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; display: block;
  border: 2px solid rgba(189,230,61,0.8);
}

.lb-head__pulse {
  position: absolute; right: 0; bottom: 0;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--lime); border: 2px solid var(--green-header);
  animation: ping 1.6s infinite;
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(189,230,61,0.7); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.lb-head__who strong { display: block; font-size: 0.95rem; }
.lb-head__who p { font-size: 0.76rem; opacity: 0.85; }

.track { margin-left: auto; width: 80px; height: 4px; border-radius: 99px; background: rgba(255,255,255,0.2); overflow: hidden; }
.track i { display: block; height: 100%; width: 8%; background: var(--lime); border-radius: 99px; transition: width 0.4s var(--snap); }

/* === chat log — TRUE fullpage, sem max-width restritivo === */
.lb-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* === turns (avatar + bubble) === */
.turn {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: min(580px, 88%);
  animation: rise 0.32s var(--snap) both;
}

.turn--bot { align-self: flex-start; }
.turn--user { align-self: flex-end; flex-direction: row-reverse; }

.turn--cont .avatar { visibility: hidden; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; flex: 0 0 34px;
  background: #d5e4d4;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.msg {
  padding: 10px 14px;
  font-size: 0.96rem;
  line-height: 1.48;
  white-space: pre-wrap;
}

.msg--bot {
  background: var(--bubble);
  color: var(--ink);
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 1px 3px rgba(0,50,30,0.06);
}

.msg--user {
  background: var(--green);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
}

.msg strong { font-weight: 700; }
.msg em { font-style: italic; color: var(--muted); }

/* === typing indicator === */
.typing {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bubble);
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 1px 3px rgba(0,50,30,0.06);
}

.typing__label { font-size: 0.78rem; font-weight: 500; color: var(--muted); }
.typing__dots { display: flex; gap: 4px; }

.typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green-header);
  animation: dots 1s infinite;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes dots {
  0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* === structured blocks (no fio, sem card externo) === */
.block {
  max-width: min(580px, 92%);
  margin-left: 44px;
  animation: rise 0.32s var(--snap) both;
}

.block--choices {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.chip {
  border: 1px solid rgba(0,102,68,0.14);
  cursor: pointer; font: inherit; font-weight: 600; font-size: 0.88rem;
  padding: 10px 16px; border-radius: 99px;
  background: #fff; color: var(--green-text);
  animation: rise 0.28s var(--snap) both;
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
.chip:nth-child(1) { animation-delay: 0.05s; }
.chip:nth-child(2) { animation-delay: 0.12s; }
.chip:nth-child(3) { animation-delay: 0.19s; }
.chip:nth-child(4) { animation-delay: 0.26s; }
.chip:hover { background: var(--lime); border-color: transparent; transform: translateY(-1px); }
.chip:disabled { opacity: 0.4; cursor: default; transform: none; }

.block--plans { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .block--plans { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }

.plan {
  text-align: left; border: 1px solid rgba(0,102,68,0.12);
  background: #fff; border-radius: 14px; padding: 14px;
  cursor: pointer; font: inherit; color: inherit;
  display: flex; flex-direction: column; gap: 5px;
  animation: rise 0.36s var(--snap) both;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.plan:nth-child(1) { animation-delay: 0.06s; }
.plan:nth-child(2) { animation-delay: 0.16s; }
.plan:nth-child(3) { animation-delay: 0.26s; }
.plan:hover { transform: translateY(-2px); border-color: var(--green-header); box-shadow: 0 4px 12px rgba(0,50,30,0.08); }
.plan.is-on { border-color: var(--green-header); box-shadow: inset 0 0 0 1px var(--green-header); }

.plan__badge {
  align-self: flex-start; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--green-text); background: var(--lime);
  padding: 3px 7px; border-radius: 5px;
}
.plan strong { font-family: "Bricolage Grotesque", Outfit, sans-serif; font-size: 1.08rem; letter-spacing: -0.02em; }
.plan__price { font-weight: 700; color: var(--green-header); font-size: 0.92rem; }
.plan p { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.plan ul { list-style: none; font-size: 0.76rem; color: var(--green-text); display: grid; gap: 2px; margin-top: 3px; }

/* === Checkout Modal de Conversão === */
.ck-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(10, 30, 20, 0.65);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.3s ease-out;
}
.ck-overlay[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.ck-modal {
  position: relative;
  width: 100%; max-width: 440px; max-height: 94vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,40,20,0.25), 0 4px 16px rgba(0,40,20,0.1);
  animation: slideUp 0.4s var(--snap);
}

@keyframes slideUp { from { opacity: 0; transform: translateY(40px) scale(0.96); } to { opacity: 1; transform: none; } }

.ck-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,0.04); color: var(--muted);
  font-size: 1.4rem; cursor: pointer; display: grid; place-items: center;
  transition: background 0.15s;
}
.ck-close:hover { background: rgba(0,0,0,0.08); }

.ck-hero {
  text-align: center; padding: 32px 24px 20px;
  background: linear-gradient(180deg, rgba(189,230,61,0.08) 0%, transparent 100%);
  border-radius: 24px 24px 0 0;
}
.ck-hero__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--green-header), #00a86b);
  color: #fff; margin-bottom: 12px;
}
.ck-hero__title {
  font-family: "Bricolage Grotesque", Outfit, sans-serif;
  font-size: 1.4rem; letter-spacing: -0.02em; color: var(--ink);
}
.ck-hero__sub { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

.ck-summary {
  margin: 0 24px; padding: 16px; background: var(--paper);
  border-radius: 14px; display: grid; gap: 8px;
}
.ck-summary__row { display: flex; justify-content: space-between; align-items: center; font-size: 0.88rem; }
.ck-summary__label { color: var(--muted); }
.ck-summary__value { font-weight: 600; color: var(--ink); }
.ck-summary__divider { height: 1px; background: rgba(0,70,45,0.08); margin: 4px 0; }
.ck-summary__row--total .ck-summary__value { font-size: 1.2rem; color: var(--green-header); }

.ck-form { padding: 20px 24px 24px; }
.ck-form__hint { font-size: 0.76rem; color: var(--muted); margin-bottom: 16px; text-align: center; }

.ck-fields { display: grid; gap: 14px; }
.ck-field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--green-text); margin-bottom: 6px; }
.ck-field input {
  display: block; width: 100%;
  border: 1.5px solid rgba(0,70,45,0.12); border-radius: 12px;
  padding: 13px 14px; font: inherit; font-size: 0.95rem;
  background: #fafcfa; color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ck-field input:focus { outline: none; border-color: var(--green-header); box-shadow: 0 0 0 3px rgba(0,138,94,0.1); }
.ck-field__card { position: relative; }
.ck-field__brand { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.ck-field__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ck-demo {
  display: block; width: 100%; border: 0; background: transparent;
  color: var(--green-header); font: inherit; font-size: 0.82rem; font-weight: 600;
  padding: 10px; margin-top: 8px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.ck-demo:hover { color: var(--green-text); }

.ck-pay {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  padding: 16px 24px; border-radius: 14px; margin-top: 12px;
  background: linear-gradient(135deg, var(--green-header), #00a86b);
  color: #fff; box-shadow: 0 4px 16px rgba(0,138,94,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ck-pay:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0,138,94,0.35); }
.ck-pay:active { transform: translateY(0); }
.ck-pay:disabled { opacity: 0.6; cursor: wait; transform: none; }

.ck-trust {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 14px; font-size: 0.72rem; color: var(--muted);
}
.ck-trust svg { color: var(--green-header); }

/* Progress dentro da modal */
.ck-progress { padding: 40px 24px; text-align: center; }
.ck-progress__spinner {
  width: 48px; height: 48px; margin: 0 auto 16px;
  border: 3px solid rgba(0,138,94,0.15);
  border-top-color: var(--green-header);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ck-progress__label { font-weight: 700; font-size: 1rem; color: var(--ink); margin-bottom: 16px; }
.ck-progress__bar { height: 6px; border-radius: 99px; background: rgba(0,102,68,0.08); overflow: hidden; margin-bottom: 20px; }
.ck-progress__bar i { display: block; height: 100%; width: 8%; background: linear-gradient(90deg, var(--green-header), var(--lime)); border-radius: 99px; transition: width 0.5s var(--snap); }
.ck-progress__steps { list-style: none; display: grid; gap: 8px; font-size: 0.88rem; color: var(--muted); text-align: left; max-width: 240px; margin: 0 auto; }
.ck-progress__steps li { padding-left: 24px; position: relative; }
.ck-progress__steps li::before { content: "○"; position: absolute; left: 0; color: var(--muted); }
.ck-progress__steps li.is-on { color: var(--green-text); font-weight: 700; }
.ck-progress__steps li.is-on::before { content: "●"; color: var(--green-header); }
.ck-progress__steps li.is-done { color: var(--green-header); }
.ck-progress__steps li.is-done::before { content: "✓"; color: var(--green-header); }

/* OK dentro da modal */
.ck-ok { padding: 48px 24px 32px; text-align: center; }
.ck-ok__check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #1f9d58, #00c770);
  animation: checkPop 0.5s var(--snap);
  box-shadow: 0 8px 24px rgba(31,157,88,0.3);
}
@keyframes checkPop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.ck-ok__title {
  font-family: "Bricolage Grotesque", Outfit, sans-serif;
  font-size: 1.5rem; letter-spacing: -0.02em;
  color: var(--green-text); margin: 16px 0 6px;
}
.ck-ok__msg { font-size: 0.92rem; color: var(--ink); font-weight: 600; }
.ck-ok__next { font-size: 0.82rem; color: var(--muted); margin-top: 8px; }

/* === composer === */
.lb-dock {
  flex: 0 0 auto;
  padding: 8px 20px 14px;
  background: var(--paper);
}

.lb-form {
  display: flex; gap: 8px;
  background: #fff; border-radius: 24px;
  padding: 6px 6px 6px 16px;
  border: 1px solid rgba(0,102,68,0.08);
  box-shadow: 0 1px 4px rgba(0,50,30,0.04);
}

.lb-form.is-dialog { display: none; }

.lb-form input { flex: 1; border: 0; background: transparent; padding: 10px 4px; font: inherit; color: var(--ink); }
.lb-form input:focus { outline: none; }

.lb-form button {
  border: 0; cursor: pointer; font: inherit; font-weight: 700;
  padding: 10px 18px; border-radius: 20px;
  background: var(--lime); color: var(--green-text);
}
.lb-form button:disabled { opacity: 0.4; cursor: wait; }

/* === responsive === */
@media (max-width: 520px) {
  .lb-log { padding: 14px 12px 10px; }
  .turn { max-width: 95%; }
  .block { max-width: 95%; margin-left: 0; }
  .avatar { width: 28px; height: 28px; flex: 0 0 28px; }
  .lb-head { padding: 8px 14px; }
  .lb-head__photo { width: 36px; height: 36px; }
  .lb-head__agent { width: 36px; height: 36px; flex: 0 0 36px; }
  .ck-overlay { padding: 0; align-items: flex-end; }
  .ck-modal { max-height: 96vh; border-radius: 24px 24px 0 0; }
  .ck-hero { padding: 24px 20px 16px; }
  .ck-hero__title { font-size: 1.2rem; }
  .ck-summary { margin: 0 16px; }
  .ck-form { padding: 16px 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .turn, .block, .chip, .plan, .pay__check, .lb-head__pulse, .typing i {
    animation: none !important;
  }
}
