/* ==========================================================================
   Chatbot Styles
   ========================================================================== */

/* Chatbot Widget Container */
/* Positioning is handled dynamically by JavaScript to respect navbar and scroll-to-top button */
#chatbotWidget {
  position: fixed;
  z-index: 100;
  /* Default fallback positioning - will be overridden by JavaScript */
  bottom: 2rem;
  right: 2rem;
  /* Smooth transitions for position changes */
  transition: bottom 0.3s var(--animation-easing),
              right 0.3s var(--animation-easing),
              transform 0.2s ease;
  /* Prevent text selection and double-tap zoom on mobile */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

/* Hide chatbot when qualification funnel is open */
body.qualification-funnel-open #chatbotWidget {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 768px) {
  #chatbotWidget {
    /* Default fallback for mobile - positioned above navbar (5.5rem) */
    /* Right position adjusted for center alignment (chat 3.5rem vs scroll 3rem) */
    bottom: 5.5rem;
    right: 1.25rem; /* 1.5rem - 0.25rem for center alignment with scroll button */
  }
}

@media (max-width: 767px) and (orientation: landscape) {
  #chatbotWidget {
    /* Landscape mobile fallback - adjusted for center alignment */
    right: 3.75rem; /* 4rem - 0.25rem for center alignment with scroll button */
  }
}

/* Chatbot Toggle Button */
.chatbot-toggle-btn {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-full);
  /* Default to orange for Team Piero */
  background: linear-gradient(135deg, rgb(255 140 0 / 0.95) 0%, rgb(255 165 0 / 0.95) 100%);
  border: 2px solid rgb(255 255 255 / 0.2);
  box-shadow: 
    0 4px 12px rgb(255 140 0 / 0.4),
    0 2px 4px rgb(0 0 0 / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition-property: all;
  transition-duration: var(--duration-slow);
  transition-timing-function: var(--easing-base);
  color: white;
  position: relative;
  z-index: 100;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s 0.3s,
              background 0.3s ease,
              box-shadow 0.3s ease;
}

/* Kiss Mortgage - Blue */
[data-app="kiss-mortgage"] .chatbot-toggle-btn {
  background: linear-gradient(135deg, rgb(5 102 141 / 0.95) 0%, rgb(2 132 199 / 0.95) 100%);
  box-shadow: 
    0 4px 12px rgb(5 102 141 / 0.4),
    0 2px 4px rgb(0 0 0 / 0.1);
}

.chatbot-toggle-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s,
              background 0.3s ease,
              box-shadow 0.3s ease;
}

.chatbot-toggle-btn:hover {
  transform: scale(1.05);
  /* Default to orange for Team Piero */
  box-shadow: 
    0 6px 16px rgb(255 140 0 / 0.5),
    0 4px 8px rgb(0 0 0 / 0.15);
}

/* Kiss Mortgage - Blue hover shadow */
[data-app="kiss-mortgage"] .chatbot-toggle-btn:hover {
  box-shadow: 
    0 6px 16px rgb(5 102 141 / 0.5),
    0 4px 8px rgb(0 0 0 / 0.15);
}

.chatbot-toggle-btn:active {
  transform: scale(0.95);
}

.chatbot-icon,
.chatbot-close-icon {
  width: 1.5rem;
  height: 1.5rem;
  position: absolute;
}

.chatbot-close-icon {
  display: none;
}

.chatbot-close-icon:not(.hidden) {
  display: block;
}

/* Chatbot Window */
.chatbot-window {
  position: fixed;
  /* bottom and right are set dynamically by JavaScript */
  bottom: 6.5rem;
  right: 1.5rem;
  width: calc(100vw - 3rem);
  max-width: calc(100vw - 3rem);
  height: 32rem;
  max-height: calc(100vh - 10rem);
  background: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: 
    0 10px 40px rgb(0 0 0 / 0.15),
    0 4px 12px rgb(0 0 0 / 0.1);
  border: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
  /* Smooth transitions for position changes and visibility */
  transition: bottom 0.3s var(--animation-easing),
              right 0.3s var(--animation-easing),
              left 0.3s var(--animation-easing),
              width 0.3s var(--animation-easing),
              max-width 0.3s var(--animation-easing),
              height 0.3s var(--animation-easing),
              max-height 0.3s var(--animation-easing),
              opacity 0.3s var(--animation-easing),
              transform 0.3s var(--animation-easing),
              visibility 0s linear;
  opacity: 1;
  transform: translateY(0) scale(1) translateZ(0);
  visibility: visible;
  pointer-events: auto;
  /* Ensure all children animate together */
  transform-origin: bottom right;
  /* Force hardware acceleration */
  will-change: opacity, transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Create a new stacking context to ensure children animate with parent */
  isolation: isolate;
  /* Ensure all children are properly clipped and rendered together */
  transform-style: flat;
  /* Force the entire container to be rendered as a single unit */
  transform: translateZ(0);
}

.chatbot-window.hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.95) translateZ(0);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s var(--animation-easing),
              transform 0.3s var(--animation-easing),
              visibility 0s linear 0.3s,
              bottom 0.3s var(--animation-easing),
              right 0.3s var(--animation-easing),
              left 0.3s var(--animation-easing),
              width 0.3s var(--animation-easing),
              max-width 0.3s var(--animation-easing),
              height 0.3s var(--animation-easing),
              max-height 0.3s var(--animation-easing);
  /* Keep display: flex to allow transitions, but element is invisible and non-interactive */
  display: flex;
  /* Ensure transform origin is consistent */
  transform-origin: bottom right;
}

/* Children should naturally inherit parent's opacity/visibility */
/* No need to explicitly set - parent's opacity will cascade to all children */

@media (min-width: 769px) {
  .chatbot-window {
    max-width: 28rem;
  }
}

@media (max-width: 768px) {
  .chatbot-window {
    width: calc(100vw - 1.5rem);
    height: calc(100vh - 15rem);
    max-height: calc(100vh - 15rem);
    /* bottom and right are set dynamically by JavaScript */
    bottom: 10rem;
    right: 0.75rem;
    left: 0.75rem;
  }
}

/* Chatbot Header */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  /* Default to orange for Team Piero */
  background: linear-gradient(135deg, rgb(255 140 0 / 0.95) 0%, rgb(255 165 0 / 0.95) 100%);
  color: white !important; /* Always white regardless of theme */
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
  /* Match window border-radius: 1rem (was 1.5rem) */
  border-radius: 1rem 1rem 0 0;
  /* Ensure header is contained within parent */
  position: relative;
  z-index: 1;
  /* Remove any transitions that might conflict with parent animation */
  transition: none;
}

/* Kiss Mortgage - Blue header */
[data-app="kiss-mortgage"] .chatbot-header {
  background: linear-gradient(135deg, rgb(5 102 141 / 0.95) 0%, rgb(2 132 199 / 0.95) 100%);
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.chatbot-header-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background: rgb(255 255 255 / 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chatbot-header-avatar svg {
  width: 1.25rem;
  height: 1.25rem;
}

.chatbot-header-text {
  flex: 1;
  min-width: 0;
}

.chatbot-header-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  color: white !important; /* Always white regardless of theme */
}

.chatbot-header-subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
  margin: var(--space-1) 0 0 0; /* External spacing - margin above timestamp */
  line-height: 1.2;
  color: white !important; /* Always white regardless of theme */
}

.chatbot-minimize-btn {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 0.1);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition-property: background;
  transition-duration: var(--duration-base);
  transition-timing-function: var(--easing-base);
  flex-shrink: 0;
}

.chatbot-minimize-btn:hover {
  background: rgb(255 255 255 / 0.2);
}

.chatbot-minimize-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Chatbot Messages */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-primary);
  /* Ensure messages area is contained within parent */
  position: relative;
  z-index: 1;
  /* Remove any transitions that might conflict with parent animation */
  transition: none;
}

