/* RESET AND BASE STYLES */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #000;
  color: #fff;
  margin-top: 50px;
  overflow-x: hidden;
}

html, body {
  overflow-x: hidden;
}

/* GLOBAL PLACEHOLDER COLOR */
input::placeholder,
textarea::placeholder,
select::placeholder {
  color: #fff !important;
  opacity: 1;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder,
select:-ms-input-placeholder {
  color: #fff !important;
}

input::-ms-input-placeholder,
textarea::-ms-input-placeholder,
select::-ms-input-placeholder {
  color: #fff !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #fff !important;
}

/* WRAPPER */
.wrapper {
  width: 50%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 10px;
}

/* HEADER */
.header {
  background-color: #111;
  color: #d4af37;
  padding: 0px;
  text-align: center;
  /*box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);*/
}

.logo {
  text-align: center;
}

.logo img {
  max-width: 100%;
  height: auto;
}

.logo .highlight {
  width: 50px;
}

.logo .tagline {
  font-size: 12px;
  color: #bbb;
}

/* FORM LAYOUT */
.form-box {
  background-color: #1a1a1a;
  display: flex;
  flex-direction: column;
  padding: 20px;
  /*box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);*/
  justify-content: space-between;
  gap: 20px;
  /*border-radius: 10px;*/
}

.form-section {
  margin-bottom: 15px;
  padding-bottom: 10px;
}

.payment-method-section {
  margin-bottom: 15px;
  padding-bottom: 10px;
}

h3 {
  margin-top: 0;
  color: #d4af37;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
}

/* FORM CONTROLS */
.form-group {
  display: flex;
  flex-direction: column;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d4af37;
  border-radius: 4px;
  font-size: 14px;
  background-color: #111;
  color: #d4af37;
  margin-bottom: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #ffcc00;
  outline: none;
  background-color: #111;
  color: #d4af37;
}

/* ROW LAYOUTS */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.col {
  flex: 1 1 48%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.row-two {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 12px;
  margin-bottom: 15px;
  width: 100%;
}

.half-width {
  flex: 1 1 28%;
}

/* PAYMENT METHOD STYLES - DYNAMIC WRAPPING */
.payment-method-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.payment-method-option {
  flex: 1 0 calc(33.333% - 10px);
  min-width: 150px;
  max-width: calc(50% - 10px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px; /* Reduced from 10px */
  padding: 10px 12px; /* Reduced horizontal padding */
  background-color: rgba(17, 17, 17, 0.8);
  border: 1.5px solid #333;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 45px;
  font-size: 14px;
}

.payment-method-option:hover {
  background-color: rgba(212, 175, 55, 0.1);
  border-color: #d4af37;
  transform: translateY(-1px);
}

.payment-method-option.selected {
  background-color: rgba(212, 175, 55, 0.15);
  border-color: #d4af37;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.payment-method-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.payment-method-option .radio-custom {
  width: 18px;
  height: 18px;
  border: 1.5px solid #d4af37;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  margin-right: 5px; /* Added margin to separate from label */
}

.payment-method-option .radio-custom::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #d4af37;
  transform: scale(0);
  transition: transform 0.3s ease;
}

.payment-method-option input[type="radio"]:checked + .radio-custom::after {
  transform: scale(1);
}

.payment-method-option input[type="radio"]:checked + .radio-custom {
  border-color: #ffcc00;
  box-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

.payment-method-option label {
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  flex-grow: 1;
  display: block;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-wrap: break-word;
  padding: 2px 0; /* Reduced vertical padding */
  text-align: left; /* Changed from center to left */
  margin: 0;
}

/* ERROR MESSAGE */
.error-message {
  color: #ff6f61;
  font-size: 0.9em;
  margin-top: 5px;
  margin-bottom: 0;
}

/* SMALL TEXT */
.small-text {
  font-size: 17px;
  color: #d4af37;
  margin-top: 5px;
}

/* CARD DETAILS INLINE */
.card-details-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

.card-details-row .form-group {
  flex: 1 1 100px;
}

/* DRAMATIC DISAPPEAR EFFECT */
.card-details-section {
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  opacity: 1;
  transform: translateX(0) rotateX(0);
  filter: blur(0) grayscale(0);
  pointer-events: all;
}

.card-details-section.hidden {
  opacity: 0;
  transform: translateX(-30px) rotateX(90deg);
  filter: blur(8px) grayscale(1);
  pointer-events: none;
  height: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  overflow: hidden;
}

/* CARD PREVIEW */
.card-preview {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  perspective: 1000px;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.card-preview.hidden {
  opacity: 0;
  transform: translateY(30px) scale(0.8);
  filter: blur(10px);
  height: 0;
  margin-top: 0;
  overflow: hidden;
  pointer-events: none;
}

.card {
  width: 320px;
  height: 200px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}

.card.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 15px;
  backface-visibility: hidden;
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-front {
  background: linear-gradient(135deg, #d4af37, #222);
  color: #fff;
  z-index: 2;
}

.card-front .chip {
  width: 50px;
  height: 35px;
  background-color: gold;
  border-radius: 6px;
  margin-bottom: 15px;
}

.card-number {
  font-size: 20px;
  letter-spacing: 2px;
  margin: 10px 0;
}

.card-holder {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.card-back {
  background: linear-gradient(135deg, #222, #d4af37);
  transform: rotateY(180deg);
  color: #fff;
}

.card-back .magnetic-strip {
  height: 40px;
  background-color: #444;
  margin-bottom: 20px;
  border-radius: 4px;
}

.card-back .signature-box {
  background-color: #fff;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  border-radius: 4px;
}

.card-back .cvv-display {
  color: #000;
  font-weight: bold;
  letter-spacing: 1px;
}

/* BUTTON AND FOOTER */
.form-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

/* PAY NOW BUTTON */
#payNowBtn {
  background: linear-gradient(135deg, #d4af37, #ffcc00);
  color: black;
  border: none;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 4px 14px rgba(255, 215, 0, 0.4);
  position: relative;
  overflow: hidden;
}

#payNowBtn:hover {
  background: linear-gradient(135deg, #ffcc00, #d4af37);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 10px 25px rgba(255, 215, 0, 0.6);
}

/* SELECT2 CUSTOM STYLING */
.select2-container .select2-selection--single {
  height: 40px !important;
  padding: 6px 12px;
  border: 1px solid #d4af37;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  background-color: #111;
  color: #d4af37;
}

.select2-container--default .select2-selection--single {
  background-color: #111 !important;
  color: #d4af37 !important;
  border: 1px solid #d4af37 !important;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 16px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #d4af37 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #d4af37 transparent transparent transparent !important;
}

.select2-container--default .select2-results > .select2-results__options {
  background-color: black !important;
  color: #d4af37 !important;
  font-size: 16px;
}

.select2-container--default .select2-results__option {
  background-color: black !important;
  color: #d4af37 !important;
}

.select2-container--default .select2-results__option--highlighted {
  background-color: #d4af37 !important;
  color: black !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  color: #fff !important;
  background-color: #111 !important;
  border: 1px solid #d4af37 !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
  margin-top: -8px !important;
  position: relative;
  z-index: 10;
}

/* AMOUNT FIELD */
.amount-wrapper {
  display: flex;
  align-items: center;
}

.enteramount {
  margin-top: 20px;
  width: 100%;
}

#currencySymbol {
  position: absolute;
  left: 10px;
  top: 20%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #d4af37;
  pointer-events: none;
}

#cardIcon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  display: none;
}

/* HIDE SPIN BUTTONS */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* LOADING OVERLAY */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: bold;
  color: #d4af37;
  display: none;
}

.spinner {
  border: 6px solid #333;
  border-top: 6px solid #d4af37;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
  margin-right: 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Autofill fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill {
  background-color: #f3f8ff !important;
  color: #000 !important;
  transition: background-color 600000s 0s, color 600000s 0s;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .wrapper {
    width: 95%;
  }

  .form-box {
    flex-direction: column;
    gap: 15px;
  }

  .row {
    flex-direction: column;
  }

  .col {
    flex: 1 1 100%;
  }

  .row-two {
    flex-direction: column;
    gap: 10px;
  }

  .half-width {
    flex: 1 1 100%;
  }

  .card-details-row {
    flex-direction: column;
    width: 100%;
  }

  .card-details-row .form-group {
    flex: 1 1 50px;
  }

  .form-footer {
    flex-direction: column;
    align-items: center;
  }

  /* Payment method responsive */
  .payment-method-option {
    flex: 1 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
  }

  .payment-method-option label {
    font-size: 13px;
  }

  .payment-method-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .payment-method-option {
    flex: 1 0 100%;
    max-width: 100%;
  }

  .payment-method-option {
    padding: 8px 12px;
    min-height: 40px;
  }

  .card {
    width: 100%;
    max-width: 320px;
  }

  .form-box {
    padding: 15px;
  }
}

@media (max-width: 400px) {
  .card-preview {
    width: 100%;
    overflow-x: auto;
  }

  .city-postal-group input,
  .form-group input,
  .form-group select {
    width: 100%;
  }
}