/* ============================================
   PLAN PURCHASE MODAL - REDESIGNED
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.modal-container {
  background: #1a1a2e;
  border-radius: 24px;
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Custom Scrollbar for Dark Theme */
.modal-container::-webkit-scrollbar {
  width: 8px;
}

.modal-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-header {
  /* padding: 40px 40px 30px; */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pro-badge {
  background: linear-gradient(135deg, #ffb800 0%, #ff8a00 100%);
  color: #1a1a2e;
  padding: 6px 16px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(255, 184, 0, 0.3);
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

.modal-body {
  padding: 0;
}

/* Modal Subtitle */
.modal-subtitle {
  text-align: center;
  color: #a0a0c0;
  font-size: 16px;
  margin-bottom: 35px;
  font-style: italic;
}

/* Payment Methods Grid */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.payment-method-option {
  cursor: pointer;
}

.payment-method-option input[type="radio"] {
  display: none;
}

.payment-card {
  background: linear-gradient(135deg, #252540 0%, #2d2d50 100%);
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  /* min-height: 240px; */
  display: flex;
  flex-direction: column;
}

.payment-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s;
}

.payment-method-option input[type="radio"]:checked + .payment-card {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4);
  transform: translateY(-4px);
}

.payment-method-option input[type="radio"]:checked + .payment-card::before {
  opacity: 1;
}

.payment-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.payment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.payment-flag {
  font-size: 32px;
  line-height: 1;
}

.payment-title {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
}

.payment-subtitle {
  font-size: 14px;
  color: #a0a0c0;
  margin-top: 4px;
  font-style: italic;
}

.payment-price {
  font-size: 36px;
  font-weight: 800;
  color: #ffffff;
  margin: 20px 0;
  letter-spacing: -1px;
}

.payment-price .period {
  font-size: 16px;
  font-weight: 500;
  color: #a0a0c0;
  margin-left: 4px;
}

.payment-logos {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.payment-logos img {
  height: 28px;
  object-fit: contain;
  opacity: 0.9;
}

.payment-method-option
  input[type="radio"]:checked
  + .payment-card
  .payment-logos
  img {
  opacity: 1;
  filter: brightness(1.1);
}

/* User Info Form (collapsed by default, shown after selecting payment) */
.user-info-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  display: none;
  animation: expandDown 0.3s ease-out;
}

.user-info-section.show {
  display: block;
}

.user-info-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #a0a0c0;
  margin-bottom: 8px;
}

.form-group .required {
  color: #ff6b6b;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-size: 15px;
  color: #ffffff;
  transition: all 0.3s;
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Phone Input Group */
.phone-input-group {
  display: flex;
  gap: 12px;
}

.country-code-select {
  flex: 0 0 130px;
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-size: 15px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s;
}

.country-code-select:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.phone-number-input {
  flex: 1;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: #7080a0;
  margin-top: 6px;
  font-style: italic;
}

/* Form Note */
.form-note {
  background: rgba(255, 184, 0, 0.1);
  border-left: 4px solid #ffb800;
  padding: 16px 20px;
  border-radius: 12px;
  margin: 25px 0 0;
  text-align: center;
}

.form-note p {
  margin: 0;
  color: #ffd966;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 500;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 25px 40px;
  margin: 0 -40px -40px;
  background: rgba(0, 0, 0, 0.2);
}

.btn {
  padding: 16px 32px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.btn-purchase {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  border: 2px solid transparent;
}

.btn-purchase:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.5);
}

.btn-purchase:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner {
  animation: rotate 1s linear infinite;
  width: 22px;
  height: 22px;
}

.spinner circle {
  stroke-dasharray: 125;
  stroke-dashoffset: 50;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dashoffset: 125;
  }
  50% {
    stroke-dashoffset: 50;
  }
  100% {
    stroke-dashoffset: 125;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes expandDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .modal-container {
    max-height: 95vh;
    border-radius: 24px 24px 0 0;
    margin-top: auto;
  }

  .modal-header {
    padding: 30px 25px 20px;
  }

  .modal-header h2 {
    font-size: 24px;
  }

  .pro-badge {
    font-size: 18px;
    padding: 5px 14px;
  }

  .modal-body {
    padding: 25px;
  }

  .payment-methods {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .payment-card {
    min-height: auto;
    padding: 25px;
  }

  .payment-price {
    font-size: 30px;
  }

  .phone-input-group {
    flex-direction: column;
  }

  .country-code-select {
    flex: none;
    width: 100%;
  }

  .modal-footer {
    flex-direction: column-reverse;
    padding: 20px 25px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}
