/* Popup — reference-matched clean UI */

.al-body-locked {
  overflow: hidden !important;
  touch-action: none;
}

.al-popup-root {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 20px 20px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s;
  font-family: var(--al-font, Kalameh, Tahoma, sans-serif);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

.al-popup-root--open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.al-popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.al-popup {
  position: relative;
  width: 100%;
  max-width: var(--al-width, 480px);
  max-height: 90vh;
  background: var(--al-bg, #fff);
  border-radius: var(--al-radius, 24px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: al-modal-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes al-modal-in {
  from { transform: scale(0.96) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.al-popup__close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  color: #000;
  transition: opacity 0.2s;
}

.al-popup__close span {
  display: block;
  line-height: 1;
}

.al-popup__close:hover,
.al-popup__close:focus {
  opacity: 0.45;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

.al-popup__inner {
  padding: 40px;
  overflow-y: auto;
  flex: 1;
}

.al-popup__inner--leaving {
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.18s ease;
}

.al-popup__inner--entering {
  animation: al-step-in 0.24s ease;
}

@keyframes al-step-in {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Step question */
.al-popup__step-title {
  margin: 0 0 24px;
  font-size: 1.125rem;
  font-weight: 700;
  color: #111;
  line-height: 1.6;
  text-align: right;
}

.al-popup__step-desc {
  margin: -12px 0 20px;
  font-size: 0.875rem;
  color: #888;
  text-align: right;
}

.al-popup__field-label {
  display: block;
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  line-height: 1.5;
  text-align: right;
}

.al-popup__fields > .al-field + .al-field {
  margin-top: 24px;
}

/* Reset fieldset — no box around options */
.al-popup fieldset.al-field {
  border: 0 !important;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.al-popup fieldset.al-field legend {
  display: none;
}

/* Radio / checkbox rows */
.al-options {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.al-option {
  display: block;
  cursor: pointer;
  user-select: none;
}

.al-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.al-option__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.al-option__label {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  flex: 1;
  line-height: 1.5;
  text-align: right;
}

.al-option__control {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid #ccc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  background: #fff;
}

.al-options--multi .al-option__control {
  border-radius: 4px;
}

.al-option__control::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--al-primary, #00a870);
  transform: scale(0);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.al-options--multi .al-option__control::after {
  border-radius: 2px;
  width: 11px;
  height: 11px;
}

.al-option--selected .al-option__control,
.al-option input:checked + .al-option__row .al-option__control {
  border-color: var(--al-primary, #00a870);
}

.al-option--selected .al-option__control::after,
.al-option input:checked + .al-option__row .al-option__control::after {
  transform: scale(1);
}

/* Text / mobile / select fields */
.al-field {
  margin-bottom: 0;
}

.al-field__input,
.al-field__select {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fff;
  color: #111;
  box-sizing: border-box;
  text-align: right;
}

.al-field__input::placeholder {
  color: #bbb;
}

.al-field__input:focus,
.al-field__select:focus {
  outline: none;
  border-color: var(--al-primary, #00a870);
}

.al-field--error .al-field__input,
.al-field--error .al-field__select {
  border-color: #e53e3e;
}

.al-field__error {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #e53e3e;
  text-align: right;
}

.al-field--options .al-field__error {
  margin-top: 12px;
}

/* Select with chevron on left */
.al-field__select-wrap {
  position: relative;
}

.al-field__select-wrap .al-field__select {
  appearance: none;
  -webkit-appearance: none;
  padding-left: 40px;
  cursor: pointer;
}

.al-field__select-wrap::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 7px;
  height: 7px;
  border-right: 2px solid #999;
  border-bottom: 2px solid #999;
  pointer-events: none;
}

/* Actions — بعدی چپ، قبلی راست (RTL) */
.al-popup__actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  direction: rtl;
}

.al-popup__actions--first {
  justify-content: center;
}

.al-popup-root .al-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s, filter 0.2s;
  min-height: auto;
  text-decoration: none;
  width: auto;
  white-space: nowrap;
  box-sizing: border-box;
}

.al-popup-root .al-btn--primary {
  background: var(--al-btn-bg, var(--al-primary, #00a870)) !important;
  color: var(--al-btn-color, #fff) !important;
  border-color: var(--al-btn-bg, var(--al-primary, #00a870)) !important;
  box-shadow: none;
}

.al-popup-root .al-btn--primary:hover:not(:disabled) {
  background: var(--al-btn-hover, #008f5f) !important;
  border-color: var(--al-btn-hover, #008f5f) !important;
  filter: brightness(0.95);
}

.al-popup-root .al-btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.al-popup-root .al-btn--secondary {
  background: #e8e8e8 !important;
  color: #444 !important;
  border-color: #e8e8e8 !important;
  box-shadow: none;
}

.al-popup-root .al-btn--secondary:hover {
  background: #d4d4d4 !important;
  border-color: #d4d4d4 !important;
  color: #222 !important;
}

.al-popup-root .al-btn--ghost {
  background: #e8e8e8 !important;
  color: #444 !important;
  border-color: #e8e8e8 !important;
}

.al-popup-root .al-btn--whatsapp {
  background: #25d366;
  color: #fff;
}

/* Success */
.al-popup__success {
  text-align: center;
  padding: 8px 0;
}

.al-popup__success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: #e8f5ef;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.al-popup__success-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--al-primary, #00a870);
}

.al-popup__success-text {
  color: #555;
  line-height: 1.75;
  margin-bottom: 24px;
  font-size: 0.925rem;
}

.al-popup-root .al-popup__success-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.al-popup-root .al-popup__success-actions .al-btn {
  width: 100%;
  min-height: 50px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: none !important;
  text-align: center;
}

.al-popup-root .al-btn--urgent {
  background: #00a870 !important;
  color: #ffffff !important;
  border: 2px solid #00a870 !important;
  box-shadow: none !important;
}

.al-popup-root .al-btn--urgent:hover {
  background: #008f5f !important;
  border-color: #008f5f !important;
  color: #ffffff !important;
  filter: none;
}

.al-popup-root .al-popup__success-actions .al-btn--secondary {
  background: #ffffff !important;
  color: #4b5563 !important;
  border: 2px solid #d1d5db !important;
  font-weight: 600;
  min-height: 46px;
  padding: 12px 24px;
}

.al-popup-root .al-popup__success-actions .al-btn--secondary:hover {
  background: #f9fafb !important;
  border-color: #9ca3af !important;
  color: #374151 !important;
}

.al-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

/* Floating Action Button — See5-style */
#al-fab-root.al-fab-wrap {
  position: fixed;
  z-index: 999990;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Ensure left/right are mutually exclusive (inline style sets one side only). */
#al-fab-root.al-fab-wrap--right {
  left: auto !important;
}
#al-fab-root.al-fab-wrap--left {
  right: auto !important;
}

#al-fab-root .al-fab__label {
  pointer-events: none;
  background: #fff;
  color: #1a1a1a;
  padding: 7px 16px;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
  font-size: 0.8125rem;
  font-family: var(--al-font, Kalameh, Tahoma, sans-serif);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.1);
  line-height: 1.4;
}

#al-fab-root .al-fab {
  pointer-events: auto;
  position: relative;
  width: var(--al-fab-size, 72px) !important;
  height: var(--al-fab-size, 72px) !important;
  min-width: var(--al-fab-size, 72px) !important;
  min-height: var(--al-fab-size, 72px) !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-appearance: none;
  appearance: none;
}

#al-fab-root .al-fab__ring {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18), 0 0 0 3px #fff;
  transition: box-shadow 0.25s, transform 0.25s;
}

#al-fab-root .al-fab:hover {
  transform: scale(1.06);
}

#al-fab-root .al-fab:hover .al-fab__ring {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22), 0 0 0 3px #fff;
}

#al-fab-root .al-fab__img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.al-open-popup.al-btn-trigger {
  background: var(--al-primary, #00a870);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}

@media (max-width: 767px) {
  .al-popup-root {
    padding: max(20px, env(safe-area-inset-top, 20px)) 12px 12px;
    align-items: flex-start;
  }

  .al-popup-root .al-popup {
    max-width: 100%;
    max-height: 88vh;
    border-radius: 24px;
  }

  .al-popup-root .al-popup__inner {
    padding: 24px 20px;
  }

  .al-popup-root .al-popup__close {
    top: 12px;
    left: 12px;
  }

  .al-popup-root .al-popup__actions {
    flex-direction: column-reverse;
    gap: 10px;
    width: 100%;
  }

  .al-popup-root .al-popup__actions .al-btn {
    width: 100%;
    padding: 14px 20px;
  }

  .al-popup-root .al-popup__success-actions .al-btn {
    width: 100%;
    min-height: 50px;
    padding: 14px 20px;
  }

  .al-fab--hide-mobile { display: none !important; }

  #al-fab-root.al-fab-wrap {
    --al-fab-size: 64px;
    gap: 8px;
  }

  #al-fab-root .al-fab__label {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
}

@media (min-width: 768px) {
  .al-fab--hide-desktop { display: none !important; }
}


/* Embedded form — settings-driven styles */
.al-embedded-form--section {
  font-family: inherit;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  position: relative;
  margin: 0;
  padding: var(--al-section-padding-y, 36px) 20px;
  background: var(--al-section-bg, #F7F7F8);
  border: 0;
  border-radius: 0;
}

.al-embedded-form--section *,
.al-embedded-form--section *::before,
.al-embedded-form--section *::after {
  box-sizing: border-box;
}

.al-embedded-form__inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  background: var(--al-card-bg, #ffffff);
  border: 1px solid var(--al-card-border, #ECECEF);
  border-radius: var(--al-card-radius, 20px);
  box-shadow: 0 8px 28px rgba(17, 24, 39, 0.06);
  padding: 36px 40px 32px;
}

.al-embedded-form__heading {
  margin: 0 0 28px;
  font-size: var(--al-heading-size, 28px);
  font-weight: 700;
  color: var(--al-heading, #1A1A1A);
  line-height: 1.55;
  text-align: center;
  letter-spacing: -0.01em;
}

.al-embedded-form__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 16px;
  text-align: right;
  margin: 0 0 22px;
}

.al-embedded-form__fields .al-field--textarea,
.al-embedded-form__fields .al-field--checkbox,
.al-embedded-form__fields .al-field--radio,
.al-embedded-form__fields .al-field--select {
  grid-column: 1 / -1;
}

.al-embedded-form__label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--al-label, #374151);
  text-align: right;
  line-height: 1.4;
}

.al-embedded-form .al-required {
  color: var(--al-field-focus, #E8525B);
  font-weight: 700;
}

.al-embedded-form .al-input,
.al-embedded-form .al-input--textarea,
.al-embedded-form .al-input--select {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--al-field-border, #D1D5DB);
  border-radius: 12px;
  background: var(--al-field-bg, #ffffff);
  font-family: inherit;
  font-size: 15px;
  color: var(--al-field-text, #111827);
  outline: none;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.al-embedded-form .al-input--textarea {
  height: auto;
  min-height: 108px;
  padding: 14px 16px;
  resize: vertical;
}

.al-embedded-form .al-input::placeholder,
.al-embedded-form .al-input--textarea::placeholder {
  color: #9CA3AF;
}

.al-embedded-form .al-input:focus,
.al-embedded-form .al-input--textarea:focus,
.al-embedded-form .al-input--select:focus {
  border-color: var(--al-field-focus, #E8525B);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--al-field-focus, #E8525B) 18%, transparent);
}

.al-embedded-form .al-input--mobile {
  direction: ltr;
  text-align: right;
}

.al-embedded-form__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
}

.al-embedded-form .al-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px 20px;
  border-radius: var(--al-btn-radius, 13px);
  font-size: var(--al-btn-font-size, 15px);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  text-decoration: none !important;
  white-space: nowrap;
  line-height: 1.3;
  box-shadow: none;
}

.al-embedded-form .al-btn--primary,
.al-embedded-form__submit {
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  background: var(--al-btn-bg, #E8525B) !important;
  color: var(--al-btn-color, #fff) !important;
  border-color: var(--al-btn-border, #E8525B) !important;
  order: 1;
}

.al-embedded-form .al-btn--primary:hover:not(:disabled),
.al-embedded-form__submit:hover:not(:disabled) {
  background: var(--al-btn-hover, #D4454E) !important;
  border-color: var(--al-btn-hover, #D4454E) !important;
  transform: translateY(-1px);
}

.al-embedded-form .al-btn--primary:disabled,
.al-embedded-form__submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.al-embedded-form .al-btn--call,
.al-embedded-form__call {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  order: 2;
  align-self: stretch;
  min-height: 0 !important;
  height: auto !important;
  margin: 4px 0 0;
  padding: 10px 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--al-call-color, #111111) !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 16px;
  font-weight: 700;
  direction: ltr;
  text-decoration: none !important;
  letter-spacing: 0.04em;
  appearance: none;
  -webkit-appearance: none;
}

.al-embedded-form .al-btn--call::before,
.al-embedded-form .al-btn--call::after,
.al-embedded-form__call::before,
.al-embedded-form__call::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--al-call-line, #1A1A1A);
  opacity: 0.85;
  border: 0;
  box-shadow: none;
}

.al-embedded-form .al-btn--call:hover,
.al-embedded-form .al-btn--call:focus,
.al-embedded-form .al-btn--call:active,
.al-embedded-form__call:hover,
.al-embedded-form__call:focus,
.al-embedded-form__call:active {
  background: transparent !important;
  color: var(--al-call-color, #111111) !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
  transform: none !important;
  filter: none !important;
}

.al-embedded-form__global-error {
  margin-top: 14px;
  padding: 12px 14px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 12px;
  color: #B91C1C;
  font-size: 13px;
  text-align: right;
}

.al-embedded-form .al-field--error .al-input,
.al-embedded-form .al-field--error .al-input--textarea,
.al-embedded-form .al-field--error .al-input--select {
  border-color: var(--al-field-focus, #E8525B);
}

.al-embedded-form .al-field__error {
  margin: 7px 0 0;
  font-size: 12px;
  color: #DC2626;
  text-align: right;
}

.al-embedded-form__success {
  text-align: center;
  padding: 8px 0 0;
}

.al-embedded-form__success-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--al-heading, #1A1A1A);
}

.al-embedded-form__success-body {
  margin: 0;
  color: #6B7280;
  line-height: 1.7;
  font-size: 14px;
}

.al-embedded-form__notice {
  padding: 12px;
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 8px;
  color: #9A3412;
}

@media (max-width: 767px) {
  .al-embedded-form--section {
    padding: var(--al-section-padding-y, 28px) 14px;
  }

  .al-embedded-form__inner {
    padding: 28px 18px 24px;
  }

  .al-embedded-form__heading {
    margin-bottom: 22px;
  }

  .al-embedded-form__fields {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .al-embedded-form .al-input,
  .al-embedded-form .al-input--select {
    height: 52px;
  }
}