.chatbot-message {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-message-user {
  flex-direction: row-reverse;
}

.chatbot-message-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  /* Default to orange for Team Piero */
  background: linear-gradient(135deg, rgb(255 140 0 / 0.1) 0%, rgb(255 165 0 / 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-primary);
}

/* Kiss Mortgage - Blue avatar */
[data-app="kiss-mortgage"] .chatbot-message-avatar {
  background: linear-gradient(135deg, rgb(5 102 141 / 0.1) 0%, rgb(2 132 199 / 0.1) 100%);
}

.chatbot-message-user .chatbot-message-avatar {
  /* Default to orange for Team Piero */
  background: linear-gradient(135deg, rgb(255 140 0 / 0.2) 0%, rgb(255 165 0 / 0.2) 100%);
}

/* Kiss Mortgage - Blue user avatar */
[data-app="kiss-mortgage"] .chatbot-message-user .chatbot-message-avatar {
  background: linear-gradient(135deg, rgb(5 102 141 / 0.2) 0%, rgb(2 132 199 / 0.2) 100%);
}

.chatbot-message-avatar svg {
  width: 1rem;
  height: 1rem;
}

.chatbot-message-content {
  max-width: 75%;
  padding: var(--space-3) var(--space-4); /* Internal spacing - padding for message content */
  border-radius: 1rem;
  background: var(--border-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}

/* Markdown formatting for AI assistant messages */
.chatbot-message-content p {
  margin: 0 0 0.75rem 0;
}

.chatbot-message-content p:last-child {
  margin-bottom: 0;
}

.chatbot-message-content h1,
.chatbot-message-content h2,
.chatbot-message-content h3,
.chatbot-message-content h4,
.chatbot-message-content h5,
.chatbot-message-content h6 {
  margin: 1rem 0 0.5rem 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.chatbot-message-content h1:first-child,
.chatbot-message-content h2:first-child,
.chatbot-message-content h3:first-child,
.chatbot-message-content h4:first-child,
.chatbot-message-content h5:first-child,
.chatbot-message-content h6:first-child {
  margin-top: 0;
}

.chatbot-message-content h1 {
  font-size: 1.25rem;
}

.chatbot-message-content h2 {
  font-size: 1.125rem;
}

.chatbot-message-content h3 {
  font-size: 1rem;
}

.chatbot-message-content h4,
.chatbot-message-content h5,
.chatbot-message-content h6 {
  font-size: 0.9375rem;
}

.chatbot-message-content ul,
.chatbot-message-content ol {
  margin: 0.5rem 0 0.75rem 0;
  padding-left: 1.5rem;
}

.chatbot-message-content ul:last-child,
.chatbot-message-content ol:last-child {
  margin-bottom: 0;
}

.chatbot-message-content li {
  margin: 0.25rem 0;
  line-height: 1.6;
}

.chatbot-message-content ul {
  list-style-type: disc;
}

.chatbot-message-content ol {
  list-style-type: decimal;
}

.chatbot-message-content ul ul,
.chatbot-message-content ol ol,
.chatbot-message-content ul ol,
.chatbot-message-content ol ul {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}

.chatbot-message-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.chatbot-message-content em {
  font-style: italic;
}

.chatbot-message-content code {
  background: var(--bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  font-family: 'Courier New', Courier, monospace;
  color: var(--text-primary);
}

.chatbot-message-content pre {
  background: var(--bg-secondary);
  padding: 0.75rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.chatbot-message-content pre:last-child {
  margin-bottom: 0;
}

.chatbot-message-content pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.chatbot-message-content a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

.chatbot-message-content a:hover {
  opacity: 0.8;
}

.chatbot-message-content blockquote {
  margin: 0.75rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border-primary);
  color: var(--text-secondary);
  font-style: italic;
}

.chatbot-message-content blockquote:last-child {
  margin-bottom: 0;
}

.chatbot-message-content hr {
  margin: 1rem 0;
  border: none;
  border-top: 1px solid var(--border-primary);
}

.chatbot-message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.8125rem;
}

.chatbot-message-content table:last-child {
  margin-bottom: 0;
}

.chatbot-message-content th,
.chatbot-message-content td {
  padding: 0.5rem;
  border: 1px solid var(--border-primary);
  text-align: left;
}

.chatbot-message-content th {
  font-weight: 600;
  background: var(--bg-secondary);
}

.chatbot-message-user .chatbot-message-content {
  /* Default to orange for Team Piero */
  background: linear-gradient(135deg, rgb(255 140 0 / 0.1) 0%, rgb(255 165 0 / 0.1) 100%);
  border: 1px solid rgb(255 140 0 / 0.2);
}

/* Kiss Mortgage - Blue user message */
[data-app="kiss-mortgage"] .chatbot-message-user .chatbot-message-content {
  background: linear-gradient(135deg, rgb(5 102 141 / 0.1) 0%, rgb(2 132 199 / 0.1) 100%);
  border: 1px solid rgb(5 102 141 / 0.2);
}

.chatbot-message-loading {
  display: flex;
  gap: var(--space-1); /* External spacing - gap between loading dots */
  padding: var(--space-3) var(--space-4); /* Internal spacing - padding for loading message */
}

.chatbot-message-loading span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: bounce 1.4s infinite ease-in-out both;
}

.chatbot-message-loading span:nth-child(1) {
  animation-delay: -0.32s;
}

.chatbot-message-loading span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Chatbot Form */
.chatbot-form {
  padding: 1rem;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-primary);
  /* Ensure form is contained within parent's transform context */
  position: relative;
  z-index: 1;
  /* Remove any transitions that might conflict with parent animation */
  transition: none;
  /* Ensure form inherits parent's transform/opacity smoothly */
  transform: translateZ(0);
  will-change: auto;
}

.chatbot-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  /* Ensure wrapper is contained within parent */
  position: relative;
  /* Remove any transitions that might conflict with parent animation */
  transition: none;
  /* Ensure wrapper inherits parent's transform/opacity smoothly */
  transform: translateZ(0);
  will-change: auto;
}

.chatbot-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 1.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  resize: none;
  outline: none;
  /* Only transition border/shadow, not opacity/transform which should inherit from parent */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 2.75rem;
  max-height: 6rem;
  /* Let input inherit parent's opacity/transform - don't set explicit values */
  /* Ensure input is part of parent's transform context */
  transform: translateZ(0);
  will-change: auto;
}

.chatbot-input:focus {
  /* Default to orange for Team Piero */
  border-color: rgb(255 140 0 / 0.5);
  box-shadow: 0 0 0 3px rgb(255 140 0 / 0.1);
}

/* Kiss Mortgage - Blue input focus */
[data-app="kiss-mortgage"] .chatbot-input:focus {
  border-color: rgb(5 102 141 / 0.5);
  box-shadow: 0 0 0 3px rgb(5 102 141 / 0.1);
}

.chatbot-input:disabled {
  /* Only reduce opacity if parent is visible, otherwise inherit parent's opacity */
  opacity: 0.6;
  cursor: not-allowed;
  /* Ensure disabled state doesn't interfere with parent animation */
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When parent is hidden, ensure disabled input inherits parent's opacity smoothly */
.chatbot-window.hidden .chatbot-input:disabled {
  opacity: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-send-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-full);
  /* Default to orange for Team Piero */
  background: linear-gradient(135deg, rgb(255 140 0 / 0.95) 0%, rgb(255 165 0 / 0.95) 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Only transition interactive states, not transform/opacity which should be controlled by parent */
  transition-property: background, box-shadow, transform;
  transition-duration: var(--duration-base), var(--duration-base), var(--duration-base);
  transition-timing-function: var(--easing-base), var(--easing-base), var(--easing-base);
  flex-shrink: 0;
  /* Ensure button is contained within parent's transform context */
  position: relative;
  /* Prevent independent transforms that might conflict */
  will-change: background, box-shadow;
  /* Let button inherit parent's opacity/transform - don't set explicit values */
  transform: translateZ(0);
}

/* Kiss Mortgage - Blue send button */
[data-app="kiss-mortgage"] .chatbot-send-btn {
  background: linear-gradient(135deg, rgb(5 102 141 / 0.95) 0%, rgb(2 132 199 / 0.95) 100%);
}

.chatbot-send-btn:hover:not(:disabled) {
  /* Use transform with relative scaling - this will work within parent's transform context */
  transform: translateZ(0) scale(1.05);
  /* Default to orange for Team Piero */
  box-shadow: 0 4px 12px rgb(255 140 0 / 0.4);
}

/* Kiss Mortgage - Blue send button hover */
[data-app="kiss-mortgage"] .chatbot-send-btn:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgb(5 102 141 / 0.4);
}

.chatbot-send-btn:active:not(:disabled) {
  /* Use transform with relative scaling - this will work within parent's transform context */
  transform: translateZ(0) scale(0.95);
}

/* Disable hover/active transforms when parent is hidden to prevent animation conflicts */
.chatbot-window.hidden .chatbot-send-btn:hover:not(:disabled),
.chatbot-window.hidden .chatbot-send-btn:active:not(:disabled) {
  transform: translateZ(0);
}

