.afra-welcome-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  z-index: 99998;
}

.afra-main.afra-welcome-modal,
.afra-main.afra-toast {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 99999;
  direction: rtl;
  font-family: inherit;
}

.afra-welcome-card,
.afra-toast-card {
  position: relative;
  width: min(92vw, 460px);
  margin: 8vh auto;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);
  padding: 26px 22px 22px;
  overflow: hidden;
  animation: afraPop 0.22s ease-out;
}


@keyframes afraPop {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.afra-close-modal {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.12);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.2s ease;
  z-index: 2;
}

.afra-close-modal:hover {
  background: rgba(148, 163, 184, 0.2);
  transform: scale(1.04);
}

.afra-close-modal img {
  width: 18px;
  height: 18px;
  opacity: 0.75;
}

.afra-header {
  text-align: center;
  padding-top: 10px;
  margin-bottom: 18px;
}

.afra-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.afra-header h3 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.8;
  color: #0f172a;
  font-weight: 800;
}

.afra-header p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 2;
}

.afra-form {
  display: grid;
  gap: 16px;
}

.afra-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.afra-field input[type="text"] {
  width: 100%;
  height: 50px;
  border: 1px solid #dbe3ee;
  background: #fff;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 14px;
  color: #0f172a;
  transition: 0.2s ease;
  box-sizing: border-box;
}

.afra-field input[type="text"]::placeholder {
  color: #94a3b8;
}

.afra-field input[type="text"]:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
  outline: none;
}

.afra-captcha-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 10px;
}

.afra-captcha-refresh {
  width: 52px;
  min-width: 52px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  border-radius: 14px;
  cursor: pointer;
  font-size: 20px;
  color: #334155;
  transition: 0.2s ease;
}

.afra-captcha-refresh:hover {
  background: #eef2f7;
  transform: rotate(10deg);
}

.afra-captcha-image-wrap {
  flex: 1;
  height: 52px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#afra-captcha-image {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.afra-welcome-error {
  display: none;
  margin-top: 8px;
  color: #dc2626;
  font-size: 12px;
  line-height: 1.8;
  padding-right: 2px;
}

.afra-footer {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.afra-btn {
  flex: 1;
  height: 48px;
  border: 0;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.afra-btn.afra-close {
  background: #e5e7eb;
  color: #475569;
}

.afra-btn.afra-close:hover {
  background: #dbe2ea;
}

.afra-btn.afra-charge {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.28);
}

.afra-btn.afra-charge:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(34, 197, 94, 0.34);
}

.afra-btn.afra-charge:disabled {
  opacity: 0.75;
  cursor: wait;
  transform: none;
}

.afra-toast-card {
  text-align: center;
  padding-top: 34px;
  padding-bottom: 28px;
}

.afra-toast-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 16px;
}

.afra-toast-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.9;
  color: #0f172a;
  font-weight: 800;
}

.afra-toast-card p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 2;
}

@media (max-width: 480px) {
  .afra-welcome-card,
  .afra-toast-card {
    width: calc(100vw - 24px);
    margin: 12px auto;
    border-radius: 20px;
    padding: 22px 16px 18px;
  }

  .afra-header h3 {
    font-size: 18px;
  }

  .afra-footer {
    flex-direction: column-reverse;
  }

  .afra-btn {
    width: 100%;
  }
}
