/* Modal Component */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__content {
  background: linear-gradient(135deg, #181824 60%, #2d1e4f 100%);
  border: 1.5px solid #3a2e5c;
  border-radius: 2.2rem;
  box-shadow: 0 12px 40px 0 rgba(60, 30, 120, 0.25), 0 1.5px 8px 0 rgba(0,0,0,0.10);
  padding: 2.7rem 2.2rem;
  max-width: 440px;
  width: 97%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
  animation: modalFadeIn 0.7s cubic-bezier(.4,1.4,.6,1);
  transform: scale(1) translateY(0);
  transition: box-shadow 0.3s, border 0.3s;
}

@keyframes modalFadeIn {
  0% { opacity: 0; transform: scale(0.92) translateY(40px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal.is-open .modal__content {
  transform: scale(1) translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-subtle);
}

.modal__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.modal__close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.modal__body {
  margin-bottom: var(--spacing-lg);
}

.modal__footer {
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-subtle);
}

/* Payment Modal Specific Styles */
.payment-modal__card-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1rem;
  background: rgba(60,60,90,0.85);
  border: 1.5px solid var(--accent-blue);
  border-radius: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 12px 0 rgba(80,60,120,0.10);
}

.payment-modal__card-image {
  width: 60px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.payment-modal__card-details h3 {
  margin: 0 0 var(--spacing-xs) 0;
  color: var(--text-primary);
}

.payment-modal__card-price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-blue);
}

.payment-modal__usdc-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: rgba(79, 70, 229, 0.1);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
}

.payment-modal__usdc-icon {
  width: 24px;
  height: 24px;
}

.payment-modal__merchant-address {
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.875rem;
  word-break: break-all;
  margin-bottom: var(--spacing-lg);
}

.payment-modal__step {
  margin-bottom: var(--spacing-xl);
}

.payment-modal__step-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 1.25rem;
  color: #fff;
  text-shadow: 0 2px 8px rgba(80,60,120,0.10);
  animation: fadeInUp 0.7s cubic-bezier(.4,1.4,.6,1);
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.payment-modal__step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent-blue);
  color: white;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 600;
}

.payment-modal__form-group {
  margin-bottom: var(--spacing-md);
}

.payment-modal__form-group label {
  margin-bottom: var(--spacing-xs);
}

.payment-modal__form-group input {
  margin-bottom: var(--spacing-xs);
  width: 100%;
  padding: 0.85rem 1.1rem;
  border-radius: 1.1rem;
  border: 1.5px solid #3a2e5c;
  background: linear-gradient(90deg, #23233a 80%, #2d1e4f 100%);
  color: #f3f3fa;
  font-size: 1.08rem;
  font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
  box-shadow: 0 1.5px 8px 0 rgba(60, 30, 120, 0.07);
}
.payment-modal__form-group input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px #7c3aed33;

/* Красивая анимация для кнопки оплаты */
.payment-modal__actions .btn--primary {
  background: linear-gradient(90deg, #7c3aed 0%, #6366f1 100%);
  color: #fff;
  border: none;
  border-radius: 1.5rem;
  padding: 1.1rem 2.2rem;
  font-size: 1.13rem;
  font-weight: 800;
  font-family: 'Montserrat', 'Segoe UI', 'Arial', sans-serif;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 4px 18px 0 #7c3aed33;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 8px rgba(80,60,120,0.10);
  animation: btnPopIn 0.7s cubic-bezier(.4,1.4,.6,1);
}
.payment-modal__actions .btn--primary:hover {
  background: linear-gradient(90deg, #6366f1 0%, #7c3aed 100%);
  box-shadow: 0 8px 32px 0 #7c3aed44;
  transform: translateY(-2px) scale(1.04);
}
@keyframes btnPopIn {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}
.payment-modal__success {
  text-align: center;
  padding: var(--spacing-xl);
}

.payment-modal__success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--spacing-lg);
  color: var(--success);
}

.payment-modal__success h3 {
  color: var(--success);
  margin-bottom: var(--spacing-md);
}

/* Loading States */
.payment-modal__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-lg);
  color: var(--text-secondary);
}

.payment-modal__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Error States */
.payment-modal__error {
  padding: var(--spacing-md);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  color: var(--error);
  margin-bottom: var(--spacing-md);
}

/* Responsive Design */
@media (max-width: 600px) {
  .modal__content {
    padding: 1.2rem 0.5rem;
    width: 99%;
    border-radius: 1.1rem;
  }
  .payment-modal__card-info {
    flex-direction: column;
    text-align: center;
    padding: 1.1rem 0.5rem;
  }
}