.chatbot-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When parent is hidden, ensure disabled button inherits parent's opacity smoothly */
.chatbot-window.hidden .chatbot-send-btn:disabled {
  opacity: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-send-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Dark Mode Support */
[data-theme="dark"] .chatbot-window {
  background: var(--bg-primary);
  border-color: rgb(255 255 255 / 0.1);
}

[data-theme="dark"] .chatbot-message-content {
  background: rgb(255 255 255 / 0.05);
  border-color: rgb(255 255 255 / 0.1);
}

[data-theme="dark"] .chatbot-message-user .chatbot-message-content {
  /* Default to orange for Team Piero */
  background: linear-gradient(135deg, rgb(255 140 0 / 0.2) 0%, rgb(255 165 0 / 0.2) 100%);
  border-color: rgb(255 140 0 / 0.3);
}

/* Kiss Mortgage - Blue user message in dark mode */
[data-theme="dark"][data-app="kiss-mortgage"] .chatbot-message-user .chatbot-message-content {
  background: linear-gradient(135deg, rgb(5 102 141 / 0.2) 0%, rgb(2 132 199 / 0.2) 100%);
  border-color: rgb(5 102 141 / 0.3);
}

[data-theme="dark"] .chatbot-input {
  background: rgb(255 255 255 / 0.05);
  border-color: rgb(255 255 255 / 0.1);
}

[data-theme="dark"] .chatbot-input:focus {
  /* Default to orange for Team Piero */
  border-color: rgb(255 140 0 / 0.5);
  box-shadow: 0 0 0 3px rgb(255 140 0 / 0.2);
}

/* Kiss Mortgage - Blue input focus in dark mode */
[data-theme="dark"][data-app="kiss-mortgage"] .chatbot-input:focus {
  border-color: rgb(5 102 141 / 0.5);
  box-shadow: 0 0 0 3px rgb(5 102 141 / 0.2);
}

[data-theme="dark"] .chatbot-form {
  border-top-color: rgb(255 255 255 / 0.1);
}


/* ==========================================================================
   Loading Component Styles
   ========================================================================== */
/* Prevent body scroll during initial loading */
body:has([data-loading="true"]) {
  overflow: hidden;
}

/* Smooth fade-in for app content after loading */
@keyframes appFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Loading spinner animation - consolidated (removed duplicate definition) */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Pulse animation for loading elements */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Ensure smooth transitions for loading states */
[data-loading="true"] {
  animation: appFadeIn 0.3s ease-in-out;
}

/* Qualification Funnel Animations */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-4px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(4px);
  }
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* Funnel step transitions */
.funnel-step {
  animation: fadeInSlide 0.3s ease-out;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gentle looping bounce for success icon */
@keyframes gentleBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.02);
  }
}

.animate-gentle-bounce {
  animation: gentleBounce 2s ease-in-out infinite;
}

/* Icon reveal animation for qualification success */
@keyframes iconReveal {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  60% {
    transform: scale(1.2) rotate(10deg);
  }
  80% {
    transform: scale(0.95) rotate(-5deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.animate-icon-reveal {
  animation: iconReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             gentleBounce 2s ease-in-out 0.8s infinite;
  opacity: 0;
}

/* Qualification Funnel Header - Glassmorphic Theme */
.funnel-header-glass {
  background: rgb(255 255 255 / 0.75);
  backdrop-filter: blur(var(--blur-2xl)) saturate(var(--backdrop-saturate));
  box-shadow: 0 4px 16px rgb(var(--color-primary-rgb) / 0.08),
              0 2px 8px rgb(0 0 0 / 0.04),
              0 0 0 1px rgb(255 255 255 / 0.3) inset,
              inset 0 1px 0 rgb(255 255 255 / 0.5);
}

[data-theme="dark"] .funnel-header-glass {
  background: rgb(4 3 3 / 0.7);
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.4),
              0 2px 8px rgb(0 0 0 / 0.3),
              0 0 0 1px rgb(var(--color-neutral-400-rgb) / 0.15) inset,
              inset 0 1px 0 rgb(255 255 255 / 0.08);
}

/* Progress bar shimmer animation */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.animate-shimmer {
  animation: shimmer 2s infinite;
}

/* ==========================================================================
   Auth Success Animations
   ========================================================================== */
/* Success fade-in animation for auth messages */
@keyframes successFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-success-fade-in {
  animation: successFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Success state for auth buttons */
.auth-success-state {
  background: rgb(34 197 94 / 0.9) !important;
  border-color: rgb(34 197 94) !important;
  color: white !important;
  box-shadow: 0 0 20px rgb(34 197 94 / 0.5) !important;
  pointer-events: none;
}

.auth-success-state svg {
  animation: checkmarkDraw 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes checkmarkDraw {
  0% {
    stroke-dasharray: 0, 100;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    stroke-dasharray: 100, 0;
    opacity: 1;
  }
}

/* Ensure confetti canvas is visible above all content on all screen sizes */
body > canvas {
  position: fixed !important;
  inset-block-start: 0 !important;
  inset-inline-start: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 99999 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure confetti canvas is visible above qualification funnel modal on desktop */
#qualificationFunnelModal ~ canvas,
body.qualification-funnel-open > canvas {
  position: fixed !important;
  inset-block-start: 0 !important;
  inset-inline-start: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 100000 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}


/* ==========================================================================
   Route Progress Bar Styles
   ========================================================================== */

/* Progress bar container */
#nprogress {
  pointer-events: none;
}

/* Progress bar */
#nprogress .bar {
  background: rgb(var(--color-primary-rgb));
  position: fixed;
  z-index: 99999;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  box-shadow: 0 0 10px rgb(var(--color-primary-rgb) / 0.5),
              0 0 5px rgb(var(--color-secondary-rgb) / 0.3);
}

/* Progress bar glow effect */
#nprogress .peg {
  display: block;
  position: absolute;
  right: 0px;
  width: 100px;
  height: 100%;
  box-shadow: 0 0 10px rgb(var(--color-secondary-rgb)),
              0 0 5px rgb(var(--color-secondary-rgb));
  opacity: 1.0;
  transform: rotate(3deg) translate(0px, -4px);
}

/* Smooth animation */
#nprogress .bar {
  transition: width 0.4s ease;
}

/* ==========================================================================
   Calculator Slider Styles
   ========================================================================== */
.calculator-slider {
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, rgb(var(--color-primary-rgb)) 0%, rgb(var(--color-primary-rgb)) var(--slider-progress, 50%), rgb(var(--color-primary-rgb) / 0.2) var(--slider-progress, 50%), rgb(var(--color-primary-rgb) / 0.2) 100%);
  border-radius: 3px;
  outline: none;
  /* Remove transition on background for immediate visual feedback during dragging */
  transition: none;
  position: relative;
}

/* Webkit (Chrome, Safari, Edge) Slider Thumb - Glassmorphic Design */
.calculator-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgb(var(--color-secondary-rgb) / 0.85) 0%, rgb(168 133 62 / 0.9) 100%);
  border: 2px solid rgb(255 255 255 / 0.8);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 
    0 2px 8px rgb(0 0 0 / 0.15),
    0 0 0 1px rgb(var(--color-secondary-rgb) / 0.3),
    inset 0 1px 3px rgb(255 255 255 / 0.4);
  backdrop-filter: blur(var(--blur-sm)) saturate(150%);
  -webkit-transition-property: all;
  transition-property: all;
  transition-duration: var(--duration-slow);
  transition-timing-function: var(--easing-base);
  position: relative;
  margin-top: -19px; /* Centers the 44px thumb on the 6px track */
}

.calculator-slider::-webkit-slider-thumb:active {
  transform: scale(1.05);
}

.calculator-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 
    0 3px 12px rgb(0 0 0 / 0.2),
    0 0 0 1px rgb(var(--color-secondary-rgb) / 0.4),
    inset 0 1px 3px rgb(255 255 255 / 0.5);
}

/* KISS Mortgage - Calculator slider thumb - Use gold color */
[data-app="kiss-mortgage"] .calculator-slider::-webkit-slider-thumb {
  background: linear-gradient(135deg, rgb(199 159 79 / 0.85) 0%, rgb(180 140 60 / 0.9) 100%);
  box-shadow: 
    0 2px 8px rgb(0 0 0 / 0.15),
    0 0 0 1px rgb(199 159 79 / 0.3),
    inset 0 1px 3px rgb(255 255 255 / 0.4);
}

[data-app="kiss-mortgage"] .calculator-slider::-webkit-slider-thumb:hover {
  box-shadow: 
    0 3px 12px rgb(0 0 0 / 0.2),
    0 0 0 1px rgb(199 159 79 / 0.4),
    inset 0 1px 3px rgb(255 255 255 / 0.5);
}

