.ao-auth-gate {
  --ao-auth-accent: #2f5eff;
  --ao-auth-accent-hover: #244fe0;
  --ao-auth-text: #182033;
  --ao-auth-muted: #687086;
  --ao-auth-border: #dfe5ef;
  --ao-auth-soft: #f6f8fc;
}

.ao-auth-gate .modal-dialog {
  width: min(520px, calc(100vw - 32px));
  max-width: 520px;
  margin-inline: auto;
}

.ao-auth-gate .modal-content {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ao-auth-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 36, 72, .18);
}

.ao-auth-gate__close {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 10px;
}

.ao-auth-gate__body {
  padding: 30px;
}

.ao-auth-gate__title {
  margin: 0 52px 8px 0;
  color: var(--ao-auth-text);
  font-size: clamp(25px, 4vw, 31px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.ao-auth-gate__lead {
  margin: 0 0 24px;
  color: var(--ao-auth-muted);
  font-size: 15px;
  line-height: 1.5;
}

.ao-auth-gate__form,
.ao-auth-gate__field {
  display: grid;
}

.ao-auth-gate__form {
  gap: 0;
}

.ao-auth-gate__field {
  gap: 7px;
  margin-bottom: 14px;
}

.ao-auth-gate__field label {
  margin: 0;
  color: var(--ao-auth-text);
  font-size: 14px;
  font-weight: 650;
}

.ao-auth-gate__field .form-control {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cfd7e6;
  border-radius: 12px;
  background: #fff;
  color: var(--ao-auth-text);
  padding: 10px 13px;
  font: inherit;
  box-shadow: none;
}

.ao-auth-gate__field .input-group {
  display: flex;
  flex-wrap: nowrap;
}

.ao-auth-gate__field .input-group .form-control {
  min-width: 0;
  border-radius: 12px 0 0 12px;
}

.ao-auth-gate__field .input-password-toggle {
  flex: 0 0 54px;
  border: 1px solid #cfd7e6;
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: #fff;
  color: #26354a;
}

.ao-auth-gate__field .form-control:focus {
  border-color: var(--ao-auth-accent);
  outline: 3px solid rgba(47, 94, 255, .13);
  outline-offset: 0;
}

.ao-auth-gate__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 18px;
}

.ao-auth-gate__meta .form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.ao-auth-gate__meta .form-check-input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ao-auth-accent);
}

.ao-auth-gate__meta label,
.ao-auth-gate__meta a {
  font-size: 13px;
}

.ao-auth-gate a {
  color: var(--ao-auth-accent);
  font-weight: 600;
  text-decoration: none;
}

.ao-auth-gate a:hover,
.ao-auth-gate a:focus-visible {
  color: var(--ao-auth-accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ao-auth-gate__actions {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.ao-auth-gate__submit,
.ao-auth-gate__provider {
  min-height: 48px;
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 700;
}

.ao-auth-gate__submit {
  border-color: var(--ao-auth-accent);
  background: var(--ao-auth-accent);
  color: #fff;
}

.ao-auth-gate__submit:hover,
.ao-auth-gate__submit:focus-visible {
  border-color: var(--ao-auth-accent-hover);
  background: var(--ao-auth-accent-hover);
  color: #fff;
}

.ao-auth-gate__provider {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d8dee8;
  background: #fff;
  color: var(--ao-auth-text);
}

.ao-auth-gate__provider:hover,
.ao-auth-gate__provider:focus-visible {
  border-color: #cbd5e6;
  background: #f7f9fd;
  color: var(--ao-auth-text);
}

.ao-auth-gate__provider svg {
  flex: 0 0 auto;
}

.ao-auth-gate__secondary-auth {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.ao-auth-gate__secondary-auth .ao-auth-gate__provider {
  width: auto;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--ao-auth-accent);
  padding: 6px 10px;
  font-size: 12px;
}

.ao-auth-gate__register {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ao-auth-border);
  color: var(--ao-auth-muted);
  font-size: 13px;
}

.ao-auth-gate__remind {
  margin-top: 9px;
  text-align: center;
  font-size: 13px;
}

.ao-auth-gate button:focus-visible,
.ao-auth-gate input:focus-visible,
.ao-auth-gate a:focus-visible {
  outline: 3px solid rgba(47, 94, 255, .16);
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .ao-auth-gate .modal-dialog {
    width: calc(100vw - 20px);
    margin: 10px auto;
  }

  .ao-auth-gate .modal-content {
    border-radius: 18px;
  }

  .ao-auth-gate__body {
    padding: 24px 18px 20px;
  }

  .ao-auth-gate__close {
    top: 12px;
    right: 12px;
  }

  .ao-auth-gate__actions {
    grid-template-columns: 1fr;
  }

  .ao-auth-gate__meta {
    align-items: flex-start;
  }
}
