/* ============================================================
   TRIAL USER MODAL & FORM STYLING
   ============================================================ */

/* ============================================================
   MODAL CONTAINER & OVERLAY
   ============================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 8, 26, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 16px;
}

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

/* ============================================================
   MODAL FRAME
   ============================================================ */

.modal--frame {
  width: 100%;
  max-width: 560px;
  height: 90vh;
  max-height: 90vh;
  border-radius: 12px;
  background: var(--neutral-0);
  box-shadow: 0 20px 60px rgba(3, 8, 26, 0.15),
              0 0 1px rgba(3, 8, 26, 0.05);
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================================
   MODAL HEADER
   ============================================================ */

.modal--frame .modal-header {
  padding: 28px 32px;
  border-bottom: 1px solid var(--neutral-150);
  badar(--blue-50) 0%, var(--neutral-0) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  border-radius: 12px 12px 0 0;
}

.modal--frame .modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy-950);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.3;
  flex: 1;
}

.modal--frame .modal-close {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--neutral-500);
  transition: color 0.2s ease, background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}

.modal--frame .modal-close:hover {
  color: var(--navy-950);
  background: var(--neutral-100);
}

.modal--frame .modal-close:active {
  background: var(--neutral-200);
}

/* ============================================================
   MODAL BODY & IFRAME
   ============================================================ */

.modal--frame .modal-body {
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  border-radius: 0 0 12px 12px;
}

.modal--frame .modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal--frame .modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal--frame .modal-body::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 3px;
}

.modal--frame .modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

.modal--frame .modal-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  min-height: 0;
  border-radius: 0 0 12px 12px;
}

#requestTrialFrame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--neutral-0);
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */

.modal-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
  padding: 32px;
  background: var(--neutral-0);
}

.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(26, 92, 255, 0.2);
  border-top: 3px solid var(--blue-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.spinner-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-600);
  margin: 0;
  letter-spacing: 0.3px;
}

/* ============================================================
   FORM STYLES (Applied to embedded iframe content)
   ============================================================ */

.trail-user-form-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.trial-user-form-header {
  padding: 28px 32px 0;
}

.trial-user-form-header h5 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy-950);
  margin: 0 0 12px 0;
  letter-spacing: -0.01em;
}

.trial-user-form-header p {
  font-size: 14px;
  color: var(--neutral-600);
  line-height: 1.6;
  margin: 0 0 28px 0;
}

.trial-user-form-content {
  padding: 0 32px 32px;
  flex: 1;
  overflow-y: auto;
}

.trial-user-form-content::-webkit-scrollbar {
  width: 6px;
}

.trial-user-form-content::-webkit-scrollbar-track {
  background: transparent;
}

.trial-user-form-content::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 3px;
}

.trial-user-form-content::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 640px) {
  .modal--frame {
    max-width: calc(100vw - 32px);
    height: 90vh;
    max-height: 90vh;
    border-radius: 16px;
  }

  .modal--frame .modal-header {
    padding: 24px 24px;
  }

  .modal--frame .modal-title {
    font-size: 1.25rem;
  }

  .modal-overlay {
    padding: 16px;
  }

  .trial-user-form-header {
    padding: 24px 24px 0;
  }

  .trial-user-form-content {
    padding: 0 24px 24px;
  }
}

@media (max-width: 480px) {
  .modal--frame {
    max-width: 100%;
    height: 95vh;
    max-height: 95vh;
    border-radius: 20px 20px 0 0;
  }

  .modal--frame .modal-header {
    padding: 20px 20px;
  }

  .modal--frame .modal-title {
    font-size: 1.125rem;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .trial-user-form-header {
    padding: 20px 20px 0;
  }

  .trial-user-form-content {
    padding: 0 20px 20px;
  }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.modal--frame .modal-close:focus {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.modal-overlay:focus-visible {
  outline: none;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .modal--frame {
    animation: none;
  }

  .modal-overlay {
    transition: none;
  }

  .modal--frame .modal-close,
  .modal--frame .modal-header {
    transition: none;
  }
}

/* ============================================================
   DARK MODE SUPPORT (if needed in future)
   ============================================================ */

@media (prefers-color-scheme: dark) {
  .modal-overlay {
    background: rgba(0, 0, 0, 0.6);
  }

  .modal--frame {
    background: var(--neutral-950);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
                0 0 1px rgba(255, 255, 255, 0.1);
  }

  .modal--frame .modal-header {
    background: linear-gradient(135deg, rgba(26, 92, 255, 0.1) 0%, rgba(26, 92, 255, 0.05) 100%);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .modal--frame .modal-title {
    color: var(--neutral-0);
  }

  .modal--frame .modal-close {
    color: var(--neutral-500);
  }

  .modal--frame .modal-close:hover {
    color: var(--neutral-0);
    background: rgba(255, 255, 255, 0.1);
  }

  .modal--frame .modal-body {
    background: var(--neutral-950);
  }
}
