/* =========================================================
   7DIASWEB AI ASSISTANT
========================================================= */

* { box-sizing: border-box; }

:root {
  --brand: #e30613;
  --brand-dark: #b8000f;
  --brand-soft: #fff1f2;
  --text: #172033;
  --text-secondary: #536176;
  --muted: #7c889a;
  --page-bg: #f4f7fb;
  --card-bg: #ffffff;
  --border: #e3e9f0;
  --border-strong: #d5dde7;
  --assistant-bg: #ffffff;
  --user-bg: #e30613;
  --recording: #111827;
}

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(227, 6, 19, 0.06), transparent 34%),
    linear-gradient(180deg, #fff 0%, var(--page-bg) 100%);
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 64px;
}

.intro {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #f5c9ce;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.intro h1 {
  margin: 14px 0 10px;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.1;
}

.intro-description {
  max-width: 650px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

.languages {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 13px 0 0;
  color: #59677b;
  font-size: 13px;
  font-weight: 700;
}

.languages span { color: #a3adba; }

.chat-card {
  width: min(760px, 100%);
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(213, 221, 231, 0.85);
  border-radius: 22px;
  background: var(--card-bg);
  box-shadow: 0 28px 75px rgba(25, 40, 70, 0.14);
}

.chat-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--brand), #c90010);
  color: #fff;
}

.chat-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.chat-brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-brand-text strong {
  font-size: 16px;
  line-height: 1.2;
}

.online-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  font-weight: 600;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74,222,128,.15);
}

.ai-label {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.94);
  font-size: 11px;
  font-weight: 800;
}

.messages {
  height: 470px;
  overflow-y: auto;
  padding: 20px;
  background: linear-gradient(180deg, #f9fafc 0%, #f5f7fa 100%);
  scroll-behavior: smooth;
}

.message {
  display: flex;
  margin-bottom: 14px;
}

.message:last-child { margin-bottom: 0; }
.message.user { justify-content: flex-end; }
.message.assistant { justify-content: flex-start; }

.bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.assistant .bubble {
  border: 1px solid var(--border);
  border-top-left-radius: 6px;
  background: var(--assistant-bg);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(30,50,80,.045);
}

.message.user .bubble {
  border-top-right-radius: 6px;
  background: var(--user-bg);
  color: #fff;
  box-shadow: 0 4px 14px rgba(227,6,19,.16);
}

.welcome-message,
.welcome-bubble {
  max-width: 470px;
  padding: 15px !important;
  white-space: normal !important;
}

.welcome-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 11px;
  background: var(--brand-soft);
  font-size: 19px;
}

.welcome-heading,
.welcome-title {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.welcome-copy,
.welcome-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.welcome-languages {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.listen-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid #f1cbd0;
  border-radius: 10px;
  background: #fff4f5;
  color: var(--brand-dark);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}

.listen-button:hover {
  border-color: #eeb5bd;
  background: #ffe8eb;
  transform: translateY(-1px);
}

.listen-button:disabled {
  opacity: .6;
  cursor: wait;
}

.audio-button-icon {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.98);
}

.chat-input textarea {
  flex: 1;
  min-width: 0;
  height: 46px;
  min-height: 46px;
  max-height: 110px;
  padding: 12px 13px;
  resize: none;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
}

.chat-input textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(227,6,19,.08);
}

.mic-button {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f0cfd4;
  border-radius: 14px;
  background: #fff4f5;
  color: #c7172b;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.mic-button:hover {
  background: #ffe8eb;
  transform: translateY(-1px);
}

.mic-button.recording {
  border-color: var(--recording);
  border-radius: 999px;
  background: var(--recording);
  color: #fff;
  box-shadow: 0 10px 24px rgba(17,24,39,.22);
}

.mic-svg {
  width: 20px;
  height: 20px;
}

.recording-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 18px;
}

.recording-bars span {
  width: 3px;
  border-radius: 999px;
  background: #fff;
  animation: recordingBars .9s infinite ease-in-out;
}

.recording-bars span:nth-child(1) { height: 9px; animation-delay: 0s; }
.recording-bars span:nth-child(2) { height: 16px; animation-delay: .12s; }
.recording-bars span:nth-child(3) { height: 12px; animation-delay: .24s; }

@keyframes recordingBars {
  0%,100% { transform: scaleY(.65); opacity: .72; }
  50% { transform: scaleY(1.12); opacity: 1; }
}

