/* Homepage Animations & Visual Enhancements */

@property --pro-border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* Glassmorphism Cards */
.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Pricing Card Enhancements */
.price-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.price-card--accent {
  position: relative;
  padding: 2px;
  border: none;
  background: conic-gradient(
    from var(--pro-border-angle),
    #4fcf70,
    #fad648,
    #a767e5,
    #12bcfe,
    #44ce7b,
    #4fcf70
  );
  border-radius: 12px;
  animation: upgrade-border-spin 2.2s linear infinite paused;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  overflow: visible;
}

.price-card--accent div {
  border-radius: 10px;
}

.price-card--accent:hover,
.price-card--accent:focus-within {
  animation-play-state: running;
}

.price-card--accent::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 14px;
  background: radial-gradient(65% 65% at 50% 50%, rgba(167, 103, 229, 0.26), rgba(18, 188, 254, 0));
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.2s ease;
  z-index: 0;
  pointer-events: none;
}

.price-card--accent:hover::after,
.price-card--accent:focus-within::after {
  opacity: 0.35;
}

.price-card--accent > * {
  position: relative;
  z-index: 1;
  background: var(--surface, #ffffff);
  border-radius: 14px;
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-card .primary,
.price-card .ghost {
  width: 100%;
}

@keyframes upgrade-border-spin {
  to {
    --pro-border-angle: 1turn;
  }
}

/* CTA Button Enhancements */
.cta-primary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.cta-primary:hover::after {
  width: 300px;
  height: 300px;
}

.cta-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* Interactive Hero layout for demo */
.hero {
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.hero__content {
  width: 100%;
  padding-left: 2%;
  padding-top: 2%;
  max-width: 650px;
}

.hero-demo {
  width: 100%;
  max-width: 100%;
  margin-top: 32px;
  position: relative;
  background: var(--bg-secondary, #16213e);
  border-radius: 12px;
  padding: 0;
  font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.6;
}

.hero-demo__editor {
  min-height: 120px;
  background: transparent;
  border: none;
  color: var(--text-primary, #eaeaea);
  resize: none;
  outline: none;
  width: 100%;
}

.hero-demo__preview {
  border-left: 2px solid var(--border-color, rgba(255,255,255,0.1));
  padding-left: 16px;
  color: var(--text-secondary, #a0a0a0);
}

/* Typing Cursor Animation */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent-primary, #667eea);
  margin-left: 2px;
  animation: blink 1s infinite;
  vertical-align: text-bottom;
}

/* Floating UI Elements */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.float-element {
  animation: float 4s ease-in-out infinite;
}

.float-element--delayed {
  animation-delay: -2s;
}

/* Icon Pulse on Hover */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
  50% { box-shadow: 0 0 20px 5px rgba(102, 126, 234, 0.2); }
}

.icon-pulse:hover {
  animation: pulse-glow 1.5s ease infinite;
}

/* Benefit Accordion Enhancements */
.benefit-item summary {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.benefit-item summary:hover {
  color: var(--accent-primary, #667eea);
  padding-left: 16px;
}

.benefit-item summary::marker {
  transition: transform 0.2s ease;
}

.benefit-item[open] summary::marker {
  transform: rotate(90deg);
}

/* Progress Bar for Progressive Signup */
.progress-indicator {
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Stagger Animation for Lists */
.stagger-list > * {
  opacity: 0;
  transform: translateY(10px);
}

.stagger-list.active > * {
  animation: stagger-in 0.4s ease forwards;
}

.stagger-list.active > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-list.active > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-list.active > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-list.active > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-list.active > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-list.active > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes stagger-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Exit Intent Modal */
.exit-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exit-modal.active {
  opacity: 1;
  visibility: visible;
}


.exit-modal__content {
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.exit-modal__content--brevo {
  position: relative;
  width: min(600px, calc(100% - 32px));
  border-radius: 32px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 35px 90px rgba(15, 23, 42, 0.12);
  color: #0f172a;
  padding: clamp(32px, 5vw, 52px);
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}

.exit-modal__brevo {
  width: 100%;
}

.exit-modal__content--brevo .sib-form {
  width: 100%;
  background: transparent !important;
}

.exit-modal__content--brevo #sib-form-container {
  width: 100%;
}

.exit-modal__content--brevo #sib-container {
  max-width: 100% !important;
  border: 0 !important;
  background: transparent !important;
}

.exit-modal__content--brevo #sib-form {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
}

.exit-modal__content--brevo .sib-form-block {
  text-align: left !important;
}

.exit-modal__content--brevo .sib-image-form-block {
  text-align: center !important;
}

.exit-modal__content--brevo .entry__field,
.exit-modal__content--brevo .entry__label,
.exit-modal__content--brevo .entry__specification,
.exit-modal__content--brevo .entry__error {
  width: 100%;
}

.exit-modal__content--brevo .entry__field {
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 16px !important;
  padding: 0 !important;
  overflow: hidden;
  background: #fff;
}

.exit-modal__content--brevo .input {
  width: 100%;
  border-radius: 16px !important;
  border: 0 !important;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
}

.exit-modal__content--brevo .input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

.exit-modal__content--brevo .entry__field:focus-within {
  border-color: var(--accent, #6366f1) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.24);
}

.exit-modal__content--brevo .sib-form-block__button {
  min-width: 180px;
  border-radius: 18px !important;
  padding: 15px 18px !important;
  font-size: 15px !important;
  box-shadow: 0 18px 32px rgba(99, 102, 241, 0.25);
  text-align: center !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.exit-modal__content--brevo .sib-form-message-panel {
  width: 100%;
  max-width: 100% !important;
  border-radius: 14px !important;
}

.exit-modal__content--brevo #sib-captcha {
  display: flex;
  justify-content: center;
}

.exit-modal__logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 12px;
}

.exit-modal__content--brevo h3 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 40px);
}

.exit-modal__content--brevo p {
  margin: 0;
  color: #4b5563;
  font-size: 16px;
}

.exit-modal__banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  width: 100%;
}

.exit-modal__banner svg {
  width: 18px;
  height: 18px;
}

.exit-modal__banner--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.exit-modal__banner--success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.exit-modal__label {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  align-self: stretch;
  text-align: left;
}

.exit-modal__content--brevo form {
  width: 100%;
  max-width: 390px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.exit-modal__field {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
}

.exit-modal__field:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.24);
}

.exit-modal__hint {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  align-self: stretch;
  text-align: left;
}

.exit-modal__submit {
  width: auto;
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 18px;
  border: none;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 18px 32px rgba(99, 102, 241, 0.25);
}

.exit-modal__success-view {
  width: 100%;
  max-width: 420px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.exit-modal__confetti-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20000;
  overflow: hidden;
}

.exit-modal__confetti-piece {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 14px;
  opacity: 0.95;
  border-radius: 3px;
  animation: exit-confetti-drop 1.2s ease-out forwards;
}

@keyframes exit-confetti-drop {
  0% {
    transform: translateY(-12px) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(120vh) rotate(540deg);
    opacity: 0;
  }
}

.exit-modal__submit svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.exit-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.9);
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.exit-modal__close span {
  position: absolute;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.exit-modal__close span:first-child {
  transform: rotate(45deg);
}

.exit-modal__close span:last-child {
  transform: rotate(-45deg);
}

.exit-modal.active .exit-modal__content {
  transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .glass-card:hover {
    transform: translateY(-2px);
  }

    .exit-modal__close {
    top: 16px;
    right: 16px;
  }
}

@media (max-width: 520px) {
  .exit-modal__content--brevo {
    padding: 22px 20px;
  }
}