/* Firefox Slider Thumb - Glassmorphic Design */
.calculator-slider::-moz-range-thumb {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgb(var(--color-secondary-rgb) / 0.85) 0%, rgb(168 133 62 / 0.9) 100%);
  border: 2px solid rgb(255 255 255 / 0.8);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 
    0 2px 8px rgb(0 0 0 / 0.15),
    0 0 0 1px rgb(var(--color-secondary-rgb) / 0.3),
    inset 0 1px 3px rgb(255 255 255 / 0.4);
  -moz-transition-property: all;
  transition-property: all;
  transition-duration: var(--duration-slow);
  transition-timing-function: var(--easing-base);
}

.calculator-slider::-moz-range-thumb:active {
  transform: scale(1.05);
}

.calculator-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 
    0 3px 12px rgb(0 0 0 / 0.2),
    0 0 0 1px rgb(var(--color-secondary-rgb) / 0.4),
    inset 0 1px 3px rgb(255 255 255 / 0.5);
}

/* KISS Mortgage - Firefox calculator slider thumb - Use gold color */
[data-app="kiss-mortgage"] .calculator-slider::-moz-range-thumb {
  background: linear-gradient(135deg, rgb(199 159 79 / 0.85) 0%, rgb(180 140 60 / 0.9) 100%);
  box-shadow: 
    0 2px 8px rgb(0 0 0 / 0.15),
    0 0 0 1px rgb(199 159 79 / 0.3),
    inset 0 1px 3px rgb(255 255 255 / 0.4);
}

[data-app="kiss-mortgage"] .calculator-slider::-moz-range-thumb:hover {
  box-shadow: 
    0 3px 12px rgb(0 0 0 / 0.2),
    0 0 0 1px rgb(199 159 79 / 0.4),
    inset 0 1px 3px rgb(255 255 255 / 0.5);
}

/* Slider Track Styling */
.calculator-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  border-radius: 3px;
}

.calculator-slider::-moz-range-track {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgb(var(--color-primary-rgb) / 0.2);
  border: none;
}

/* Dark Mode Support */
[data-theme="dark"] .calculator-slider {
  background: linear-gradient(to right, rgb(var(--color-primary-rgb)) 0%, rgb(var(--color-primary-rgb)) var(--slider-progress, 50%), rgb(var(--color-primary-rgb) / 0.2) var(--slider-progress, 50%), rgb(var(--color-primary-rgb) / 0.2) 100%);
}

[data-theme="dark"] .calculator-slider::-webkit-slider-thumb {
  background: linear-gradient(135deg, rgb(var(--color-secondary-rgb) / 0.85) 0%, rgb(217 119 6 / 0.9) 100%);
  border-color: rgb(255 255 255 / 0.9);
  box-shadow: 
    0 2px 8px rgb(0 0 0 / 0.3),
    0 0 0 1px rgb(var(--color-secondary-rgb) / 0.4),
    inset 0 1px 3px rgb(255 255 255 / 0.4);
}

/* KISS Mortgage - Dark mode calculator slider thumb - Use gold color */
[data-app="kiss-mortgage"][data-theme="dark"] .calculator-slider::-webkit-slider-thumb {
  background: linear-gradient(135deg, rgb(199 159 79 / 0.85) 0%, rgb(180 140 60 / 0.9) 100%);
  box-shadow: 
    0 2px 8px rgb(0 0 0 / 0.3),
    0 0 0 1px rgb(199 159 79 / 0.4),
    inset 0 1px 3px rgb(255 255 255 / 0.4);
}

[data-theme="dark"] .calculator-slider::-moz-range-thumb {
  background: linear-gradient(135deg, rgb(var(--color-secondary-rgb) / 0.85) 0%, rgb(217 119 6 / 0.9) 100%);
  border-color: rgb(255 255 255 / 0.9);
  box-shadow: 
    0 2px 8px rgb(0 0 0 / 0.3),
    0 0 0 1px rgb(var(--color-secondary-rgb) / 0.4),
    inset 0 1px 3px rgb(255 255 255 / 0.4);
}

/* KISS Mortgage - Dark mode Firefox calculator slider thumb - Use gold color */
[data-app="kiss-mortgage"][data-theme="dark"] .calculator-slider::-moz-range-thumb {
  background: linear-gradient(135deg, rgb(199 159 79 / 0.85) 0%, rgb(180 140 60 / 0.9) 100%);
  box-shadow: 
    0 2px 8px rgb(0 0 0 / 0.3),
    0 0 0 1px rgb(199 159 79 / 0.4),
    inset 0 1px 3px rgb(255 255 255 / 0.4);
}

/* ==========================================================================
   Interest Rate Display - Override global mobile font-size
   ========================================================================== */
/* Override the global 16px mobile font-size rule for the interest rate display */
.interest-rate-display {
  font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
}

@media screen and (max-width: 768px) {
  .interest-rate-display,
  input.interest-rate-display,
  input[type="text"].interest-rate-display {
    font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
  }
  
  [data-theme="dark"] .interest-rate-display,
  [data-theme="dark"] input.interest-rate-display,
  [data-theme="dark"] input[type="text"].interest-rate-display {
    font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
  }
}


/* ==========================================================================
   CRM Component Styles
   Modern card-based CRM interface components
   ========================================================================== */

/* CRM Card - Enhanced card styling for client cards */
.crm-card {
  background: rgb(255 255 255 / 0.98);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1.5px solid rgb(var(--color-primary-rgb) / 0.15);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.08),
              0 2px 8px rgb(var(--color-primary-rgb) / 0.05),
              0 0 0 1px rgb(255 255 255 / 0.8) inset;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.crm-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    rgb(var(--color-primary-rgb)) 0%, 
    rgb(var(--color-secondary-rgb)) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.crm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.12),
              0 6px 16px rgb(var(--color-primary-rgb) / 0.1),
              0 0 0 1px rgb(255 255 255 / 0.9) inset;
  border-color: rgb(var(--color-primary-rgb) / 0.25);
}

.crm-card:hover::before {
  opacity: 1;
}

[data-theme="dark"] .crm-card {
  background: rgb(4 3 3 / 0.85);
  border-color: rgb(var(--color-neutral-400-rgb) / 0.2);
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.4),
              0 2px 8px rgb(0 0 0 / 0.3),
              0 0 0 1px rgb(255 255 255 / 0.05) inset;
}

[data-theme="dark"] .crm-card:hover {
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.6),
              0 6px 16px rgb(var(--color-primary-rgb) / 0.2),
              0 0 0 1px rgb(255 255 255 / 0.08) inset;
  border-color: rgb(var(--color-primary-rgb) / 0.35);
}

/* CRM Card Clickable */
.crm-card--clickable {
  cursor: pointer;
}

.crm-card--clickable:active {
  transform: translateY(-2px);
}

