/* ========= base/reset ========= */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #3b1b2f; }

/* ========= background (mesmo do login) ========= */
.page{
  min-height:100%;
  overflow:auto;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath fill='%23ec489915' d='M30 54s-18-12.5-18-27c0-8.3 6.7-15 15-15 4.8 0 9.1 2.3 12 5.8 2.9-3.5 7.2-5.8 12-5.8 8.3 0 15 6.7 15 15 0 14.5-18 27-18 27h-18z'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #fce7f3 0%, #fff1f2 45%, #f3e8ff 100%);
}

/* ========= layout ========= */
.app{
  width:100%;
  min-height:100%;
  padding:24px 16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
}

.header{ width:100%; max-width:520px; margin-bottom:24px; text-align:center; }
.header-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.header-row-center{ justify-content:center; }
.btn-back{
  position:absolute;
  left:16px;
  top:18px;
  display:inline-flex;
  align-items:center;
  padding:10px 16px;
  border-radius:999px;
  border:1px solid #fbcfe8;
  background:rgba(255,255,255,.70);
  backdrop-filter:blur(8px);
  text-decoration:none;
  color:#7a2953;
  transition:background .2s ease, transform .2s ease;
}
.btn-back:hover{ background:rgba(255,255,255,.92); transform:translateY(-1px); }