.send-button {
  height: 46px;
  min-width: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.send-button:hover { background: var(--brand-dark); }
.chat-input button:disabled { opacity: .58; cursor: wait; }

.chat-footer-note {
  padding: 0 12px 9px;
  background: #fff;
  color: #9aa5b4;
  font-size: 10px;
  text-align: center;
}

.messages::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-thumb { border-radius: 999px; background: #ccd6e1; }
.messages::-webkit-scrollbar-track { background: transparent; }

html,
body.embed-body {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

body.embed-body {
  background: #f6f8fb;
}

.embed-page {
  width: 100%;
  height: 100vh;
  min-height: 0;

  display: flex;
  flex-direction: column;

  overflow: hidden;

  background:
    linear-gradient(
      180deg,
      #fafbfc 0%,
      #f3f6f9 100%
    );
}

.embed-page .chat-card {
  width: 100%;
  height: 100%;
  min-height: 0;

  margin: 0;

  display: flex;
  flex-direction: column;

  overflow: hidden;

  border: 0;
  border-radius: 0;

  background: transparent;

  box-shadow: none;
}

.embed-internal-header,
.embed-page .chat-header {
  display: none;
}

.embed-page .messages {
  flex: 1 1 auto;

  height: 0;
  min-height: 0;

  overflow-y: auto;
  overflow-x: hidden;

  padding: 14px 12px;

  background: transparent;

  -webkit-overflow-scrolling: touch;
}

.embed-page .bubble { max-width: 91%; }
.embed-page .welcome-message { max-width: 94%; }

.embed-page .chat-input {
  flex: 0 0 auto;

  position: relative;
  z-index: 20;

  width: 100%;

  padding:
    10px
    10px
    calc(10px + env(safe-area-inset-bottom));

  border-top: 1px solid var(--border);

  background: #ffffff;
}

.embed-page .chat-footer-note { display: none; }

@media (max-width: 600px) {
  .page { width: 100%; padding: 0; }
  .intro { padding: 28px 20px 20px; margin-bottom: 0; }
  .intro h1 { font-size: 34px; }
  .intro-description { font-size: 15px; }
  .chat-card { border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
  .messages { height: 55vh; padding: 15px 12px; }
  .bubble { max-width: 92%; font-size: 15px; }
  .welcome-message { max-width: 94%; }
  .chat-input { gap: 7px; padding: 10px; }
  .mic-button { width: 44px; min-width: 44px; height: 44px; }
  .send-button { min-width: 66px; height: 44px; padding: 0 11px; }
  .send-arrow { display: none; }
}

@media (max-width: 380px) {
  .messages,
  .embed-page .messages { padding: 12px 9px; }
  .bubble,
  .embed-page .bubble { max-width: 94%; font-size: 14px; }
  .chat-input,
  .embed-page .chat-input { gap: 6px; padding: 8px; }
  .mic-button { width: 42px; min-width: 42px; height: 42px; }
  .send-button { min-width: 58px; height: 42px; padding: 0 9px; font-size: 12px; }
}

/* =========================
   PORTFOLIO BUTTON
========================= */

/* =========================
   CHAT MENU BUTTONS
========================= */

.portfolio-button {
  width:100%;
  margin-top:14px;
  padding:10px 14px;
  border:none;
  border-radius:22px;
  background:#ed0010;
  color:white;
  font-size:14px;
  font-weight:800;
}


.portfolio-button:hover {

  background: var(--brand-dark);

  transform: translateY(-1px);

}


/* WhatsApp / contact button */

.whatsapp-button {

  width:100%;
  margin-top:10px;
  padding:10px 14px;
  border:none;
  border-radius:22px;
  background:#ed0010;
  color:white;
  font-size:14px;
  font-weight:800;
  cursor:pointer;

}


/* Portfolio links */

.portfolio-list {

  margin-top: 15px;

  padding: 16px;

  background: white;

  border-radius: 14px;

  border: 1px solid var(--border);

}


.portfolio-list h3 {

  margin-top: 0;

  color: var(--text);

}


.portfolio-list a {

  display: block;

  margin: 10px 0;

  color: var(--brand);

  text-decoration: none;

  font-weight: 700;

}


.portfolio-list a:hover {

  text-decoration: underline;

}

.portfolio-box {
    padding: 15px;
}

.portfolio-box h3 {
    margin-bottom: 15px;
}

.portfolio-item {
    margin-bottom: 10px;
}

.portfolio-item a {
    color: #e60000;
    font-weight: 600;
    text-decoration: none;
    display: block;
}

.portfolio-item a:hover {
    text-decoration: underline;
}

.welcome-actions {
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:20px;
}

.welcome-actions button {
  background:#ed0010;
  color:white;
  border:none;
  border-radius:30px;
  padding:14px;
  font-weight:bold;
  cursor:pointer;
}

.welcome-actions button:hover {
  opacity:0.9;
}

/* Mobile assistant adjustments */
@media (max-width: 600px) {

  .welcome-message {
    padding: 18px;
  }

  .welcome-icon {
    font-size: 24px;
  }

  .welcome-title {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .welcome-text {
    font-size: 14px;
    line-height: 1.5;
  }

  .welcome-languages {
    font-size: 13px;
    margin-top: 10px;
  }

}

/* =========================================================
   QUICK MENU - COMPETITOR STYLE
========================================================= */

.quick-actions {
  flex: 0 0 auto;

  display: flex;
  flex-direction: column;
  align-items: flex-end;

  gap: 9px;

  padding: 10px 14px 12px;

  background: #f6f8fb;
}

.quick-actions .portfolio-button,
.quick-actions .whatsapp-button {
  width: auto;
  max-width: 90%;

  margin: 0;

  padding: 10px 18px;

  border: none;
  border-radius: 24px;

  background: var(--brand);
  color: #ffffff;

  font-family: inherit;
  font-size: 13px;
  font-weight: 700;

  line-height: 1.25;
  text-align: left;

  cursor: pointer;

  box-shadow: none;
}

.quick-actions .portfolio-button:hover,
.quick-actions .whatsapp-button:hover {
  background: var(--brand-dark);
  transform: none;
}

@media (max-width: 600px) {

  .quick-actions {
    gap: 8px;
    padding: 8px 12px 10px;
  }

  .quick-actions .portfolio-button,
  .quick-actions .whatsapp-button {
    max-width: 92%;
    padding: 9px 16px;
    font-size: 13px;
    border-radius: 22px;
  }

}