/* CRM Stat Card - For dashboard statistics */
.crm-stat-card {
  background: linear-gradient(135deg, 
    rgb(var(--color-primary-rgb) / 0.05) 0%, 
    rgb(var(--color-secondary-rgb) / 0.05) 100%);
  border: 1.5px solid rgb(var(--color-primary-rgb) / 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.crm-stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, 
    rgb(var(--color-primary-rgb) / 0.1) 0%, 
    transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.crm-stat-card:hover {
  border-color: rgb(var(--color-primary-rgb) / 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgb(var(--color-primary-rgb) / 0.15);
}

.crm-stat-card:hover::after {
  opacity: 1;
}

[data-theme="dark"] .crm-stat-card {
  background: linear-gradient(135deg, 
    rgb(var(--color-primary-rgb) / 0.08) 0%, 
    rgb(var(--color-secondary-rgb) / 0.08) 100%);
  border-color: rgb(var(--color-primary-rgb) / 0.3);
}

[data-theme="dark"] .crm-stat-card:hover {
  border-color: rgb(var(--color-primary-rgb) / 0.5);
  box-shadow: 0 8px 24px rgb(var(--color-primary-rgb) / 0.25);
}

/* CRM Stat Number */
.crm-stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, 
    rgb(var(--color-primary-rgb)), 
    rgb(var(--color-secondary-rgb)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .crm-stat-number {
  background: linear-gradient(135deg, 
    rgb(var(--color-primary-rgb) / 0.9), 
    rgb(var(--color-secondary-rgb) / 0.9));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.crm-stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--color-neutral-600-rgb));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .crm-stat-label {
  color: rgb(var(--color-neutral-400-rgb));
}

/* CRM Badge - Status and category badges */
.crm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.crm-badge--status {
  background: rgb(var(--color-primary-rgb) / 0.1);
  color: rgb(var(--color-primary-rgb));
  border: 1px solid rgb(var(--color-primary-rgb) / 0.2);
}

.crm-badge--success {
  background: rgb(34 197 94 / 0.1);
  color: rgb(22 163 74);
  border: 1px solid rgb(34 197 94 / 0.2);
}

.crm-badge--warning {
  background: rgb(251 146 60 / 0.1);
  color: rgb(234 88 12);
  border: 1px solid rgb(251 146 60 / 0.2);
}

.crm-badge--error {
  background: rgb(239 68 68 / 0.1);
  color: rgb(220 38 38);
  border: 1px solid rgb(239 68 68 / 0.2);
}

.crm-badge--info {
  background: rgb(59 130 246 / 0.1);
  color: rgb(37 99 235);
  border: 1px solid rgb(59 130 246 / 0.2);
}

.crm-badge--neutral {
  background: rgb(var(--color-neutral-500-rgb) / 0.1);
  color: rgb(var(--color-neutral-700-rgb));
  border: 1px solid rgb(var(--color-neutral-500-rgb) / 0.2);
}

[data-theme="dark"] .crm-badge--status {
  background: rgb(var(--color-primary-rgb) / 0.15);
  color: rgb(var(--color-primary-rgb) / 0.95);
  border-color: rgb(var(--color-primary-rgb) / 0.3);
}

[data-theme="dark"] .crm-badge--success {
  background: rgb(34 197 94 / 0.15);
  color: rgb(134 239 172);
  border-color: rgb(34 197 94 / 0.3);
}

[data-theme="dark"] .crm-badge--warning {
  background: rgb(251 146 60 / 0.15);
  color: rgb(253 186 116);
  border-color: rgb(251 146 60 / 0.3);
}

[data-theme="dark"] .crm-badge--error {
  background: rgb(239 68 68 / 0.15);
  color: rgb(252 165 165);
  border-color: rgb(239 68 68 / 0.3);
}

[data-theme="dark"] .crm-badge--info {
  background: rgb(59 130 246 / 0.15);
  color: rgb(147 197 253);
  border-color: rgb(59 130 246 / 0.3);
}

[data-theme="dark"] .crm-badge--neutral {
  background: rgb(var(--color-neutral-500-rgb) / 0.15);
  color: rgb(var(--color-neutral-300-rgb));
  border-color: rgb(var(--color-neutral-500-rgb) / 0.3);
}

/* CRM Avatar - Client avatar/initials */
.crm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, 
    rgb(var(--color-primary-rgb)), 
    rgb(var(--color-secondary-rgb)));
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
  border: 2px solid rgb(255 255 255 / 0.9);
  box-shadow: 0 4px 12px rgb(var(--color-primary-rgb) / 0.3);
  transition: all 0.3s ease;
}

.crm-avatar--sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.875rem;
}

.crm-avatar--lg {
  width: 4rem;
  height: 4rem;
  font-size: 1.5rem;
}

.crm-avatar--xl {
  width: 5rem;
  height: 5rem;
  font-size: 2rem;
}

.crm-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgb(var(--color-primary-rgb) / 0.4);
}

[data-theme="dark"] .crm-avatar {
  border-color: rgb(var(--color-neutral-800-rgb));
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.5);
}

[data-theme="dark"] .crm-avatar:hover {
  box-shadow: 0 6px 16px rgb(var(--color-primary-rgb) / 0.5);
}

/* CRM Quick Action Buttons */
.crm-quick-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  background: rgb(var(--color-primary-rgb) / 0.1);
  color: rgb(var(--color-primary-rgb));
  border: 1px solid rgb(var(--color-primary-rgb) / 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  white-space: nowrap;
}

.crm-quick-action:hover {
  background: rgb(var(--color-primary-rgb));
  color: white;
  border-color: rgb(var(--color-primary-rgb));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(var(--color-primary-rgb) / 0.3);
}

.crm-quick-action:active {
  transform: translateY(0);
}

.crm-quick-action--secondary {
  background: rgb(var(--color-neutral-500-rgb) / 0.1);
  color: rgb(var(--color-neutral-700-rgb));
  border-color: rgb(var(--color-neutral-500-rgb) / 0.2);
}

.crm-quick-action--secondary:hover {
  background: rgb(var(--color-neutral-600-rgb));
  color: white;
  border-color: rgb(var(--color-neutral-600-rgb));
}

.crm-quick-action--success {
  background: rgb(34 197 94 / 0.1);
  color: rgb(22 163 74);
  border-color: rgb(34 197 94 / 0.2);
}

.crm-quick-action--success:hover {
  background: rgb(22 163 74);
  color: white;
  border-color: rgb(22 163 74);
}

[data-theme="dark"] .crm-quick-action {
  background: rgb(var(--color-primary-rgb) / 0.15);
  color: rgb(var(--color-primary-rgb) / 0.95);
  border-color: rgb(var(--color-primary-rgb) / 0.3);
}

[data-theme="dark"] .crm-quick-action:hover {
  background: rgb(var(--color-primary-rgb) / 0.9);
  color: white;
  border-color: rgb(var(--color-primary-rgb) / 0.9);
}

[data-theme="dark"] .crm-quick-action--secondary {
  background: rgb(var(--color-neutral-500-rgb) / 0.15);
  color: rgb(var(--color-neutral-300-rgb));
  border-color: rgb(var(--color-neutral-500-rgb) / 0.3);
}

[data-theme="dark"] .crm-quick-action--secondary:hover {
  background: rgb(var(--color-neutral-500-rgb));
  color: white;
  border-color: rgb(var(--color-neutral-500-rgb));
}

/* Client profile hero banner: same in both theme modes - gradient + white text and high-contrast buttons */
.crm-profile-hero .crm-badge {
  background: rgb(255 255 255 / 0.25);
  color: white;
  border-color: rgb(255 255 255 / 0.5);
}

.crm-profile-hero .crm-quick-action--secondary.crm-quick-action--on-hero {
  background: rgb(255 255 255 / 0.15);
  color: white;
  border-color: rgb(255 255 255 / 0.5);
}

.crm-profile-hero .crm-quick-action--secondary.crm-quick-action--on-hero:hover {
  background: rgb(255 255 255 / 0.3);
  color: white;
  border-color: rgb(255 255 255 / 0.7);
}

/* Request Docs on hero: solid white for visibility */
.crm-profile-hero .crm-quick-action--success.crm-quick-action--on-hero {
  background: white;
  color: rgb(22 163 74);
  border-color: rgb(255 255 255 / 0.9);
}

.crm-profile-hero .crm-quick-action--success.crm-quick-action--on-hero:hover {
  background: rgb(248 250 252);
  color: rgb(22 163 74);
  border-color: white;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
}

/* CRM Grid Layout */
.crm-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .crm-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .crm-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .crm-grid--4col {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* CRM Client Card Content Layout */
.crm-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.crm-card-body {
  margin-bottom: 1rem;
}

.crm-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgb(var(--color-neutral-200-rgb));
}

[data-theme="dark"] .crm-card-footer {
  border-color: rgb(var(--color-neutral-700-rgb));
}

/* CRM Filter Panel - base styles; when used on dashboard (body.dashboard-page),
   overrides in _dashboard.css apply so dashboard filter uses dashboard surface
   colors only and is not tied to homepage/marketing styles. */
.crm-filter-panel {
  background: rgb(255 255 255 / 0.95);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgb(var(--color-primary-rgb) / 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .crm-filter-panel {
  background: rgb(4 3 3 / 0.8);
  border-color: rgb(var(--color-neutral-400-rgb) / 0.2);
}

.crm-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.crm-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgb(var(--color-primary-rgb) / 0.1);
  color: rgb(var(--color-primary-rgb));
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-filter-chip:hover {
  background: rgb(var(--color-primary-rgb) / 0.15);
}

.crm-filter-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: rgb(var(--color-primary-rgb) / 0.2);
  transition: background 0.2s ease;
}

.crm-filter-chip:hover .crm-filter-chip-remove {
  background: rgb(var(--color-primary-rgb) / 0.3);
}

/* CRM Info Row */
.crm-info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgb(var(--color-neutral-600-rgb));
  margin-bottom: 0.5rem;
}

.crm-info-row:last-child {
  margin-bottom: 0;
}

[data-theme="dark"] .crm-info-row {
  color: rgb(var(--color-neutral-400-rgb));
}

.crm-info-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: rgb(var(--color-primary-rgb));
}

/* CRM View Toggle */
.crm-view-toggle {
  display: inline-flex;
  background: rgb(var(--color-neutral-100-rgb));
  border-radius: 8px;
  padding: 0.25rem;
  gap: 0.25rem;
}

[data-theme="dark"] .crm-view-toggle {
  background: rgb(4 3 3);
}

.crm-view-toggle-btn {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--color-neutral-600-rgb));
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: none;
}

.crm-view-toggle-btn:hover {
  color: rgb(var(--color-neutral-900-rgb));
}

