/* ==========================================================================
   Mihir AI — chat/chat.css
   All styles scoped to .mai-* to avoid portfolio conflicts.
   CSS variable fallbacks allow standalone use on ask/index.html
   without requiring styles.css to be loaded.
   ========================================================================== */

/* Local variable aliases: inherit from styles.css if loaded, else use fallbacks */
.mai-overlay,
.mai-fab {
  --mai-primary:       var(--color-primary,      #2563eb);
  --mai-primary-dark:  var(--color-primary-dark,  #1d4ed8);
  --mai-primary-soft:  var(--color-primary-soft,  rgba(37,99,235,0.08));
  --mai-accent:        var(--color-accent,         #6366f1);
  --mai-bg:            var(--color-bg,             #ffffff);
  --mai-bg-muted:      var(--color-bg-muted,       #f7f8fb);
  --mai-bg-dark:       var(--color-bg-dark,        #0b1220);
  --mai-text:          var(--color-text,           #1f2937);
  --mai-text-muted:    var(--color-text-muted,     #5b6472);
  --mai-heading:       var(--color-heading,        #0f172a);
  --mai-border:        var(--color-border,         #e6e8ee);
  --mai-shadow-sm:     var(--shadow-sm,   0 1px 2px rgba(15,23,42,0.05));
  --mai-shadow-md:     var(--shadow-md,   0 4px 16px rgba(15,23,42,0.06));
  --mai-shadow-lg:     var(--shadow-lg,   0 16px 40px rgba(15,23,42,0.09));
  --mai-radius:        8px;
  --mai-transition:    0.22s ease;
}

/* Prevent body scroll when modal is open */
.mai-body-lock {
  overflow: hidden !important;
}

/* Hidden utility — overridable by display flex/grid */
.mai-hidden {
  display: none !important;
}

/* ==========================================================================
   Floating Action Button
   ========================================================================== */

.mai-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 8000;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 20px;
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.42);
  transition: transform var(--mai-transition), box-shadow var(--mai-transition);
  text-decoration: none;
  line-height: 1;
}

.mai-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.52);
  color: #ffffff;
  text-decoration: none;
}

.mai-fab:active {
  transform: translateY(-1px);
}

.mai-fab:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.mai-fab i {
  font-size: 1rem;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .mai-fab {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    bottom: 20px;
    right: 20px;
  }
  .mai-fab-label {
    display: none;
  }
}

/* ==========================================================================
   Full-screen Overlay
   ========================================================================== */

.mai-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(11, 18, 32, 0.78);
  display: flex;
  align-items: stretch;
  justify-content: center;
  animation: mai-fade-in 0.18s ease;
}

@keyframes mai-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ==========================================================================
   Modal Panel
   ========================================================================== */

.mai-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--mai-bg, #ffffff);
  box-shadow: 0 24px 80px rgba(11, 18, 32, 0.38);
  animation: mai-slide-up 0.2s ease;
  overflow: hidden;
  position: relative;
}

@keyframes mai-slide-up {
  from { transform: translateY(14px); opacity: 0.7; }
  to   { transform: translateY(0);    opacity: 1;   }
}

@media (min-width: 640px) {
  .mai-overlay {
    align-items: center;
    padding: 24px;
  }
  .mai-modal {
    border-radius: 14px;
    max-width: 520px;
    height: calc(100vh - 48px);
    max-height: 720px;
  }
}

/* ==========================================================================
   Header
   ========================================================================== */

.mai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  flex-shrink: 0;
}

.mai-header-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.mai-header-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.mai-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  color: #93c5fd;
  font-weight: 400;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mai-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: mai-pulse 2.2s infinite;
  flex-shrink: 0;
}

@keyframes mai-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0);   }
}

.mai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mai-btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background var(--mai-transition), color var(--mai-transition);
  padding: 0;
  line-height: 1;
}

.mai-btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.mai-btn-icon:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* ==========================================================================
   Body — scrollable messages / welcome area
   ========================================================================== */

.mai-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 10px;
  scroll-behavior: smooth;
  background: var(--mai-bg, #ffffff);
  display: flex;
  flex-direction: column;
}

