.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* dark background */
  z-index: 999; /* below popup */
  display: none;
}
#success-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
#success-popup .success-popup-open {
  overflow: hidden;
}
#success-popup .success-popup-content {
  background: white;
  padding: 48px;
  width: 521px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  margin: 0 auto !important;
  animation: fadeIn 0.3s ease-in-out;
}
#success-popup .success-popup-content p {
  color: #1a214d;
  margin-top: 14px;
}
#success-popup .icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80px;
  height: 80px;
  background-color: #18a605;
  border-radius: 50%;
  margin: 0 auto 15px;
  position: relative;
}
#success-popup .success-popup-content .icon-container .checkmark {
  width: 18px;
  height: 35px;
  border-right: 5px solid white;
  border-bottom: 5px solid white;
  transform: rotate(45deg);
  position: absolute;
  top: 19px;
  left: 32px;
}

/* Hide scrollbar arrows and reduce style (for most browsers) */
.scrollable {
  overflow-y: auto;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: #ccc transparent;
}

/* WebKit-based browsers */
.scrollable::-webkit-scrollbar {
  width: 8px;
}

.scrollable::-webkit-scrollbar-track {
  background: transparent;
}

.scrollable::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}

.scrollable::-webkit-scrollbar-button {
  display: none; /* ✅ ẨN mũi tên ở đầu/cuối */
}

.medium-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Styling */
  background: white;
  max-width: 32rem;
  min-width: 16rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease-in-out;
  z-index: 1000;
}

.medium-popup--open {
  overflow: hidden;
  display: block;
}

.medium-popup__content {
  padding: 1.5rem;
  max-height: 400px;
  overflow-y: overlay;
}

.medium-popup_wrapper {
  position: relative;
}

.medium-popup__title {
  font-size: 1.75rem;
  font-family: "Lobster Two";
}

.medium-popup__description {
  line-height: 0.85rem;
  font-size: 0.85rem;
  color: grey;
}

.medium-popup__exit-button {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--primary-color-2);
  color: var(--wp--preset--color--white);
  height: 3rem;
  width: 3.125rem;
  line-height: 2.5rem;
  font-size: 1.125rem;
  color: white;
  border-radius: 0 0.375rem 0 3.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 0.25rem;
  cursor: pointer;
}

.medium-popup__email-icon--big {
  background: #4a80eb;
  font-size: 3.25rem;
  height: 6rem;
  width: 6rem;
  line-height: 6rem;
  color: white;
  border-radius: 50%;
  text-align: center;
}

.medium-popup__email-icon--small {
  position: absolute;
  height: 3.125rem;
  width: 3.125rem;
  background: #4a80eb;
  color: white;
  line-height: 3.125rem;
  font-size: 1.5rem;
  border-radius: 0.325rem 0 0 0.325rem;
}

.medium-popup form {
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
}

.medium-popup form button {
  background: var(--primary-color-2);
  color: var(--wp--preset--color--white);
  font-size: 1.5rem;
  font-weight: 600;
  border: 1px solid #a9c3f5;
  letter-spacing: 1px;
  cursor: pointer;
  outline: none;
  transition: 0.3s;
  margin-top: 1rem;
}
.medium-popup form button:hover {
  background: #a9c3f5;
  border: 1px solid #a9c3f5;
  letter-spacing: 2px;
}

.medium-popup form button:disabled {
  cursor: not-allowed;
  background: #cbeaff;
}

.medium-popup form .error {
  color: red;
  display: flex;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  line-gap-override: 0.75rem;
  margin-top: 0.125rem;
}

.group-radio {
  margin-top: 0.125rem;
  display: flex;
  justify-content: space-around;
  gap: 4rem;
}

.radio-group-item {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.medium-popup .radio-group-item > label {
  font-size: 0.75rem;
  color: var(--primary-color-1);
}

.medium-popup form .radio-item {
  display: flex;
  align-items: center;
  height: 1.25rem;
  width: 1.25rem;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.searchable-select {
  position: relative;
  width: 100%;
}

.searchable-select__search-input {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
}

.searchable-select__options-popup {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-top: none;
  background-color: #fff;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.searchable-select__option {
  padding: 8px;
  cursor: pointer;
}

.searchable-select__option:hover {
  background-color: #f0f0f0;
}

.dynamic-frame {
  display: flex;
  gap: 1rem;
}

.local-loading-popup {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7); /* semi-transparent white */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: all; /* block interaction */
}

/* Reuse the spinner styles */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--secondary-color, #fdba23);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.hidden {
  display: none;
}

.phone-prefix {
  position: absolute;
  left: 0.8rem;
  font-size: 0.95rem;
  color: #555;
  pointer-events: none;
}

.phone-wrapper .input-field {
  width: 100%;
  padding-left: 3.5rem;
  padding-right: 2rem;
  box-sizing: border-box;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.currency-wrapper img.currency-icon {
  position: absolute;
  left: 0.6rem;
  height: 1rem;
  width: auto;
  pointer-events: none;
  opacity: 0.85;
}

.currency-wrapper .input-field {
  width: 100%;
  padding-left: 2rem;
  padding-right: 1.8rem;
  box-sizing: border-box;
}

.input-wrapper .input-field {
  width: 100%;
  padding-right: 2rem;
  box-sizing: border-box;
}

.field-icon {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: #1aaa55;
  pointer-events: none;
}

.medium-popup form button {
  height: 3.125rem;
  width: 100%;
  border-radius: 0.1875rem;
}

.input-field {
  height: 3.125rem;
  width: 100%;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  border: none;
  border-bottom: 1px solid #dde3ec;
  background: #ffffff;
  font-weight: 500;
  color: #07074d;
  outline: none;
  resize: none;
}

.input-field::placeholder {
  color: #8c8c8c;
}

.input-invalid {
  border-color: red;
}

.form-label {
  color: #07074d;
  font-weight: 500;
  font-size: 0.875rem;
  font-weight: 600;
}

.form-group:focus-within .form-label {
  color: #6a64f1;
}

.form-group:focus-within .input-field {
  border-color: #6a64f1;
}

@media screen and (max-width: 1024px) {
  #success-popup .success-popup-content {
    padding: 32px 16px;
    margin: 0 16px !important;
  }
  #success-popup h4 {
    line-height: 32px;
  }
}

@media (max-width: 480px) {
  .form-label {
    font-size: 0.75rem;
  }

  .dynamic-frame {
    flex-direction: column;
  }

  .medium-popup form button {
    font-size: 1rem;
  }
}