.crm-view-toggle-btn.active {
  background: white;
  color: rgb(var(--color-primary-rgb));
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] .crm-view-toggle-btn {
  color: rgb(var(--color-neutral-400-rgb));
}

[data-theme="dark"] .crm-view-toggle-btn:hover {
  color: rgb(var(--color-neutral-200-rgb));
}

[data-theme="dark"] .crm-view-toggle-btn.active {
  background: rgb(var(--color-neutral-700-rgb));
  color: rgb(var(--color-primary-rgb));
}

/* CRM Empty State */
.crm-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: rgb(var(--color-neutral-500-rgb));
}

[data-theme="dark"] .crm-empty-state {
  color: rgb(var(--color-neutral-400-rgb));
}

.crm-empty-state-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

.crm-empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: rgb(var(--color-neutral-700-rgb));
}

[data-theme="dark"] .crm-empty-state-title {
  color: rgb(var(--color-neutral-300-rgb));
}

/* Responsive Utilities for CRM */
@media (max-width: 639px) {
  .crm-card {
    padding: 1rem;
  }
  
  .crm-stat-card {
    padding: 1rem;
  }
  
  .crm-stat-number {
    font-size: 2rem;
  }
  
  .crm-card-footer {
    flex-direction: column;
    align-items: stretch;
  }
  
  .crm-quick-action {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Confirm Dialog Styles
   ========================================================================== */
.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(8px);
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

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

.confirm-dialog-content {
  position: relative;
  max-width: 500px;
  width: 100%;
  padding: 2rem;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.3),
              0 0 0 1px rgb(255 255 255 / 0.1) inset;
}

[data-theme="dark"] .confirm-dialog-content {
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.5),
              0 0 0 1px rgb(255 255 255 / 0.15) inset;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confirm-dialog-header {
  margin-bottom: 1.5rem;
}

.confirm-dialog-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.confirm-dialog-body {
  margin-bottom: 2rem;
}

.confirm-dialog-message {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.confirm-dialog-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.confirm-dialog-footer button {
  flex: 1;
  max-width: 150px;
}

@media (max-width: 640px) {
  .confirm-dialog-content {
    padding: 1.5rem;
  }
  
  .confirm-dialog-title {
    font-size: 1.25rem;
  }
  
  .confirm-dialog-footer {
    flex-direction: column-reverse;
  }
  
  .confirm-dialog-footer button {
    max-width: none;
    width: 100%;
  }
}

/* Scroll lock is handled in JS (confirm-dialog-provider) so cleanup always runs */

/* ==========================================================================
   Glass Utility Classes
   ========================================================================== */
/* Used on marketing/homepage and other non-dashboard pages. Dashboard overrides
   (body.dashboard-page .glass-card) live in _dashboard.css and use dashboard
   surface colors only. */

/* ========================================
   Base Glass Card Component
   ======================================== */
/* Main glass card - elegant glassmorphism with subtle blur and soft glows */
.glass-card {
  background: rgb(255 255 255 / 0.7);
  backdrop-filter: blur(var(--blur-md)) saturate(var(--backdrop-saturate));
  border: 1px solid rgb(255 255 255 / 0.4);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-glass);
  position: relative;
  will-change: backdrop-filter, transform;
  transition-property: background-color, border-color, box-shadow, transform;
  transition-duration: var(--animation-duration-base);
  transition-timing-function: var(--animation-easing);
  overflow: visible;
}

/* Dark theme glass card */
[data-theme="dark"] .glass-card {
  background: rgb(var(--color-neutral-900-rgb) / 0.6);
  border-color: rgb(var(--color-neutral-400-rgb) / 0.2);
  box-shadow: var(--shadow-glass);
}

/* Light background variant (explicit light theme) */
.glass-card[data-bg="light"] {
  background: rgb(255 255 255 / 0.95);
  border: 1.5px solid rgb(var(--color-primary-rgb) / 0.25);
  box-shadow: 0 10px 40px rgb(var(--color-primary-rgb) / 0.15),
              0 6px 20px rgb(0 0 0 / 0.1),
              0 2px 8px rgb(var(--color-secondary-rgb) / 0.1),
              0 0 0 1px rgb(255 255 255 / 0.4) inset,
              0 1px 0 rgb(255 255 255 / 0.6) inset,
              0 -1px 0 rgb(0 0 0 / 0.05) inset;
}

[data-theme="dark"] .glass-card[data-bg="light"] {
  background: rgb(var(--color-neutral-900-rgb) / 0.5);
  border-color: rgb(var(--color-neutral-400-rgb) / 0.25);
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.5),
              0 4px 16px rgb(0 0 0 / 0.4),
              0 0 0 1px rgb(var(--color-neutral-400-rgb) / 0.15) inset,
              0 1px 0 rgb(255 255 255 / 0.08) inset,
              0 -1px 0 rgb(0 0 0 / 0.3) inset,
              0 0 60px rgb(var(--color-primary-rgb) / 0.1);
}

/* Dense variant - higher opacity, more blur (for charts) */
.glass-card--dense,
.chart-glass-card {
  background: rgb(255 255 255 / 0.8);
  backdrop-filter: blur(var(--blur-lg)) saturate(200%);
  border: 1px solid rgb(255 255 255 / 0.5);
  box-shadow: 0 12px 40px rgb(var(--color-primary-rgb) / 0.12),
              0 6px 20px rgb(var(--color-secondary-rgb) / 0.1),
              0 0 0 1px rgb(255 255 255 / 0.4) inset,
              0 1px 0 rgb(255 255 255 / 0.6) inset,
              0 -1px 0 rgb(255 255 255 / 0.2) inset;
  overflow: hidden;
}

[data-theme="dark"] .glass-card--dense,
[data-theme="dark"] .chart-glass-card {
  background: rgb(var(--color-neutral-900-rgb) / 0.75);
  border-color: rgb(var(--color-neutral-400-rgb) / 0.3);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.5),
              0 6px 20px rgb(0 0 0 / 0.4),
              0 0 0 1px rgb(var(--color-neutral-400-rgb) / 0.2) inset,
              0 1px 0 rgb(255 255 255 / 0.1) inset,
              0 -1px 0 rgb(0 0 0 / 0.3) inset,
              0 0 80px rgb(var(--color-primary-rgb) / 0.12);
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(12px)) {
  .glass-card,
  .glass-card--dense,
  .chart-glass-card {
    background: rgb(255 255 255 / 0.95);
  }
  [data-theme="dark"] .glass-card,
  [data-theme="dark"] .glass-card--dense,
  [data-theme="dark"] .chart-glass-card {
    background: rgb(var(--color-neutral-900-rgb) / 0.95);
  }
}

/* ========================================
   Glass Container Utilities
   ======================================== */
