/* =========================================================
   BINGWA SOKONI — MODERN UI SYSTEM
   ========================================================= */

/* =========================================================
   1. TAB CONTENT
   ========================================================= */

.tab-content {
  display: none;
}

.active-tab-content {
  display: block;
  animation: tabFadeIn 0.25s ease both;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =========================================================
   2. GENERAL FADE ANIMATION
   ========================================================= */

.animate-fadeIn {
  animation: fadeIn 0.25s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* =========================================================
   3. SPINNER
   ========================================================= */

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


/* =========================================================
   4. TOAST NOTIFICATION
   ========================================================= */

.toast-notification {
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}


/* =========================================================
   5. PRODUCT CARDS
   ========================================================= */

.product-card {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  will-change: transform;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px -14px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   6. BUTTONS
   ========================================================= */

.btn-gift,
.btn-buy,
.btn-pay,
.btn-disabled {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease,
    background-color 0.2s ease;
}

.btn-gift:hover,
.btn-buy:hover,
.btn-pay:hover {
  transform: translateY(-2px);
}

.btn-gift:active,
.btn-buy:active,
.btn-pay:active {
  transform: translateY(0) scale(0.98);
}


/* =========================================================
   7. FORM GROUP
   ========================================================= */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  background: #fff;
  color: #111827;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}


/* =========================================================
   8. DYNAMIC FORM FIELDS
   ========================================================= */

#dynamicFormFields {
  width: 100%;
}

#dynamicFormFields input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  outline: none;
  background: #fff;
  color: #111827;
  font-size: 15px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

#dynamicFormFields input::placeholder {
  color: #9ca3af;
}

#dynamicFormFields input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

#dynamicFormFields label {
  display: block;
  margin-bottom: 7px;
  color: #374151;
  font-size: 14px;
  font-weight: 700;
}


/* =========================================================
   9. MODAL
   ========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9998;

  display: none;

  align-items: center;
  justify-content: center;

  padding: 16px;

  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  width: min(500px, 100%);
  max-height: 90vh;

  padding: 1.5rem;

  overflow-y: auto;

  background: #fff;
  border-radius: 18px;

  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.2);

  animation: modalSlideIn 0.25s ease both;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* =========================================================
   10. MODAL CLOSE BUTTON
   ========================================================= */

.modal-close {
  display: flex;

  width: 36px;
  height: 36px;

  align-items: center;
  justify-content: center;

  float: right;

  border: none;
  border-radius: 50%;

  background: #ef4444;
  color: #fff;

  font-size: 24px;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.modal-close:hover {
  background: #dc2626;
  transform: scale(1.07);
}

.modal-close:active {
  transform: scale(0.95);
}


/* =========================================================
   11. PAYMENT BUTTON LOADING
   ========================================================= */

#payNowButton {
  position: relative;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

#payNowButton.loading {
  opacity: 0.8;
  pointer-events: none;
  cursor: wait;
}

#payNowButton.loading::after {
  content: "";

  width: 18px;
  height: 18px;

  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;

  animation: spin 0.7s linear infinite;
}


/* =========================================================
   12. FULLSCREEN IFRAME OVERLAY
   ========================================================= */

.full-iframe-overlay {
  position: fixed;
  inset: 0;

  z-index: 99999;

  display: none;

  width: 100%;
  height: 100%;

  background: #fff;
}

.full-iframe-overlay iframe {
  display: block;

  width: 100%;
  height: 100%;

  border: none;

  background: #fff;
}


/* =========================================================
   13. MODERN IFRAME OVERLAY
   ========================================================= */

.iframe-overlay {
  position: fixed;
  inset: 0;

  z-index: 99999;

  display: none;

  align-items: center;
  justify-content: center;

  padding: 15px;

  background: rgba(0, 0, 0, 0.75);

  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}


/* =========================================================
   14. IFRAME CONTAINER
   ========================================================= */

