/* Enhanced Dialog Component - shadcn/ui inspired */

/* Dialog Overlay */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: hsl(0 0% 0% / 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease-in-out;
}

.dialog-overlay[data-state="open"] {
  opacity: 1;
  visibility: visible;
}

.dialog-overlay[data-state="open"] .dialog-content {
  transform: translate(0, 0) scale(1);
}

/* Dialog Content */
.dialog-content {
  position: relative;
  background: hsl(0 0% 100%);
  border-radius: 0.75rem;
  box-shadow: 
    0 25px 50px -12px hsl(0 0% 0% / 0.25),
    0 0 0 1px hsl(214.3 31.8% 91.4%);
  width: 100%;
  max-width: 32rem;
  max-height: 85vh;
  overflow: hidden;
  transform: translate(0, -8px) scale(0.96);
  transition: all 0.2s ease-in-out;
}

/* Dialog Header */
.dialog-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
  position: relative;
}

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  border-radius: 0.375rem;
  padding: 0.25rem;
  color: hsl(215.4 16.3% 46.9%);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.dialog-close:hover {
  background: hsl(210 40% 94%);
  color: hsl(222.2 84% 4.9%);
}

.dialog-close:focus-visible {
  outline: 2px solid hsl(221.2 83.2% 53.3%);
  outline-offset: 2px;
}

.dialog-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: hsl(222.2 84% 4.9%);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.dialog-description {
  color: hsl(215.4 16.3% 46.9%);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

/* Dialog Body */
.dialog-body {
  padding: 1rem 2rem 2rem;
}

.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dialog-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dialog-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(222.2 84% 4.9%);
}

.dialog-input {
  padding: 0.75rem 1rem;
  border: 1px solid hsl(214.3 31.8% 91.4%);
  border-radius: 0.375rem;
  font-size: 1rem;
  background: hsl(0 0% 100%);
  transition: all 0.2s ease;
}

.dialog-input:focus {
  outline: none;
  border-color: hsl(221.2 83.2% 53.3%);
  box-shadow: 0 0 0 3px hsl(221.2 83.2% 53.3% / 0.1);
}

.dialog-input:invalid {
  border-color: hsl(0 84.2% 60.2%);
}

.dialog-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1rem 0;
}

.dialog-checkbox {
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
  accent-color: hsl(221.2 83.2% 53.3%);
}

.dialog-checkbox-label {
  font-size: 0.875rem;
  color: hsl(215.4 16.3% 46.9%);
  line-height: 1.4;
  cursor: pointer;
}

.dialog-checkbox-label a {
  color: hsl(221.2 83.2% 53.3%);
  text-decoration: underline;
}

.dialog-checkbox-label a:hover {
  text-decoration: none;
}

.dialog-submit {
  background: hsl(221.2 83.2% 53.3%);
  color: hsl(0 0% 100%);
  border: 1px solid hsl(221.2 83.2% 53.3%);
  padding: 0.875rem 2rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.dialog-submit:hover {
  background: hsl(221.2 83.2% 53.3% / 0.9);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px hsl(221.2 83.2% 53.3% / 0.4);
}

.dialog-submit:active {
  transform: translateY(0);
}

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

.dialog-submit.loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 0.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Benefits List */
.dialog-benefits {
  margin: 1.5rem 0;
}

.dialog-benefits-title {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(222.2 84% 4.9%);
  margin-bottom: 0.75rem;
}

.dialog-benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dialog-benefits-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(215.4 16.3% 46.9%);
}

.dialog-benefits-icon {
  width: 1rem;
  height: 1rem;
  color: hsl(142.1 76.2% 36.3%);
  flex-shrink: 0;
}

/* Trust Indicators */
.dialog-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(214.3 31.8% 91.4%);
}

.dialog-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.dialog-trust-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(221.2 83.2% 53.3%);
  line-height: 1;
}

.dialog-trust-label {
  font-size: 0.75rem;
  color: hsl(215.4 16.3% 46.9%);
  margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 640px) {
  .dialog-overlay {
    padding: 0.5rem;
  }
  
  .dialog-content {
    max-width: 100%;
    margin: 0.5rem;
  }
  
  .dialog-header {
    padding: 1.5rem 1.5rem 1rem;
  }
  
  .dialog-body {
    padding: 1rem 1.5rem 1.5rem;
  }
  
  .dialog-title {
    font-size: 1.5rem;
  }
  
  .dialog-trust {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .dialog-trust-item {
    flex-direction: row;
    gap: 0.5rem;
  }
}

/* Animation Variants */
.dialog-slide-up {
  transform: translateY(100px) scale(0.96);
}

.dialog-slide-up[data-state="open"] .dialog-content {
  transform: translateY(0) scale(1);
}

.dialog-zoom-in {
  transform: scale(0.8);
}

.dialog-zoom-in[data-state="open"] .dialog-content {
  transform: scale(1);
}

/* Focus Management */
.dialog-content:focus {
  outline: none;
}

.dialog-trap-focus {
  outline: none;
}

/* Success State */
.dialog-success {
  text-align: center;
  padding: 2rem;
}

.dialog-success-icon {
  width: 4rem;
  height: 4rem;
  background: hsl(142.1 76.2% 36.3%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}

.dialog-success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(222.2 84% 4.9%);
  margin-bottom: 0.5rem;
}

.dialog-success-description {
  color: hsl(215.4 16.3% 46.9%);
  margin-bottom: 1.5rem;
}

.dialog-success-cta {
  background: hsl(142.1 76.2% 36.3%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.dialog-success-cta:hover {
  background: hsl(142.1 76.2% 36.3% / 0.9);
  transform: translateY(-1px);
}