/* Glass container for grouping elements */
.glass-container {
  background: rgb(255 255 255 / 0.5);
  backdrop-filter: blur(var(--blur-lg)) saturate(var(--backdrop-saturate));
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

[data-theme="dark"] .glass-container {
  background: rgb(var(--color-neutral-900-rgb) / 0.5);
  border-color: rgb(var(--color-neutral-400-rgb) / 0.2);
}

/* Glass badge/pill */
.glass-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  background: rgb(255 255 255 / 0.6);
  backdrop-filter: blur(var(--blur-sm)) saturate(var(--backdrop-saturate));
  border: 1px solid rgb(var(--color-primary-rgb) / 0.2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

[data-theme="dark"] .glass-badge {
  background: rgb(var(--color-neutral-900-rgb) / 0.6);
  border-color: rgb(var(--color-neutral-400-rgb) / 0.2);
}

/* Glass alert/notification */
.glass-alert {
  background: rgb(255 255 255 / 0.7);
  backdrop-filter: blur(var(--blur-md)) saturate(var(--backdrop-saturate));
  border: 1px solid rgb(var(--color-primary-rgb) / 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .glass-alert {
  background: rgb(var(--color-neutral-900-rgb) / 0.7);
  border-color: rgb(var(--color-neutral-400-rgb) / 0.2);
}

/* ========================================
   Shadow Utility Classes
   ======================================== */
/* Standard shadow utilities using design tokens */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* Glass shadow utilities */
.shadow-glass {
  box-shadow: var(--shadow-glass);
}

.shadow-glass-lg {
  box-shadow: var(--shadow-glass-lg);
}


/* ==========================================================================
   Animations - Optimized for Performance
   ========================================================================== */

/* Hero Animations - REMOVED
   ==========================================================================
   All hero animations have been removed to prevent interference with 
   backdrop-filter rendering. Hero elements are now visible by default
   with no animation delays or transforms that could affect backdrop blur.
   ========================================================================== */

@keyframes mobileMenuLinkFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mobileMenuLinkFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

@keyframes mobileMenuCollapse {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}

@keyframes mobileMenuBackdropFadeOut {
  from {
    opacity: 1;
    backdrop-filter: blur(var(--blur-sm));
  }
  to {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
}

@keyframes mobileActionItemFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mobileActionItemFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* Toast Notification Animations */
@keyframes slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-slide-in-right {
  animation: slide-in-right 0.3s ease-out;
}


/* ==========================================================================
   Scroll to Top Button
   ========================================================================== */
.scroll-to-top-btn {
  position: fixed;
  inset-block-end: 2rem;
  inset-inline-end: 2rem;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(255 255 255 / 0.7);
  border: 1px solid rgb(255 255 255 / 0.3);
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.15),
              0 2px 8px rgb(0 0 0 / 0.1),
              inset 0 1px 0 rgb(255 255 255 / 0.5);
  /* Use CSS variable for brand-aware colors */
  color: var(--color-secondary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s 0.3s,
              background 0.3s ease,
              box-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Kiss Mortgage - Use primary blue for scroll-to-top button (light mode only) */
[data-app="kiss-mortgage"]:not([data-theme="dark"]) .scroll-to-top-btn {
  color: var(--color-primary); /* #05668d */
}

.scroll-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s,
              background 0.3s ease,
              box-shadow 0.3s ease;
}

.scroll-to-top-btn:hover {
  background: rgb(255 255 255 / 0.85);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.2),
              0 3px 10px rgb(0 0 0 / 0.15),
              inset 0 1px 0 rgb(255 255 255 / 0.6);
  transform: translateY(-2px) scale(1.05);
}

.scroll-to-top-btn:active {
  transform: translateY(0) scale(0.95);
  background: rgb(255 255 255 / 0.9);
}

.scroll-to-top-btn:focus-visible {
  /* Use CSS variable for brand-aware colors */
  outline: 2px solid rgb(var(--color-secondary-rgb) / 0.5);
  outline-offset: 2px;
}

/* Kiss Mortgage - Blue focus outline */
[data-app="kiss-mortgage"] .scroll-to-top-btn:focus-visible {
  outline: 2px solid rgb(var(--color-primary-rgb) / 0.5);
}

[data-theme="dark"] .scroll-to-top-btn {
  background: rgb(var(--color-neutral-800-rgb) / 0.95);
  border: 1.5px solid rgb(255 255 255 / 0.25);
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.5),
              0 2px 8px rgb(0 0 0 / 0.4),
              0 0 0 1px rgb(255 255 255 / 0.1),
              inset 0 1px 0 rgb(255 255 255 / 0.2);
  /* Default to orange for Team Piero - brighter for better contrast */
  color: rgb(255 180 0);
}

/* Kiss Mortgage - Blue in dark mode (higher specificity with both attributes) */
body[data-app="kiss-mortgage"][data-theme="dark"] .scroll-to-top-btn,
[data-app="kiss-mortgage"][data-theme="dark"] .scroll-to-top-btn {
  color: rgb(96 165 250) !important; /* Brighter blue for dark mode - #60a5fa for better contrast */
  border-color: rgb(96 165 250 / 0.4);
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.5),
              0 2px 8px rgb(0 0 0 / 0.4),
              0 0 12px rgb(96 165 250 / 0.2),
              0 0 0 1px rgb(96 165 250 / 0.15),
              inset 0 1px 0 rgb(255 255 255 / 0.2);
}

[data-theme="dark"] .scroll-to-top-btn:hover {
  background: rgb(var(--color-neutral-700-rgb) / 0.95);
  border-color: rgb(255 255 255 / 0.35);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.6),
              0 3px 10px rgb(0 0 0 / 0.5),
              0 0 0 1px rgb(255 255 255 / 0.15),
              inset 0 1px 0 rgb(255 255 255 / 0.25);
}

/* Kiss Mortgage - Blue hover in dark mode */
body[data-app="kiss-mortgage"][data-theme="dark"] .scroll-to-top-btn:hover,
[data-app="kiss-mortgage"][data-theme="dark"] .scroll-to-top-btn:hover {
  border-color: rgb(96 165 250 / 0.6);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.6),
              0 3px 10px rgb(0 0 0 / 0.5),
              0 0 16px rgb(96 165 250 / 0.3),
              0 0 0 1px rgb(96 165 250 / 0.25),
              inset 0 1px 0 rgb(255 255 255 / 0.25);
}

[data-theme="dark"] .scroll-to-top-btn:active {
  background: rgb(var(--color-neutral-900-rgb) / 0.95);
}

.scroll-to-top-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  display: block;
  margin: 0;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .scroll-to-top-btn {
    inset-block-end: calc(60px + 0.75rem + 0.75rem + 0.5rem);
    inset-inline-end: calc(0.75rem + 1rem);
  }
}

@media (min-width: 768px) {
  .scroll-to-top-btn {
    inset-block-end: 2rem;
    inset-inline-end: 2rem;
  }
}

@media (max-width: 767px) and (orientation: landscape) {
  .scroll-to-top-btn {
    inset-block-end: calc(60px + 0.75rem + 0.75rem + 0.5rem);
    inset-inline-end: calc(0.75rem + 0.5rem);
  }
}

/* ==========================================================================
   Scroll Down Indicator Styles
   ========================================================================== */
.scroll-down-indicator {
  position: absolute;
  inset-block-end: 2rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  animation: scrollDownBounce 2s infinite;
  pointer-events: auto;
  visibility: visible;
  width: auto;
  height: auto;
}

/* Homepage-specific positioning - to the right of hero title */
.hero-scroll-down-indicator-wrapper {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 1.5rem;
  z-index: 10;
  display: none; /* Hidden by default, shown on desktop */
}

/* Show on desktop only where there's space to the right */
@media (min-width: 768px) {
  .hero-scroll-down-indicator-wrapper {
    display: block;
  }
  
  .hero-scroll-down-indicator-wrapper .scroll-down-indicator {
    position: static;
    transform: none;
    inset-block-end: auto;
    inset-inline-start: auto;
    animation: scrollDownBounceVertical 2s infinite;
  }
}

/* Adjust spacing for larger screens */
@media (min-width: 1024px) {
  .hero-scroll-down-indicator-wrapper {
    margin-left: 2rem;
  }
}

@media (min-width: 1280px) {
  .hero-scroll-down-indicator-wrapper {
    margin-left: 2.5rem;
  }
}

/* Vertical bounce animation for horizontal positioning */
@keyframes scrollDownBounceVertical {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

.scroll-down-indicator:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Homepage version hover - no horizontal transform */
.hero-scroll-down-indicator-wrapper .scroll-down-indicator:hover {
  transform: translateY(-4px);
}

.scroll-down-indicator:focus-visible {
  outline: 2px solid rgb(255 255 255 / 0.5);
  outline-offset: 4px;
  border-radius: var(--radius-full);
}

.scroll-down-indicator-arrow {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(255 255 255 / 0.1);
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.2),
              0 0 0 1px rgb(255 255 255 / 0.1) inset;
  transition-property: all;
  transition-duration: var(--animation-duration-base);
  transition-timing-function: var(--animation-easing);
}

.scroll-down-indicator:hover .scroll-down-indicator-arrow {
  background: rgb(255 255 255 / 0.15);
  border-color: rgb(255 255 255 / 0.3);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.3),
              0 0 0 1px rgb(255 255 255 / 0.15) inset;
  transform: scale(1.1);
}

.scroll-down-indicator-icon {
  width: 24px;
  height: 24px;
  stroke: rgb(255 255 255 / 0.9);
  stroke-width: 2.5;
  fill: none;
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.3));
}

@keyframes scrollDownBounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-down-indicator {
    animation: none;
  }
  
  .scroll-down-indicator:hover {
    transform: translateX(-50%);
  }
  
  .hero-scroll-down-indicator-wrapper .scroll-down-indicator:hover {
    transform: none;
  }
}

@media (min-width: 768px) {
  .scroll-down-indicator:not(.hero-scroll-down-indicator-wrapper .scroll-down-indicator) {
    position: fixed;
  }
}

