/* ============================================
   CARI TECH — Modals, Chat, Partners
   ============================================ */

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 31, 33, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modal-fade 0.25s ease;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-shell {
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modal-rise 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-sm { max-width: 460px; }
.modal-md { max-width: 640px; }
.modal-lg { max-width: 900px; }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink);
  display: inline-flex;
  align-items: center; justify-content: center;
  z-index: 5;
  transition: background 0.2s ease;
}
.modal-close:hover { background: var(--accent); color: #fff; }

/* Lead modal */
.lead-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  min-height: 480px;
}
.lead-modal-side {
  background: linear-gradient(160deg, var(--brand-deep), var(--brand-mid));
  color: #fff;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.lead-modal-side::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  bottom: -60px; right: -60px;
  opacity: 0.4;
  filter: blur(20px);
}
.lead-bullets {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.lead-bullets li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}
.lead-bullets li svg {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  padding: 4px;
  box-sizing: content-box;
}
.lead-foot {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  position: relative;
  z-index: 1;
}
.lead-modal-form {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lead-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 40px 0;
}
.ls-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: inline-flex;
  align-items: center; justify-content: center;
}
.lead-success h4 { font-size: 20px; }
.lead-success p { color: var(--ink-muted); margin: 0; font-size: 14px; }

/* Detail modal */
.detail-modal { display: flex; flex-direction: column; }
.detail-cover {
  padding: 48px 36px 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.detail-cover::after {
  content: '';
  position: absolute;
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  top: -80px; right: -80px;
  opacity: 0.5;
  filter: blur(30px);
}
.detail-cover h3 {
  color: #fff;
  font-size: 28px;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
.detail-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 8px;
}
.detail-cover-portfolio {
  padding: 0;
  height: 280px;
  background: var(--bg-soft);
}
.detail-cover-portfolio .placeholder-img {
  border-radius: 0;
  height: 100%;
}
.detail-body {
  padding: 32px 36px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.detail-feats { display: flex; flex-direction: column; gap: 10px; }
.detail-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.detail-bullets li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.detail-bullets li svg {
  color: var(--accent);
  flex-shrink: 0;
}
.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.detail-meta > div { display: flex; flex-direction: column; gap: 2px; }
.detail-meta span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}
.detail-meta strong {
  font-size: 14px;
  color: var(--ink);
}
.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Partners carousel ---------- */
.partners {
  padding: 64px 0;
  background: var(--bg-soft);
  overflow: hidden;
}
.partners-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
}
.partners-carousel {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.partners-track {
  display: flex;
  gap: 48px;
  animation: scroll-x 32s linear infinite;
  width: max-content;
}
@keyframes scroll-x {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.partner-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  white-space: nowrap;
  transition: border-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.partner-logo:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.partner-glyph {
  font-size: 24px;
  color: var(--accent);
}
.partner-name {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 17px;
  color: var(--ink);
}

/* ---------- Chat FAB ---------- */
.chat-fab {
  position: fixed;
  bottom: 92px; right: 24px;
  width: 56px; height: 56px;
  background: var(--brand-deep);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(2, 82, 84, 0.4);
  z-index: 90;
  transition: transform 0.2s ease, background 0.2s ease;
  border: none;
}
.chat-fab:hover { transform: translateY(-3px) scale(1.05); }
.chat-fab.open { background: var(--accent); }
.chat-fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--brand-deep);
  animation: pin-pulse 2.4s ease-out infinite;
  z-index: -1;
}
.chat-panel {
  position: fixed;
  bottom: 160px; right: 24px;
  width: 360px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 200px);
  background: var(--bg-elev);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 95;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.chat-panel.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-mid));
  color: #fff;
}
.chat-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-flex;
  align-items: center; justify-content: center;
  color: #fff;
}
.chat-title { font-weight: 700; font-size: 14px; }
.chat-status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chat-dot {
  width: 6px; height: 6px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ade80;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}
.chat-msg { display: flex; }
.chat-msg.chat-user { justify-content: flex-end; }
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
}
.chat-assistant .chat-bubble {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.chat-user .chat-bubble {
  background: var(--brand-deep);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-typing { display: inline-flex; gap: 4px; padding: 12px 16px; }
.chat-typing span {
  width: 6px; height: 6px;
  background: var(--ink-muted);
  border-radius: 50%;
  animation: chat-bounce 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}
.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}
.chat-input input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}
.chat-input input:focus { border-color: var(--accent); }
.chat-input button {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.chat-input button:disabled { opacity: 0.4; cursor: not-allowed; }

/* WhatsApp adjusted spacing handled in .whatsapp-fab; chat sits above */

@media (max-width: 640px) {
  .lead-modal-grid { grid-template-columns: 1fr; }
  .lead-modal-side { padding: 28px 24px; }
  .lead-modal-form { padding: 24px; }
  .detail-bullets { grid-template-columns: 1fr; }
  .chat-panel {
    right: 12px; left: 12px;
    width: auto;
    bottom: 150px;
  }
  .chat-fab { bottom: 88px; }
}
