/* ===================================
   PIMPAM5G CHECKOUT STYLES
   Mobile-first, conversion-optimized
   ================================== */

/* Checkout Page Layout */
.checkout-page {
  background-color: #f8f9fa;
  min-height: 100vh;
}

.checkout-main {
  min-height: calc(100vh - 200px);
}

/* Progress Indicator */
.checkout-progress {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.step-label {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #666;
  font-weight: 500;
}

.progress-step.active .step-number {
  background: var(--color-primary, #E91E63);
  color: white;
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.progress-step.active .step-label {
  color: var(--color-primary, #E91E63);
  font-weight: 700;
}

.progress-step.completed .step-number {
  background: #4CAF50;
  color: white;
}

.progress-step.completed .step-number::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.progress-line {
  flex: 1;
  height: 2px;
  background: #e0e0e0;
  margin: 0 0.5rem;
  position: relative;
  top: -10px;
}

.progress-bar-container {
  max-width: 600px;
  margin: 0 auto;
}

/* Mobile progress adjustments */
@media (max-width: 767px) {
  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
  }

  .progress-line {
    margin: 0 0.25rem;
  }
}

/* Checkout Steps */
.checkout-step {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.checkout-step-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #333;
  margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
  .checkout-step-title {
    font-size: 1.5rem;
  }
}

/* STEP 1: Plan Selection */
.plan-features ul {
  margin: 0;
  padding: 0;
}

.plan-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.plan-option {
  position: relative;
}

.plan-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border: 3px solid #e0e0e0;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  margin: 0;
}

.plan-card:hover {
  border-color: var(--color-primary, #E91E63);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.15);
  transform: translateY(-2px);
}

.plan-radio:checked + .plan-card {
  border-color: var(--color-primary, #E91E63);
  background: #fff5f8;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.2);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 10px;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  font-weight: 700;
}

.plan-icon {
  flex: 0 0 auto;
}

.plan-details {
  flex: 1;
}

.plan-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #333;
}

.plan-price {
  margin-bottom: 0.25rem;
}

.price-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary, #E91E63);
}

.price-period {
  font-size: 1rem;
  color: #666;
  font-weight: 500;
}

.plan-savings {
  margin-bottom: 0.25rem;
}

.plan-note {
  margin: 0;
}

.plan-check {
  flex: 0 0 auto;
  font-size: 1.5rem;
  color: #e0e0e0;
  transition: all 0.3s ease;
}

.plan-radio:checked + .plan-card .plan-check {
  color: var(--color-primary, #E91E63);
}

/* Mobile plan cards */
@media (max-width: 767px) {
  .plan-card {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }

  .plan-icon {
    margin-bottom: 0.5rem;
  }

  .price-amount {
    font-size: 1.75rem;
  }
}

/* STEP 2: Number Choice */
.number-option {
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.number-option:hover {
  border-color: var(--color-primary, #E91E63);
  background: #fff5f8;
}

.number-option input:checked {
  background-color: var(--color-primary, #E91E63);
  border-color: var(--color-primary, #E91E63);
}

.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
  user-select: none;
}

.portability-details {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

/* STEP 3 & 4: Form Fields */
.form-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.form-control,
.form-select {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  min-height: 48px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary, #E91E63);
  box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.15);
}

.form-control.is-valid,
.form-select.is-valid {
  border-color: #4CAF50;
  padding-right: calc(1.5em + 0.75rem);
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
  padding-right: calc(1.5em + 0.75rem);
}

.valid-feedback {
  display: none;
  color: #4CAF50;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-control.is-valid ~ .valid-feedback,
.form-select.is-valid ~ .valid-feedback {
  display: block;
}

.invalid-feedback {
  display: none;
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback,
.form-check-input.is-invalid ~ .invalid-feedback {
  display: block;
}

.form-text {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* Large touch targets for mobile */
@media (max-width: 767px) {
  .form-control,
  .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 48px;
  }
}

/* Checkboxes */
.form-check {
  padding-left: 2rem;
}

.form-check-input {
  margin-left: -2rem;
}

.form-check-input:checked {
  background-color: var(--color-primary, #E91E63);
  border-color: var(--color-primary, #E91E63);
}

.form-check-input:focus {
  border-color: var(--color-primary, #E91E63);
  box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.15);
}

/* Navigation Buttons */
.checkout-navigation {
  margin-top: 2rem;
}

.checkout-navigation .btn {
  min-height: 56px;
  font-weight: 700;
  font-size: 1.125rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--color-primary, #E91E63);
  border-color: var(--color-primary, #E91E63);
}

.btn-primary:hover {
  background-color: #C2185B;
  border-color: #C2185B;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.btn-outline-secondary {
  border-color: #6c757d;
  color: #6c757d;
  border-width: 2px;
}

.btn-outline-secondary:hover {
  background-color: #6c757d;
  border-color: #6c757d;
  color: white;
}

@media (max-width: 767px) {
  .checkout-navigation .btn {
    min-height: 48px;
    font-size: 1rem;
  }
}

/* Payment Summary */
.card.bg-light {
  border: none;
  background-color: #f8f9fa !important;
}

/* Alert Styles */
.alert-info {
  background-color: #e3f2fd;
  border-color: #90caf9;
  color: #0d47a1;
}

/* Loading State */
.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Footer */
.footer {
  border-top: 1px solid #dee2e6;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Cards */
.card {
  border: none;
  border-radius: 12px;
}

.card-body {
  padding: 2rem;
}

@media (max-width: 767px) {
  .card-body {
    padding: 1.5rem;
  }
}

/* Accessibility: Focus Visible */
*:focus-visible {
  outline: 2px solid var(--color-primary, #E91E63);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .checkout-progress,
  .checkout-navigation,
  .navbar,
  .footer {
    display: none;
  }
}
