.amg-auth-body {
  min-height: 100%;
  margin: 0;
  background: var(--amg-background, #f6f6f8);
  color: var(--amg-text, #252332);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[lang="ar"] .amg-auth-body,
html[lang="ar"] .amg-auth-body * {
  font-family: "Almarai", Tahoma, Arial, sans-serif;
}

.amg-auth-body *,
.amg-auth-body *::before,
.amg-auth-body *::after {
  box-sizing: border-box;
}

.amg-page {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 44px 20px 24px;
  background:
    radial-gradient(ellipse at 50% -10%, color-mix(in srgb, var(--amg-primary) 12%, transparent), transparent 50%),
    var(--amg-background, #f6f6f8);
}

.amg-page-glow {
  position: absolute;
  z-index: -1;
  top: 10%;
  left: 50%;
  width: min(760px, 110vw);
  height: 520px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--amg-secondary) 65%, transparent), transparent 68%);
  pointer-events: none;
}

.amg-auth-card {
  width: min(100%, var(--amg-card-width, 448px));
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(52, 35, 49, 0.07);
  border-radius: var(--amg-form-radius, 10px) !important;
  background: #fff;
  box-shadow: 0 24px 75px rgba(38, 23, 36, 0.09), 0 2px 8px rgba(38, 23, 36, 0.035);
  animation: amg-card-enter 480ms cubic-bezier(.2, .75, .25, 1) both;
}

.amg-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 16px;
}

.amg-logo {
  display: flex;
  width: var(--amg-logo-width, 116px);
  height: 72px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.amg-logo-image {
  display: block;
  width: 100%;
  max-width: var(--amg-logo-width, 116px);
  max-height: 72px;
  object-fit: contain;
}

.amg-logo-placeholder {
  display: grid;
  width: min(var(--amg-logo-width, 116px), 72px);
  height: min(var(--amg-logo-width, 116px), 72px);
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--amg-primary) 18%, white);
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, var(--amg-secondary));
  color: var(--amg-primary);
}

.amg-logo-placeholder svg {
  width: 50%;
  height: 50%;
}

.amg-brand-label {
  margin: 10px 0 0;
  color: color-mix(in srgb, var(--amg-text) 58%, white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

.amg-whatsapp {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 13px;
  margin: 0 0 28px;
  padding: 14px 16px;
  border: 1px solid rgba(25, 189, 92, .36);
  border-radius: var(--amg-whatsapp-radius, 16px) !important;
  background: linear-gradient(105deg, #fff, #f5fff8);
  color: var(--amg-text);
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.amg-whatsapp:hover {
  transform: translateY(-2px);
  border-color: #19bd5c;
  box-shadow: 0 10px 24px rgba(27, 156, 79, .12);
  color: var(--amg-text);
}

.amg-whatsapp:focus-visible,
.amg-auth-body a:focus-visible,
.amg-submit:focus-visible,
.amg-password-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--amg-primary) 50%, white);
  outline-offset: 3px;
}

.amg-whatsapp-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: #20bf65;
  color: white;
}

.amg-whatsapp-icon svg {
  width: 25px;
  height: 25px;
}

.amg-whatsapp-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.amg-whatsapp-copy strong {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.4;
}

.amg-whatsapp-copy > span {
  color: #188d4c;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.amg-whatsapp-copy small {
  margin-top: 3px;
  color: #6a7180;
  font-size: 11px;
}

.amg-whatsapp-arrow {
  align-self: flex-start;
  color: #19a653;
  font-size: 18px;
}

.amg-whatsapp-unconfigured {
  cursor: default;
}

.amg-form-heading {
  margin: 0 0 18px;
  text-align: center;
}