.mai-body::-webkit-scrollbar {
  width: 4px;
}
.mai-body::-webkit-scrollbar-track {
  background: transparent;
}
.mai-body::-webkit-scrollbar-thumb {
  background: var(--mai-border, #e6e8ee);
  border-radius: 2px;
}

/* ==========================================================================
   Welcome state
   ========================================================================== */

.mai-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 12px 8px;
  flex: 1;
  justify-content: center;
}

.mai-welcome-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.65rem;
  margin-bottom: 20px;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.3);
}

.mai-welcome-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--mai-heading, #0f172a);
  margin: 0 0 10px;
  line-height: 1.3;
}

.mai-welcome-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--mai-text-muted, #5b6472);
  margin: 0 0 26px;
  line-height: 1.65;
  max-width: 360px;
}

/* ==========================================================================
   Suggested chips
   ========================================================================== */

.mai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.mai-chip {
  padding: 7px 14px;
  background: #ffffff;
  border: 1px solid var(--mai-border, #e6e8ee);
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--mai-heading, #0f172a);
  cursor: pointer;
  transition:
    border-color var(--mai-transition),
    background var(--mai-transition),
    color var(--mai-transition),
    transform var(--mai-transition),
    box-shadow var(--mai-transition);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  line-height: 1.35;
  text-align: left;
}

.mai-chip:hover {
  border-color: var(--mai-primary, #2563eb);
  background: var(--mai-primary-soft, rgba(37, 99, 235, 0.08));
  color: var(--mai-primary, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.mai-chip:focus-visible {
  outline: 2px solid var(--mai-primary, #2563eb);
  outline-offset: 2px;
}

/* ==========================================================================
   Message list
   ========================================================================== */

.mai-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.mai-message {
  display: flex;
  align-items: flex-end;
}

.mai-message--user {
  justify-content: flex-end;
}

.mai-message--assistant {
  justify-content: flex-start;
}

.mai-bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.65;
  word-break: break-word;
}

.mai-message--user .mai-bubble {
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.mai-message--assistant .mai-bubble {
  background: var(--mai-bg-muted, #f7f8fb);
  color: var(--mai-text, #1f2937);
  border: 1px solid var(--mai-border, #e6e8ee);
  border-bottom-left-radius: 4px;
}

/* ==========================================================================
   Typing / loading indicator
   ========================================================================== */

.mai-loader {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  min-width: 60px;
}

.mai-loader span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mai-text-muted, #5b6472);
  display: block;
  animation: mai-bounce 1.25s ease-in-out infinite;
}

.mai-loader span:nth-child(2) { animation-delay: 0.18s; }
.mai-loader span:nth-child(3) { animation-delay: 0.36s; }

@keyframes mai-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.45; }
  30%            { transform: translateY(-5px); opacity: 1;    }
}

/* ==========================================================================
   Error bar
   ========================================================================== */

.mai-error-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fef2f2;
  border-top: 1px solid #fecaca;
  color: #dc2626;
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.mai-error-bar i {
  flex-shrink: 0;
  font-size: 0.88rem;
}

.mai-error-dismiss {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.65;
}

.mai-error-dismiss:hover {
  opacity: 1;
}

/* ==========================================================================
   Notice bar — shown when turnstile_required: true
   ========================================================================== */

.mai-notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
  color: #92400e;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.mai-notice-bar i {
  flex-shrink: 0;
  color: #d97706;
  font-size: 0.88rem;
}

/* ==========================================================================
   Composer — input area
   ========================================================================== */

.mai-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--mai-border, #e6e8ee);
  background: var(--mai-bg, #ffffff);
  flex-shrink: 0;
}

.mai-input {
  flex: 1;
  padding: 9px 13px;
  border: 1px solid var(--mai-border, #e6e8ee);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--mai-text, #1f2937);
  background: var(--mai-bg-muted, #f7f8fb);
  resize: none;
  outline: none;
  line-height: 1.5;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  transition:
    border-color var(--mai-transition),
    box-shadow var(--mai-transition),
    background var(--mai-transition);
}

.mai-input:focus {
  border-color: var(--mai-primary, #2563eb);
  box-shadow: 0 0 0 3px var(--mai-primary-soft, rgba(37, 99, 235, 0.08));
  background: #ffffff;
}

.mai-input::placeholder {
  color: var(--mai-text-muted, #5b6472);
  font-size: 0.88rem;
}

.mai-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mai-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
  transition:
    opacity var(--mai-transition),
    transform var(--mai-transition),
    box-shadow var(--mai-transition);
  padding: 0;
  line-height: 1;
}

.mai-send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.42);
}

.mai-send-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.mai-send-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ==========================================================================
   AI CTA button — used in hero section and nav
   ========================================================================== */

.mai-btn-ai-cta {
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.mai-btn-ai-cta:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.38) !important;
  transform: translateY(-2px);
  text-decoration: none;
}

.mai-nav-ai-btn {
  color: var(--color-primary, #2563eb) !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

.mai-nav-ai-btn i {
  font-size: 0.88rem;
}

.mai-nav-ai-btn:hover {
  color: var(--color-primary-dark, #1d4ed8) !important;
  background: var(--color-primary-soft, rgba(37, 99, 235, 0.08)) !important;
}

/* ==========================================================================
   Standalone ask page
   ========================================================================== */

.mai-ask-page {
  padding-top: 0 !important;
  background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
}

.mai-ask-hero {
  text-align: center;
  padding: 40px 24px;
}

.mai-ask-hero h1 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mai-ask-hero p {
  font-family: 'Inter', sans-serif;
  color: #5b6472;
  font-size: 1rem;
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

.mai-ask-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.36);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  text-decoration: none;
}

.mai-ask-open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.46);
  color: #ffffff;
  text-decoration: none;
}

.mai-ask-back {
  margin-top: 20px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.mai-ask-back a {
  color: #2563eb;
  text-decoration: none;
}

.mai-ask-back a:hover {
  color: #1d4ed8;
}

/* ==========================================================================
   Turnstile verification panel
   ========================================================================== */

.mai-ts-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 18px 20px 16px;
  background: #f8faff;
  border-top: 1px solid var(--mai-border, #e6e8ee);
  flex-shrink: 0;
}

.mai-ts-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 2px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  flex-shrink: 0;
}

.mai-ts-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mai-heading, #0f172a);
  margin: 0;
  line-height: 1.3;
}

.mai-ts-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--mai-text-muted, #5b6472);
  margin: 0;
  line-height: 1.5;
  max-width: 320px;
}

.mai-ts-widget {
  margin-top: 6px;
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.mai-ts-hint {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: var(--mai-text-muted, #5b6472);
  margin: 2px 0 0;
}

.mai-ts-hint a {
  color: var(--mai-primary, #2563eb);
  text-decoration: none;
}

.mai-ts-hint a:hover {
  text-decoration: underline;
}

/* Dev-mode placeholder (shown when site key is placeholder string) */
.mai-ts-dev {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--mai-text-muted, #5b6472);
  line-height: 1.6;
}

.mai-ts-dev p {
  margin: 0 0 3px;
}

.mai-ts-dev code {
  background: var(--mai-bg-muted, #f7f8fb);
  border: 1px solid var(--mai-border, #e6e8ee);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 0.75rem;
  color: var(--mai-primary, #2563eb);
}

.mai-ts-dev-bypass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--mai-bg-muted, #f7f8fb);
  border: 1px solid var(--mai-border, #e6e8ee);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--mai-heading, #0f172a);
  cursor: pointer;
  transition: background var(--mai-transition), border-color var(--mai-transition), color var(--mai-transition);
}

.mai-ts-dev-bypass:hover {
  background: var(--mai-primary-soft, rgba(37, 99, 235, 0.08));
  border-color: var(--mai-primary, #2563eb);
  color: var(--mai-primary, #2563eb);
}

.mai-ts-dev-bypass:focus-visible {
  outline: 2px solid var(--mai-primary, #2563eb);
  outline-offset: 2px;
}

/* ==========================================================================
   Lead capture form panel
   ========================================================================== */

/* Panel replaces .mai-body when active — same flex: 1 + scroll behaviour */
.mai-lead-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--mai-bg, #ffffff);
  scroll-behavior: smooth;
}

.mai-lead-panel::-webkit-scrollbar { width: 4px; }
.mai-lead-panel::-webkit-scrollbar-track { background: transparent; }
.mai-lead-panel::-webkit-scrollbar-thumb {
  background: var(--mai-border, #e6e8ee);
  border-radius: 2px;
}

.mai-lead-form-wrap {
  padding: 20px 18px 24px;
}

.mai-lead-form-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.mai-lead-form-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 12px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.28);
}

.mai-lead-form-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mai-heading, #0f172a);
  margin: 0 0 6px;
  line-height: 1.3;
}

.mai-lead-form-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  color: var(--mai-text-muted, #5b6472);
  margin: 0;
  line-height: 1.55;
}

/* Form fields */
.mai-lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mai-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mai-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mai-heading, #0f172a);
  line-height: 1.3;
}

.mai-req {
  color: #dc2626;
  margin-left: 2px;
}

.mai-input-field {
  padding: 8px 11px;
  border: 1px solid var(--mai-border, #e6e8ee);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: var(--mai-text, #1f2937);
  background: var(--mai-bg-muted, #f7f8fb);
  outline: none;
  width: 100%;
  transition: border-color var(--mai-transition), box-shadow var(--mai-transition),
              background var(--mai-transition);
  line-height: 1.5;
}

.mai-input-field:focus {
  border-color: var(--mai-primary, #2563eb);
  box-shadow: 0 0 0 3px var(--mai-primary-soft, rgba(37, 99, 235, 0.08));
  background: #ffffff;
}

.mai-input-field::placeholder {
  color: var(--mai-text-muted, #5b6472);
  font-size: 0.85rem;
}

.mai-input-field--textarea {
  resize: vertical;
  min-height: 72px;
  max-height: 160px;
}

select.mai-input-field {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235b6472' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* Checkbox field */
.mai-field--check {
  margin-top: 2px;
}

.mai-check-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--mai-text, #1f2937);
  line-height: 1.5;
  font-weight: 400;
}

.mai-check-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--mai-primary, #2563eb);
  cursor: pointer;
}

/* Validation error */
.mai-form-error {
  padding: 9px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Actions row */
.mai-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.mai-form-submit {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: opacity var(--mai-transition), transform var(--mai-transition),
              box-shadow var(--mai-transition);
  line-height: 1;
}

.mai-form-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.mai-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.mai-form-cancel {
  padding: 10px 14px;
  background: none;
  border: 1px solid var(--mai-border, #e6e8ee);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--mai-text-muted, #5b6472);
  cursor: pointer;
  transition: border-color var(--mai-transition), color var(--mai-transition),
              background var(--mai-transition);
  line-height: 1;
  white-space: nowrap;
}

.mai-form-cancel:hover {
  border-color: var(--mai-text-muted, #5b6472);
  color: var(--mai-heading, #0f172a);
  background: var(--mai-bg-muted, #f7f8fb);
}

/* ==========================================================================
   Lead button in composer
   ========================================================================== */

.mai-lead-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--mai-border, #e6e8ee);
  background: var(--mai-bg-muted, #f7f8fb);
  color: var(--mai-text-muted, #5b6472);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  transition: background var(--mai-transition), color var(--mai-transition),
              border-color var(--mai-transition);
  padding: 0;
  line-height: 1;
}

.mai-lead-btn:hover {
  background: var(--mai-primary-soft, rgba(37, 99, 235, 0.08));
  color: var(--mai-primary, #2563eb);
  border-color: var(--mai-primary, #2563eb);
}

.mai-lead-btn:focus-visible {
  outline: 2px solid var(--mai-primary, #2563eb);
  outline-offset: 2px;
}

/* ==========================================================================
   Lead CTA — inline chat bubble with "Share your contact details" button
   ========================================================================== */

.mai-lead-cta-bubble {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mai-lead-cta-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.mai-lead-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  transition: transform var(--mai-transition), box-shadow var(--mai-transition);
  line-height: 1;
}

.mai-lead-open-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.38);
}

.mai-lead-open-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ==========================================================================
   Lead chip on welcome screen — distinct from regular question chips
   ========================================================================== */

.mai-chip--lead {
  border-color: var(--mai-primary, #2563eb);
  color: var(--mai-primary, #2563eb);
  background: var(--mai-primary-soft, rgba(37, 99, 235, 0.06));
  font-weight: 600;
}

.mai-chip--lead i {
  font-size: 0.8rem;
}

.mai-chip--lead:hover {
  background: var(--mai-primary, #2563eb);
  color: #ffffff;
  border-color: var(--mai-primary, #2563eb);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .mai-overlay,
  .mai-modal,
  .mai-fab,
  .mai-chip,
  .mai-send-btn,
  .mai-loader span {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