.brand{ display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.brand-icon{ width:40px; height:40px; color:#ec4899; }
.brand-name{
  margin:0;
  font-weight:800;
  font-size:40px;
  background:linear-gradient(90deg,#ec4899 0%, #7c3aed 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.subtitle{ margin:8px 0 0; font-weight:600; color:#db2777; }

/* ========= card ========= */
.card{
  width:100%;
  max-width:520px;
  border-radius:24px;
  overflow:hidden;
  border:1px solid #fbcfe8;
  background:rgba(255,255,255,.80);
  backdrop-filter:blur(10px);
  box-shadow:0 18px 45px rgba(0,0,0,.12);
}
.card-top{
  padding:16px;
  display:flex;
  align-items:center;
  gap:16px;
  background:linear-gradient(90deg,#f472b6 0%, #a855f7 100%);
}
.avatar{
  width:64px;
  height:64px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 10px 18px rgba(0,0,0,.16);
  display:grid;
  place-items:center;
  font-size:34px;
}
.agent-title{ margin:0; color:#fff; font-weight:700; font-size:18px; }
.agent-status{ margin:4px 0 0; color:rgba(255,255,255,.85); font-size:13px; display:inline-flex; align-items:center; gap:8px; }
.status-dot{ width:8px; height:8px; border-radius:999px; background:#4ade80; }

/* ========= messages ========= */
.messages{
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:16px;
  max-height:384px;
  overflow-y:auto;
}
.msg-row{ display:flex; }
.msg-left{ justify-content:flex-start; }
.msg-right{ justify-content:flex-end; }

.bubble{
  max-width:420px;
  padding:12px;
  border-radius:18px;
  white-space:pre-line;
  position:relative;
}
.bubble-agent{ background:#fff; box-shadow:0 8px 18px rgba(0,0,0,.10); color:#3b1b2f; }
.bubble-user{ background:#ec4899; color:#fff; }
.bubble-agent::before{
  content:"";
  position:absolute;
  left:-8px;
  top:12px;
  border-width:8px;
  border-style:solid;
  border-color:transparent #fff transparent transparent;
}
.bubble-user::before{
  content:"";
  position:absolute;
  right:-8px;
  left:auto;
  top:12px;
  border-width:8px;
  border-style:solid;
  border-color:transparent transparent transparent #ec4899;
}

/* ========= input area ========= */
.input{
  padding:16px;
  background:#fdf2f8;
  border-top:1px solid #fbcfe8;
}
.form-row{ display:flex; gap:10px; align-items:stretch; }
.stack{ display:flex; flex-direction:column; gap:12px; }

.field{
  width:100%;
  padding:12px 16px;
  border-radius:14px;
  border:2px solid #fbcfe8;
  outline:none;
  background:#fff;
  font-size:14px;
  transition:border-color .2s ease, box-shadow .2s ease;
}
.field:focus{ border-color:#ec4899; box-shadow:0 0 0 4px rgba(236,72,153,.15); }
.field-sm{ width:120px; }
.textarea{ resize:none; min-height:92px; }

.btn{
  border:none;
  border-radius:14px;
  cursor:pointer;
  padding:12px 16px;
  font-weight:800;
  transition:transform .15s ease, filter .15s ease;
}
.btn:hover{ transform:translateY(-1px); filter:brightness(.98); }
.btn:active{ transform:translateY(0); }

.btn-grad{
  color:#fff;
  background:linear-gradient(90deg,#ec4899 0%, #a855f7 100%);
}
.btn-ghost{
  background:#fff;
  color:#db2777;
  border:2px solid #fbcfe8;
}
.btn-block{ display:block; text-align:center; text-decoration:none; }

.btn-send{
  padding:12px 18px;
  border:none;
  border-radius:14px;
  cursor:pointer;
  color:#fff;
  font-weight:900;
  background:linear-gradient(90deg,#ec4899 0%, #a855f7 100%);
  transition:transform .15s ease, filter .15s ease;
}
.btn-send:hover{ transform:translateY(-1px); filter:brightness(.98); }

/* ========= errors / hints ========= */
.error-message{
  margin:4px 0 0;
  font-size:13px;
  color:#ef4444;
  text-align:center;
}
.hint{
  margin:0;
  font-size:12px;
  color:#be185d;
  text-align:center;
}

/* ========= progress ========= */
.progress{ width:100%; max-width:520px; margin-top:16px; }
.progress-row{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; font-size:13px; color:#db2777; }
.progress-track{ width:100%; height:8px; border-radius:999px; background:#fbcfe8; overflow:hidden; }
.progress-bar{ height:8px; width:0%; border-radius:999px; background:linear-gradient(90deg,#ec4899 0%, #a855f7 100%); transition:width .5s ease; }

/* ========= wizard extras ========= */
.file{
  width:100%;
  border:2px dashed #fbcfe8;
  border-radius:16px;
  padding:12px;
  background:#fff;
  color:#be185d;
}

.panel{
  border:1px solid #fbcfe8;
  background:#fff;
  border-radius:16px;
  padding:12px;
}
.panel-title{
  margin:0 0 8px;
  color:#be185d;
  font-weight:800;
  font-size:13px;
}
.row{ display:flex; gap:10px; }

.grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.grid-2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.full{ grid-column: 1 / -1; }

.chip{ display:block; cursor:pointer; }
.chip-input{ position:absolute; opacity:0; pointer-events:none; }
.chip-ui{
  display:block;
  text-align:center;
  padding:10px 10px;
  font-size:13px;
  border-radius:12px;
  border:2px solid #fbcfe8;
  background:#fff;
  color:#7a2953;
  transition:all .15s ease;
}
.chip:hover .chip-ui{ border-color:#f9a8d4; }
.chip-input:checked + .chip-ui{
  background:#ec4899;
  border-color:#ec4899;
  color:#fff;
}

/* ========= animations ========= */
@keyframes fadeInUp{ from{opacity:0; transform:translateY(20px)} to{opacity:1; transform:translateY(0)} }
@keyframes bounce{ 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }
@keyframes pulse{ 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
@keyframes typing{ 0%,60%,100%{opacity:1} 30%{opacity:.3} }

.fade-in{ animation:fadeInUp .5s ease-out both; }
.bounce{ animation:bounce 2s ease-in-out infinite; }
.pulse-soft{ animation:pulse 2s ease-in-out infinite; }

.typing{ display:inline-flex; gap:6px; align-items:center; }
.typing-dot{
  width:8px; height:8px; border-radius:999px;
  background:#f472b6;
  animation:typing 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2){ animation-delay:.2s; }
.typing-dot:nth-child(3){ animation-delay:.4s; }

/* ========= responsive ========= */
@media (min-width: 768px){
  .brand-name{ font-size:44px; }
}


/* =========================
   Uploader de fotos em blocos (+) com preview
========================= */
.photo-uploader{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.photo-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}

@media (min-width: 520px){
  .photo-grid{ grid-template-columns:repeat(4, minmax(0, 1fr)); }
}

.photo-tile{
  width:100%;
  aspect-ratio: 1 / 1;
  border-radius:16px;
  border:2px dashed #fbcfe8;
  background:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
  overflow:hidden;
  position:relative;
  transition:transform .15s ease, border-color .15s ease;
}

.photo-tile:hover{
  transform:translateY(-1px);
  border-color:#f9a8d4;
}

.photo-plus{
  font-weight:900;
  font-size:34px;
  color:#db2777;
  line-height:1;
}

.photo-tile img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.photo-badge{
  position:absolute;
  left:8px;
  top:8px;
  font-size:12px;
  font-weight:900;
  color:#fff;
  background:linear-gradient(90deg,#ec4899 0%, #a855f7 100%);
  padding:6px 10px;
  border-radius:999px;
  box-shadow:0 10px 18px rgba(0,0,0,.12);
}

.photo-actions{
  display:flex;
  gap:10px;
}

.photo-actions .btn{ flex:1; }

.photo-counter{
  margin:0;
  text-align:center;
  font-size:12px;
  color:#be185d;
}

.photo-hidden-input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

/* ===== Fotos com "+" e preview ===== */
.photo-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
}

@media (max-width:420px){
  .photo-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

.photo-tile{
  position:relative;
  width:100%;
  aspect-ratio: 1 / 1;
  border-radius:16px;
  border:2px dashed #fbcfe8;
  background:#fff;
  overflow:hidden;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.photo-tile:hover{
  transform:translateY(-1px);
  border-color:#f9a8d4;
  box-shadow:0 10px 18px rgba(0,0,0,.08);
}

.photo-tile.is-filled{
  border-style:solid;
  border-color:#fbcfe8;
  background-size:cover;
  background-position:center;
}

.photo-plus{
  font-size:34px;
  font-weight:900;
  color:#db2777;
  line-height:1;
}

.photo-count{
  font-size:12px;
  color:#be185d;
  text-align:center;
}

.photo-remove{
  position:absolute;
  top:8px;
  right:8px;
  width:30px;
  height:30px;
  border-radius:999px;
  border:1px solid #fbcfe8;
  background:rgba(255,255,255,.92);
  cursor:pointer;
  display:none;
  align-items:center;
  justify-content:center;
  font-weight:900;
  color:#db2777;
}

.photo-tile.is-filled .photo-remove{
  display:flex;
}