/**
 * DEMO POPUP - Ultra Premium Design
 * Animated border, glassmorphism, smooth transitions
 */

.demo-popup {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              visibility 600ms;
}

.demo-popup.is-visible {
  opacity: 1;
  visibility: visible;
}

.demo-popup.is-hiding {
  opacity: 0;
  transition: opacity 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Overlay with clean background */
.demo-popup__overlay {
  position: absolute;
  inset: 0;
  background: #FBF7F1;
  animation: demo-overlay-in 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes demo-overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Card container - fullscreen clean */
.demo-popup__card {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  background: #FBF7F1;
  border-radius: 0;
  box-shadow: none;
  transform: scale(1) translateY(0);
  opacity: 0;
  animation: demo-card-in 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 100ms forwards;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes demo-card-in {
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.demo-popup.is-success .demo-popup__card {
  animation: demo-card-success 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes demo-card-success {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(0.95); opacity: 0; }
}

/* Shake animation for wrong password */
.demo-popup__card.shake {
  animation: demo-shake 500ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes demo-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* Animated border gradient - subtle */
.demo-popup__border-animation {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  max-width: 90%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    #6BA6A1,
    #9E85B8,
    #6BA6A1,
    transparent
  );
  background-size: 200% 100%;
  animation: demo-border-flow 6s ease infinite;
  z-index: 10;
  opacity: 0.4;
}

@keyframes demo-border-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.demo-popup.is-visible .demo-popup__border-animation {
  animation: demo-border-flow 6s ease infinite;
}

/* Content */
.demo-popup__content {
  padding: 60px 48px;
  position: relative;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

/* Icon */
.demo-popup__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6BA6A1, #9E85B8);
  border-radius: 50%;
  color: white;
  box-shadow: 
    0 20px 40px -12px rgba(107, 166, 161, 0.4),
    0 0 0 8px rgba(107, 166, 161, 0.1);
  animation: demo-icon-float 3s ease-in-out infinite;
}

@keyframes demo-icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Close button */
.demo-popup__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(42, 47, 58, 0.05);
  border: none;
  border-radius: 50%;
  color: #5A5F6A;
  cursor: pointer;
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

.demo-popup__close:hover {
  background: rgba(42, 47, 58, 0.1);
  color: #2A2F3A;
  transform: rotate(90deg) scale(1.1);
}

.demo-popup__close:active {
  transform: rotate(90deg) scale(0.95);
}

/* Title */
.demo-popup__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(32px, 5vw, 42px);
  line-height: 1.1;
  text-align: center;
  color: #2A2F3A;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.demo-popup__title em {
  font-style: italic;
  color: #9E85B8;
  font-weight: 400;
}

.demo-popup__subtitle {
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
  color: #6BA6A1;
  margin-bottom: 32px;
}

/* Message */
.demo-popup__message {
  margin-bottom: 32px;
}

.demo-popup__message > p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-style: italic;
  line-height: 1.6;
  color: #5A5F6A;
  text-align: center;
  margin-bottom: 24px;
}

.demo-popup__message strong {
  color: #2A2F3A;
  font-weight: 500;
}

/* Highlights - clean background */
.demo-popup__highlights {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  padding: 24px;
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(107, 166, 161, 0.15);
}

.demo-popup__highlight {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #2A2F3A;
  line-height: 1.5;
}

.demo-popup__highlight-icon {
  flex-shrink: 0;
  color: #6BA6A1;
  font-size: 16px;
}

/* Future features - clean background */
.demo-popup__future {
  padding: 24px;
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(158, 133, 184, 0.15);
}

.demo-popup__future-title {
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #9E85B8;
  margin-bottom: 16px;
}

.demo-popup__future ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-popup__future li {
  font-size: 14px;
  line-height: 1.6;
  color: #5A5F6A;
  padding-left: 24px;
  position: relative;
}

.demo-popup__future li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #9E85B8;
  font-weight: 600;
}

.demo-popup__future li strong {
  color: #2A2F3A;
  font-weight: 500;
}

/* Form */
.demo-popup__form {
  margin-bottom: 24px;
}

.demo-popup__input-group {
  margin-bottom: 24px;
}

.demo-popup__input-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6BA6A1;
  margin-bottom: 10px;
}

.demo-popup__input-group input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  font-family: 'Jost', sans-serif;
  color: #2A2F3A;
  background: white;
  border: 2px solid rgba(107, 166, 161, 0.2);
  border-radius: 12px;
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.demo-popup__input-group input:focus {
  border-color: #6BA6A1;
  box-shadow: 
    0 0 0 4px rgba(107, 166, 161, 0.1),
    0 8px 24px -8px rgba(107, 166, 161, 0.3);
  transform: translateY(-2px);
}

.demo-popup__input-hint {
  display: block;
  font-size: 12px;
  font-style: italic;
  color: #9E85B8;
  margin-top: 8px;
  opacity: 0.7;
}

/* Submit button */
.demo-popup__submit {
  width: 100%;
  padding: 18px 32px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: white;
  background: linear-gradient(135deg, #6BA6A1, #9E85B8);
  background-size: 200% 200%;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 
    0 12px 32px -8px rgba(107, 166, 161, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transition: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.demo-popup__submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 400ms;
}

.demo-popup__submit:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 20px 48px -12px rgba(107, 166, 161, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  background-position: 100% 50%;
}

.demo-popup__submit:hover::before {
  opacity: 1;
}

.demo-popup__submit:active {
  transform: translateY(-1px);
}

.demo-popup__submit svg {
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.demo-popup__submit:hover svg {
  transform: translateX(4px);
}

/* Error message */
.demo-popup__error {
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 13px;
  color: #C44569;
  background: rgba(196, 69, 105, 0.08);
  border: 1px solid rgba(196, 69, 105, 0.2);
  border-radius: 8px;
  text-align: center;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.demo-popup__error:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.demo-popup__footer {
  font-size: 11px;
  font-style: italic;
  color: #9E85B8;
  text-align: center;
  opacity: 0.6;
  padding-top: 24px;
  border-top: 1px solid rgba(42, 47, 58, 0.08);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .demo-popup {
    padding: 0;
  }

  .demo-popup__card {
    border-radius: 0;
  }

  .demo-popup__border-animation {
    width: 100%;
    max-width: 100%;
  }

  .demo-popup__content {
    padding: 48px 24px;
  }

  .demo-popup__icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
  }

  .demo-popup__title {
    font-size: 28px;
  }

  .demo-popup__subtitle {
    font-size: 10px;
    margin-bottom: 24px;
  }

  .demo-popup__message > p {
    font-size: 16px;
  }

  .demo-popup__highlights,
  .demo-popup__future {
    padding: 20px;
  }

  .demo-popup__highlight {
    font-size: 14px;
  }

  .demo-popup__future li {
    font-size: 13px;
  }

  .demo-popup__submit {
    padding: 16px 28px;
    font-size: 13px;
  }
}

/* Smooth scrollbar for card */
.demo-popup__card::-webkit-scrollbar {
  width: 8px;
}

.demo-popup__card::-webkit-scrollbar-track {
  background: rgba(42, 47, 58, 0.05);
  border-radius: 4px;
}

.demo-popup__card::-webkit-scrollbar-thumb {
  background: rgba(107, 166, 161, 0.3);
  border-radius: 4px;
  transition: background 300ms;
}

.demo-popup__card::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 166, 161, 0.5);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .demo-popup,
  .demo-popup__card,
  .demo-popup__overlay,
  .demo-popup__border-animation,
  .demo-popup__icon,
  .demo-popup__submit,
  .demo-popup__input-group input {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
