:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --accent: #a855f7;
  --bg-dark: #0a0a0f;
  --bg-card: #1a1a1f;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --border: rgba(255, 255, 255, 0.1);
  --success: #10b981;
}

.checkout-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
  position: relative;
}

.back-to-home {
  position: absolute;
  top: 30px;
  left: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(26, 26, 31, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  z-index: 10;
}

.back-to-home:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: var(--primary);
  color: var(--text-primary);
  transform: translateX(-3px);
}

.back-to-home svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.back-to-home:hover svg {
  transform: translateX(-3px);
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1200px;
  width: 100%;
  background: rgba(26, 26, 31, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: visible;
  clip-path: inset(0 round 24px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.6s ease;
}

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

.checkout-plan {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(168, 85, 247, 0.1));
  padding: 60px 50px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: sticky;
  top: 0;
  align-self: flex-start;
  /* z-index ensures gradient background stays above parent dark background when sticky */
  z-index: 10;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 20px;
  width: fit-content;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.plan-badge svg {
  width: 16px;
  height: 16px;
}

.plan-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.plans-selection {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.plan-option {
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.plan-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-option label {
  display: block;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.plan-option:hover label {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(102, 126, 234, 0.5);
}

.plan-option input[type="radio"]:checked + label {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(168, 85, 247, 0.1));
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.plan-option-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.plan-option-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 4px 0;
  transition: color 0.3s ease;
}

.plan-option input[type="radio"]:checked + label h3 {
  color: #ffffff !important;
}

.plan-option-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.plan-option-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}

.plan-option-price .amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.plan-option-price .period {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.plan-option-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-badge {
  padding: 6px 12px;
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.feature-badge.unlimited {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.starting-price {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
}

.price-amount {
  font-size: 56px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.price-period {
  font-size: 20px;
  color: var(--text-secondary);
  font-weight: 500;
}

.plan-description {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
}

.plan-features h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.plan-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 15px;
}

.plan-features li svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--success);
}

.plan-guarantee {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding: 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
}

.plan-guarantee svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.checkout-form {
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.checkout-form h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.form-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group select,
.form-group .country-select {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.form-group select:focus,
.form-group .country-select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group select option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 10px;
}

.paypal-container {
  margin: 32px 0;
}

.paypal-placeholder {
  margin: 24px 0;
  padding: 40px 30px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(168, 85, 247, 0.05));
  border: 2px dashed rgba(102, 126, 234, 0.3);
  border-radius: 16px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.paypal-placeholder svg {
  margin: 0 auto 20px;
  color: var(--primary);
  opacity: 0.7;
}

.paypal-placeholder h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.paypal-placeholder p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.6;
}

.credentials-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.credentials-info code {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.terms-text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-top: 24px;
}

.terms-text a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.terms-text a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.auth-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.auth-footer p {
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.auth-footer a:hover {
  color: var(--accent);
}

.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 14px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

@media (max-width: 968px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .checkout-plan {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 40px 30px;
    position: static;
  }

  .checkout-form {
    padding: 40px 30px;
  }

  .plan-title {
    font-size: 28px;
  }

  .price-amount {
    font-size: 48px;
  }
}

@media (max-width: 768px) {
  .checkout-container {
    padding: 20px 16px;
  }
  
  .back-to-home {
    top: 16px;
    left: 16px;
    padding: 8px 14px;
    font-size: 13px;
  }
  
  .back-to-home svg {
    width: 16px;
    height: 16px;
  }
  
  .checkout-grid {
    border-radius: 16px;
  }
  
  .plan-features h3 {
    font-size: 16px;
  }
  
  .plan-features li {
    font-size: 14px;
  }
}

.user-info-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-info-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
  overflow: hidden;
}

.user-info-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info-details h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.user-info-details p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px 0;
}

.user-info-details p strong {
  color: var(--text-primary);
  font-weight: 500;
}

@media (max-width: 480px) {
  .checkout-container {
    padding: 20px 12px;
  }

  .checkout-grid {
    border-radius: 20px;
  }

  .checkout-plan,
  .checkout-form {
    padding: 32px 24px;
  }

  .plan-title {
    font-size: 24px;
  }

  .price-amount {
    font-size: 40px;
  }

  .checkout-form h2 {
    font-size: 24px;
  }
  
  .plan-features li {
    font-size: 13px;
  }
  
  .user-info-card {
    flex-direction: column;
    text-align: center;
  }
}