@media (max-width: 767px) {
  .scroll-down-indicator:not(.hero-scroll-down-indicator-wrapper .scroll-down-indicator) {
    /* Chatbot button bottom is at 5.5rem (88px) from viewport bottom */
    /* To align scroll indicator's lowest animation point with chatbot bottom: */
    /* Lowest point should be at 5.5rem (88px) */
    /* Animation moves down 10px, so static position = 88px + 10px = 98px */
    /* Convert to rem: 98px = 6.125rem, or use calc: 5.5rem + 0.625rem */
    /* Set to 5rem as requested */
    inset-block-end: 5rem !important;
    z-index: 100 !important;
    position: fixed !important;
    opacity: 1 !important;
    display: flex !important;
    visibility: visible !important;
  }
  
  /* Hide indicator when mobile menu is open */
  .nav-links.mobile-menu.open ~ * .scroll-down-indicator:not(.hero-scroll-down-indicator-wrapper .scroll-down-indicator),
  body:has(.nav-links.mobile-menu.open) .scroll-down-indicator:not(.hero-scroll-down-indicator-wrapper .scroll-down-indicator) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
  
  .scroll-down-indicator-arrow {
    width: 40px !important;
    height: 40px !important;
    background: rgb(255 255 255 / 0.1) !important;
    border: 1px solid rgb(255 255 255 / 0.2) !important;
    box-shadow: 0 4px 16px rgb(0 0 0 / 0.2),
                0 0 0 1px rgb(255 255 255 / 0.1) inset !important;
  }
  
  .scroll-down-indicator-icon {
    width: 24px !important;
    height: 24px !important;
    stroke: rgb(255 255 255 / 0.9) !important;
    stroke-width: 2.5 !important;
    filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.3)) !important;
  }
}

/* ==========================================================================
   Custom Scrollbar Styles for Sidebar
   ========================================================================== */
.sidebar-scrollbar {
  /* Webkit browsers (Chrome, Safari, Edge) */
  scrollbar-width: thin;
  scrollbar-color: rgb(203 213 225 / 0.5) transparent;
}

.sidebar-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scrollbar::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.sidebar-scrollbar::-webkit-scrollbar-thumb {
  background: rgb(203 213 225 / 0.5);
  border-radius: 10px;
  -webkit-transition: background 0.2s ease;
  transition: background 0.2s ease;
}

.sidebar-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgb(148 163 184 / 0.7);
}

/* Dark mode scrollbar */
[data-theme="dark"] .sidebar-scrollbar {
  scrollbar-color: rgb(71 85 105 / 0.6) transparent;
}

[data-theme="dark"] .sidebar-scrollbar::-webkit-scrollbar-thumb {
  background: rgb(71 85 105 / 0.6);
}

[data-theme="dark"] .sidebar-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgb(100 116 139 / 0.8);
}

/* Brand-aware scrollbar colors */
[data-app="kiss-mortgage"] .sidebar-scrollbar {
  scrollbar-color: rgb(5 102 141 / 0.4) transparent;
}

[data-app="kiss-mortgage"] .sidebar-scrollbar::-webkit-scrollbar-thumb {
  background: rgb(5 102 141 / 0.4);
}

[data-app="kiss-mortgage"] .sidebar-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgb(5 102 141 / 0.6);
}

[data-app="kiss-mortgage"][data-theme="dark"] .sidebar-scrollbar {
  scrollbar-color: rgb(96 165 250 / 0.5) transparent;
}

[data-app="kiss-mortgage"][data-theme="dark"] .sidebar-scrollbar::-webkit-scrollbar-thumb {
  background: rgb(96 165 250 / 0.5);
}

[data-app="kiss-mortgage"][data-theme="dark"] .sidebar-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgb(96 165 250 / 0.7);
}


/* ==========================================================================
   Responsive Utility Classes
   ========================================================================== */

/* ==========================================================================
   Visibility Utilities
   ========================================================================== */

/* Hide on mobile, show on tablet and above */
.hide-mobile {
  display: none;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: revert;
  }
}

/* Show on mobile, hide on tablet and above */
.show-mobile {
  display: revert;
}

@media (min-width: 768px) {
  .show-mobile {
    display: none;
  }
}

/* Hide specifically on tablet sizes */
.hide-tablet {
  display: revert;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hide-tablet {
    display: none;
  }
}

/* Show only on tablet */
.show-tablet {
  display: none;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .show-tablet {
    display: revert;
  }
}

/* Hide on desktop */
.hide-desktop {
  display: revert;
}

@media (min-width: 1024px) {
  .hide-desktop {
    display: none;
  }
}

/* ==========================================================================
   Touch Target Utilities
   ========================================================================== */

/* Small touch target - 40px minimum */
.touch-target-sm {
  min-height: var(--touch-target-sm);
  min-width: var(--touch-target-sm);
}

/* Standard touch target - 44px (WCAG recommended) */
.touch-target {
  min-height: var(--touch-target);
  min-width: var(--touch-target);
}

/* Large touch target - 48px */
.touch-target-lg {
  min-height: var(--touch-target-lg);
  min-width: var(--touch-target-lg);
}

/* Touch target with padding instead of min-size (for text links) */
.touch-target-padded {
  padding: var(--space-3);
}

/* ==========================================================================
   Responsive Container Utilities
   ========================================================================== */

/* Standard responsive container with fluid padding */
.container-responsive {
  width: 100%;
  max-width: var(--container-max-width, 80rem);
  margin-inline: auto;
  padding-inline: var(--container-padding-x);
}

/* Narrow container variant */
.container-narrow {
  width: 100%;
  max-width: 60rem;
  margin-inline: auto;
  padding-inline: var(--container-padding-x);
}

/* Wide container variant */
.container-wide {
  width: 100%;
  max-width: 100rem;
  margin-inline: auto;
  padding-inline: var(--container-padding-x);
}

/* Full-width container with just padding */
.container-fluid {
  width: 100%;
  padding-inline: var(--container-padding-x);
}

/* ==========================================================================
   Responsive Spacing Utilities
   ========================================================================== */

/* Section spacing - scales with viewport */
.section-spacing {
  padding-block: calc(var(--space-12) * var(--space-multiplier));
}

.section-spacing-sm {
  padding-block: calc(var(--space-8) * var(--space-multiplier));
}

.section-spacing-lg {
  padding-block: calc(var(--space-16) * var(--space-multiplier));
}

/* ==========================================================================
   Responsive Grid Utilities
   ========================================================================== */

/* Responsive grid with auto-fit columns */
.grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--grid-gap-md);
}

/* 2-column grid on tablet+ */
.grid-responsive-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap-md);
}

@media (min-width: 768px) {
  .grid-responsive-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3-column grid on desktop */
.grid-responsive-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap-md);
}

@media (min-width: 768px) {
  .grid-responsive-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-responsive-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Text Sizing Utilities
   ========================================================================== */

/* Fluid text sizes using the responsive scale */
.text-fluid-xs { font-size: var(--fluid-xs); }
.text-fluid-sm { font-size: var(--fluid-sm); }
.text-fluid-base { font-size: var(--fluid-base); }
.text-fluid-lg { font-size: var(--fluid-lg); }
.text-fluid-xl { font-size: var(--fluid-xl); }
.text-fluid-2xl { font-size: var(--fluid-2xl); }
.text-fluid-3xl { font-size: var(--fluid-3xl); }
.text-fluid-4xl { font-size: var(--fluid-4xl); }
.text-fluid-5xl { font-size: var(--fluid-5xl); }
.text-fluid-6xl { font-size: var(--fluid-6xl); }

/* ==========================================================================
   Aspect Ratio Utilities (for responsive media)
   ========================================================================== */

.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-4-3 {
  aspect-ratio: 4 / 3;
}

/* ==========================================================================
   Transition Utility Classes
   ========================================================================== */

/* Base transition utility - apply only where needed */
.transition-base {
  transition-property: background-color, border-color, color, box-shadow, transform, opacity;
  transition-duration: var(--duration-base);
  transition-timing-function: var(--easing-base);
}

.transition-slow {
  transition-property: background-color, border-color, color, box-shadow, transform, opacity;
  transition-duration: var(--duration-slow);
  transition-timing-function: var(--easing-base);
}

/* Theme-aware transitions (for theme switching) */
.transition-theme {
  transition-property: background-color, border-color, color, box-shadow, background, background-image;
  transition-duration: var(--duration-slower);
  transition-timing-function: var(--easing-base);
}

/* Interactive element transitions */
.transition-interactive {
  transition-property: background-color, border-color, color, box-shadow, transform, opacity, fill, stroke;
  transition-duration: var(--duration-base);
  transition-timing-function: var(--easing-base);
}

/* SVG-specific transitions */
.transition-svg {
  transition-property: fill, stroke, stroke-width, opacity, color;
  transition-duration: var(--duration-base);
  transition-timing-function: var(--easing-base);
}

/* No transitions utility - for elements that should never transition */
.no-transition,
.no-transition *,
.no-transition *::before,
.no-transition *::after {
  transition: none;
  animation: none;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .transition-base,
  .transition-slow,
  .transition-theme,
  .transition-interactive,
  .transition-svg {
    transition: none;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}





/*# sourceMappingURL=e1c2ab7aec22947b.css.map*/