.amg-eyebrow {
  margin: 0 0 8px;
  color: var(--amg-primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.amg-form-heading h1 {
  margin: 0;
  color: var(--amg-text);
  font-size: clamp(25px, 5vw, 31px);
  font-weight: 760;
  letter-spacing: -.035em;
  line-height: 1.2;
}

.amg-form-heading > p:last-child {
  margin: 9px 0 0;
  color: color-mix(in srgb, var(--amg-text) 62%, white);
  font-size: 14px;
  line-height: 1.6;
}

.amg-notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 0 19px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.amg-notice-success {
  border-color: #b8ebcb;
  background: #f2fcf6;
  color: #196b3a;
}

.amg-notice-error {
  border-color: #f1c8d1;
  background: #fff6f7;
  color: #9a2942;
}

.amg-notice-mark {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  place-items: center;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.amg-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.amg-field-wide,
.amg-forgot,
.amg-submit,
.amg-honeypot {
  grid-column: 1 / -1;
}

.amg-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.amg-field label {
  color: var(--amg-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-align: start;
}

.amg-required {
  color: var(--amg-primary);
}

#amg-auth .amg-field input:not([type="checkbox"]),
#amg-auth .amg-field select,
#amg-auth .amg-field textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #d9d8e0 !important;
  border-radius: var(--amg-input-radius, 10px) !important;
  background: #fff;
  color: var(--amg-text);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  text-align: start;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

#amg-auth .amg-field textarea {
  min-height: 100px;
  resize: vertical;
}

#amg-auth .amg-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 2px 0 0;
  accent-color: var(--amg-primary);
}

#amg-auth .amg-field input::placeholder,
#amg-auth .amg-field textarea::placeholder {
  color: #9694a0;
}

#amg-auth .amg-field input:not([type="checkbox"]):hover,
#amg-auth .amg-field select:hover,
#amg-auth .amg-field textarea:hover {
  border-color: #bdb9c6 !important;
}

#amg-auth .amg-field input:not([type="checkbox"]):focus,
#amg-auth .amg-field select:focus,
#amg-auth .amg-field textarea:focus {
  border-color: var(--amg-primary) !important;
  border-radius: var(--amg-input-radius, 10px) !important;
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amg-primary) 14%, transparent);
}

.amg-password-wrap {
  position: relative;
}

.amg-password-wrap input {
  padding-inline-end: 48px;
}

.amg-password-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 7px;
  display: grid;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #777483;
  cursor: pointer;
}

.amg-password-toggle:hover {
  background: var(--amg-secondary);
  color: var(--amg-primary);
}

.amg-password-toggle svg {
  width: 19px;
  height: 19px;
}

.amg-forgot {
  margin-top: -5px;
  text-align: end;
}

.amg-forgot a,
.amg-switch a {
  color: var(--amg-primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.amg-forgot a:hover,
.amg-switch a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.amg-submit {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
  padding: 0 17px;
  border: 0;
  border-radius: var(--amg-button-radius, 10px) !important;
  background: var(--amg-button);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--amg-button) 19%, transparent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 720;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.amg-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 25px color-mix(in srgb, var(--amg-button) 26%, transparent);
  filter: brightness(1.05);
  color: #fff;
}

.amg-continue {
  width: 100%;
}

.amg-submit:active {
  transform: translateY(0);
}

.amg-submit > span:last-child {
  font-size: 20px;
  font-weight: 400;
}

.amg-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  color: color-mix(in srgb, var(--amg-text) 66%, white);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.amg-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 16px 0 0;
  color: #85828d;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.amg-security-note span {
  color: color-mix(in srgb, var(--amg-primary) 55%, white);
  font-size: 9px;
}

.amg-footer {
  margin-top: 22px;
  color: #85828d;
  font-size: 11px;
  text-align: center;
}

.amg-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}

@keyframes amg-card-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 520px) {
  .amg-page {
    justify-content: flex-start;
    padding: 22px 13px 18px;
  }

  .amg-auth-card {
    padding: 22px 17px;
    border-radius: var(--amg-form-radius, 10px);
  }

  .amg-brand {
    margin-bottom: 17px;
  }

  .amg-logo {
    height: 64px;
  }

  .amg-whatsapp {
    gap: 10px;
    margin-bottom: 23px;
    padding: 12px;
  }

  .amg-whatsapp-copy strong {
    font-size: 13px;
  }

  .amg-whatsapp-copy > span {
    font-size: 11px;
  }

  .amg-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }

  #amg-auth .amg-field input:not([type="checkbox"]),
  #amg-auth .amg-field select,
  #amg-auth .amg-field textarea {
    min-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .amg-auth-card {
    animation: none;
  }

  .amg-auth-body *,
  .amg-auth-body *::before,
  .amg-auth-body *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