.iframe-container {
  position: relative;

  width: 100%;
  max-width: 1200px;
  height: 92vh;

  overflow: hidden;

  background: #fff;
  border-radius: 18px;

  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.3);

  animation: iframeFadeIn 0.25s ease both;
}

@keyframes iframeFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}


/* =========================================================
   15. IFRAME
   ========================================================= */

#externalIframe {
  display: block;

  width: 100%;
  height: 100%;

  border: none;

  background: #fff;
}


/* =========================================================
   16. IFRAME CLOSE BUTTON
   ========================================================= */

.iframe-close {
  position: absolute;

  top: 12px;
  right: 12px;

  z-index: 10;

  display: flex;

  width: 42px;
  height: 42px;

  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 50%;

  background: #111827;
  color: #fff;

  font-size: 26px;
  font-weight: 700;

  line-height: 1;

  cursor: pointer;

  box-shadow:
    0 5px 15px rgba(0, 0, 0, 0.18);

  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.iframe-close:hover {
  background: #000;
  transform: scale(1.08);
}

.iframe-close:active {
  transform: scale(0.95);
}


/* =========================================================
   17. IFRAME LOADER
   ========================================================= */

.iframe-loader {
  position: absolute;
  inset: 0;

  z-index: 5;

  display: flex;

  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: #fff;
}

.spinner {
  width: 52px;
  height: 52px;

  margin-bottom: 14px;

  border: 5px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;

  animation: spin 0.8s linear infinite;
}


/* =========================================================
   18. MODERN PHONE FIELD
   ========================================================= */

.modern-field {
  margin-bottom: 20px;
}

.modern-label {
  display: flex;

  align-items: center;

  gap: 7px;

  margin-bottom: 9px;

  color: #1f2937;

  font-size: 14px;
  font-weight: 700;
}


/* =========================================================
   19. PHONE INPUT WRAPPER
   ========================================================= */

.phone-input-wrapper {
  display: flex;

  width: 100%;

  align-items: center;

  overflow: hidden;

  background: #fff;

  border: 1.5px solid #e5e7eb;
  border-radius: 16px;

  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.025);

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.phone-input-wrapper:focus-within {
  border-color: #6366f1;

  box-shadow:
    0 0 0 4px rgba(99, 102, 241, 0.11);

  transform: translateY(-1px);
}


/* =========================================================
   20. COUNTRY CODE
   ========================================================= */

.country-code {
  display: flex;

  height: 54px;

  align-items: center;

  padding: 0 13px;

  flex-shrink: 0;

  background: #f8fafc;

  border-right: 1px solid #e5e7eb;

  color: #374151;

  font-size: 14px;
  font-weight: 700;

  white-space: nowrap;
}


/* =========================================================
   21. PHONE INPUT
   ========================================================= */

.modern-phone-input {
  flex: 1;

  min-width: 0;

  height: 54px;

  padding: 0 15px;

  border: none;
  outline: none;

  background: transparent;

  color: #111827;

  font-size: 16px;
  font-weight: 600;
}

.modern-phone-input::placeholder {
  color: #9ca3af;
  font-weight: 500;
}


/* =========================================================
   22. INPUT HELPER / ERROR
   ========================================================= */

.input-helper {
  display: block;

  margin-top: 7px;
  padding-left: 3px;

  color: #6b7280;

  font-size: 12px;
  line-height: 1.4;
}

.modern-error {
  margin-top: 7px;

  color: #dc2626;

  font-size: 13px;
  font-weight: 600;
}


/* =========================================================
   23. SAME NUMBER CHECKBOX
   ========================================================= */

.same-number-box {
  margin-bottom: 18px;

  padding: 14px 15px;

  background: linear-gradient(
    135deg,
    #eef2ff,
    #f5f3ff
  );

  border: 1px solid #c7d2fe;
  border-radius: 17px;

  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.same-number-box:hover {
  border-color: #818cf8;

  transform: translateY(-1px);

  box-shadow:
    0 5px 15px rgba(99, 102, 241, 0.08);
}


/* =========================================================
   24. CHECKBOX
   ========================================================= */

.modern-checkbox {
  display: flex;

  align-items: center;

  gap: 12px;

  width: 100%;

  cursor: pointer;

  user-select: none;
}

.modern-checkbox input {
  position: absolute;

  width: 1px;
  height: 1px;

  opacity: 0;

  pointer-events: none;
}


/* =========================================================
   25. CUSTOM CHECKBOX UI
   ========================================================= */

.checkbox-ui {
  display: flex;

  width: 27px;
  height: 27px;

  min-width: 27px;

  align-items: center;
  justify-content: center;

  background: #fff;

  border: 2px solid #6366f1;
  border-radius: 9px;

  box-shadow:
    0 2px 7px rgba(99, 102, 241, 0.1);

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.checkbox-ui i {
  color: #fff;

  font-size: 13px;

  opacity: 0;

  transform: scale(0.5);

  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}


/* =========================================================
   26. CHECKED STATE
   ========================================================= */

.modern-checkbox input:checked + .checkbox-ui {
  background: linear-gradient(
    135deg,
    #6366f1,
    #8b5cf6
  );

  border-color: #6366f1;
}

.modern-checkbox input:checked + .checkbox-ui i {
  opacity: 1;

  transform: scale(1);
}


/* =========================================================
   27. CHECKBOX TEXT
   ========================================================= */

.checkbox-content {
  flex: 1;

  min-width: 0;
}

.checkbox-title {
  color: #111827;

  font-size: 15px;
  font-weight: 700;

  line-height: 1.25;
}

.checkbox-desc {
  margin-top: 3px;

  color: #6b7280;

  font-size: 13px;

  line-height: 1.4;
}


/* =========================================================
   28. CHECKBOX CLICK EFFECT
   ========================================================= */

.modern-checkbox:active .checkbox-ui {
  transform: scale(0.94);
}


/* =========================================================
   29. ACCESSIBILITY
   ========================================================= */

.modern-checkbox input:focus-visible + .checkbox-ui {
  outline: 3px solid rgba(99, 102, 241, 0.25);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}


/* =========================================================
   30. MOBILE
   ========================================================= */

@media (max-width: 768px) {

  .modal {
    padding: 10px;
  }

  .modal-content {
    width: 100%;
    max-height: 94vh;
    padding: 18px;
    border-radius: 16px;
  }

  .iframe-overlay {
    padding: 0;
  }

  .iframe-container {
    width: 100%;
    height: 100dvh;
    max-width: none;
    border-radius: 0;
  }

  .iframe-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}


/* =========================================================
   31. SMALL MOBILE
   ========================================================= */

@media (max-width: 640px) {

  .same-number-box {
    padding: 13px;
    border-radius: 15px;
  }

  .modern-checkbox {
    gap: 10px;
  }

  .checkbox-ui {
    width: 25px;
    height: 25px;
    min-width: 25px;
    border-radius: 8px;
  }

  .checkbox-title {
    font-size: 14px;
  }

  .checkbox-desc {
    font-size: 12px;
  }

  .modern-field {
    margin-bottom: 17px;
  }

  .modern-label {
    margin-bottom: 7px;
    font-size: 13px;
  }

  .country-code {
    height: 52px;
    padding: 0 11px;
    font-size: 13px;
  }

  .modern-phone-input {
    height: 52px;
    padding: 0 13px;
    font-size: 15px;
  }
}


/* =========================================================
   32. VERY SMALL DEVICES
   ========================================================= */

@media (max-width: 380px) {

  .modal-content {
    padding: 15px;
    border-radius: 14px;
  }

  .country-code {
    padding: 0 9px;
    font-size: 12px;
  }

  .modern-phone-input {
    padding: 0 11px;
    font-size: 14px;
  }

  .checkbox-title {
    font-size: 13px;
  }

  .checkbox-desc {
    font-size: 11px;
  }
}


/* =========================================================
   33. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}