@keyframes rf-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.rf-form {
  --rf-input-text-color: #0f172a;
  --rf-input-border-color: #e5e7eb;
  --rf-input-background-color: #fff;
  --rf-input-focus-ring-color: #3b82f6;
  --rf-input-font-size: 14px;
  --rf-input-radius: 6px;
  --rf-field-error-color: #ef4444;
  --rf-alert-success-text-color: #fff;
  --rf-alert-success-background-color: #22c55e;
  --rf-alert-error-text-color: #fff;
  --rf-alert-error-background-color: #ef4444;
  --rf-loader-text-color: #fff;
  --rf-loader-background-color: rgb(43 44 51 / 75%);

  width: 100%;
  max-width: 328px;
}

@media screen and (max-width: 475px) {
  .rf-form,
  .payment-methods {
    max-width: 80%;
  }
}

.rf-form__content {
  position: relative;
  box-sizing: border-box;
  border-radius: inherit;
}

.rf-form__content > * + * {
  margin-top: 16px;
}

.rf-form__content > :last-child {
  margin-top: 20px;
}

.rf-form__loader {
  position: absolute;
  z-index: 1;
  top: -2px;
  right: -2px;
  bottom: -2px;
  left: -2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--rf-loader-text-color);
  background: var(--rf-loader-background-color);
  border-radius: 8px;
}

.rf-form__loader::before {
  content: "";
  display: block;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 50%;
  border-width: 5px;
  border-style: solid;
  border-color: currentColor transparent currentColor transparent;
  animation: rf-spin 1.2s linear infinite;
}

.rf-form-field {
  width: 100%;
}

.rf-form-field__error {
  line-height: 1.25;
  display: none;
  width: 100%;
  margin-top: 8px;
  color: var(--rf-field-error-color);
}

.rf-form-input {
  font-size: var(--rf-input-font-size);
  line-height: 24px;
  box-sizing: border-box;
  width: 100%;
  padding: 8px 12px;
  color: var(--rf-input-text-color);
  background-color: var(--rf-input-background-color);
  border: 0 solid var(--rf-input-border-color);
  border-radius: var(--rf-input-radius);
  appearance: none;
}

.rf-form-input:focus {
  border-color: var(--rf-input-focus-ring-color);
  box-shadow: 0 0 0 2px var(--rf-input-focus-ring-color);
}

.rf-alert {
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 6px;
}

.rf-alert_error {
  color: var(--rf-alert-error-text-color);
  background: var(--rf-alert-error-background-color);
}

.rf-alert_success {
  color: var(--rf-alert-success-text-color);
  background: var(--rf-alert-success-background-color);
}

.rf-alert__icon {
  flex-shrink: 0;
  width: auto;
}

.rf-alert__content {
  font-size: 14px;
  line-height: 1.25;
  padding-left: 12px;
}

.rf-alert__content > * {
  margin: 0;
  padding: 0;
}

.rf-alert__content > * + * {
  margin-top: 0.5em;
}

.rf-alert__content > h1,
.rf-alert__content > h2,
.rf-alert__content > h3,
.rf-alert__content > h4,
.rf-alert__content > h5,
.rf-alert__content > h6 {
  font-size: inherit;
  font-weight: 600;
}

.rf-alert__content > ul,
.rf-alert__content > ol {
  padding-left: 1.5em;
}



.rf-form-field .iti {
  width: 100%;
}

.rf-form-field .iti__flag-container {
  padding: 0;
}

.rf-form-field .iti__selected-dial-code {
  font-size: var(--rf-input-font-size);
}


/* Country Selector Styles */
.country-selector {
    position: relative;
    display: inline-block;
    z-index: 9999;
}

.country-selector-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

.country-selector-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.country-selector-button.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.country-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.country-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    color: #333;
    font-size: 14px;
}

.country-option:hover {
    background: rgba(59, 130, 246, 0.1);
}

.country-option:first-child {
    border-radius: 6px 6px 0 0;
}

.country-option:last-child {
    border-radius: 0 0 6px 6px;
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.country-selector-button.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .country-dropdown {
        position: fixed;
        top: 80px;
        left: 10px;
        right: 10px;
        max-height: 50vh;
    }
}

/* Custom scrollbar for dropdown */
.country-dropdown::-webkit-scrollbar {
    width: 6px;
}

.country-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.country-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.country-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}