html, body {
  margin: 0 !important;
  padding: 0 !important;
}

/* فقط تغيير الخلفية بدون تعديل ألوان الصندوق */
.mx_AuthPage,
.mx_AuthPage_wrapper,
.mx_MatrixChat_wrapper,
#matrixchat {
  background-image: url("/bg.jpg") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}ء

/* استبدال شعار صفحة تسجيل الدخول فقط */
.mx_AuthPage_modal .mx_AuthPage_modal_side {
  position: relative !important;
}

/* إخفاء أي شعار افتراضي داخل صندوق الدخول */
.mx_AuthPage_modal .mx_AuthPage_modal_side img,
.mx_AuthPage_modal img[src*="element-logo"],
.mx_AuthPage_modal img[src*="element-app-logo"] {
  opacity: 0 !important;
}

/* إظهار شعارك مكانه */
.mx_AuthPage_modal .mx_AuthPage_modal_side::before {
  content: "";
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 96px;
  background: url("/themes/element/img/logos/element-app-logo.png") center center / contain no-repeat;
  z-index: 5;
  pointer-events: none;
}

.mx_AuthPage_header img {
  content: url("/themes/element/img/logos/element-app-logo.png") !important;
}

.mx_AuthPage {
  background: url("/bg.jpg") center/cover no-repeat !important;
}

/* AHC logo INSIDE the login modal (top-right box) */
.mx_AuthPage_modal { position: relative !important; }

.mx_AuthPage_modal::before{
  content:"";
  position:absolute;
  top: 5px;
  right: 22px;
  width: 260px;
  height: 95px;
  background: url("/ahc-logo.png") right center / contain no-repeat;
  z-index: 50;
  pointer-events: none;
}

/* Hide "Homeserver" label + value field on login */
.mx_ServerPicker,
.mx_ServerPicker_label,
.mx_ServerPicker_server,
.mx_ServerPicker_serverName,
.mx_ServerPicker_button {
  display: none !important;
}

/* Hide "New here? Create an account" */
.mx_AuthFooter,
.mx_AuthFooter a,
.mx_AuthFooter p {
  display: none !important;
}

/* Hide the "Sign in with" dropdown (Username / Email / Phone) */
.mx_AuthBody .mx_Field select,
.mx_AuthBody .mx_Field select + .mx_Dropdown_arrow,
.mx_AuthBody .mx_Dropdown,
.mx_AuthBody .mx_Dropdown_menu,
.mx_AuthBody .mx_Dropdown_option {
  display: none !important;
}

/* If there's a wrapper specific to the login identifier dropdown, hide it */
.mx_AuthBody .mx_LoginForm_identifierField .mx_Dropdown {
  display: none !important;
}

/* اجعل نافذة تسجيل الدخول بدون أي خط/ظل فوق الشعار */
.mx_AuthPage_modal .mx_AuthPage_header {
  border-bottom: 0 !important;
  box-shadow: none !important;
}

/* (اختياري) لو كان في أي line/overlay داخل المودال */
.mx_AuthPage_modal hr,
.mx_AuthPage_modal .mx_HorizontalLine {
  display: none !important;
}

/* FORCE center the login modal */
#matrixchat .mx_AuthPage {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;      /* vertical center */
  justify-content: center !important;  /* horizontal center */
}

/* If there is any top/left positioning, kill it */
#matrixchat .mx_AuthPage_modal {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  margin: 0 !important;
}

/* Space under "Sign in" so the logo fits */
.mx_AuthPage .mx_AuthPage_modal .mx_AuthPage_modal_title,
.mx_AuthPage .mx_AuthPage_modal .mx_AuthPage_modalHeader h1,
.mx_AuthPage .mx_AuthPage_modal h1 {
  margin-bottom: 34px !important; /* زوّدها/قللها حسب رغبتك */
}

/* Hide E2EE toggle in "Create room" */
.mx_CreateRoomDialog .mx_ToggleSwitch,
.mx_CreateRoomDialog .mx_LabelledToggleSwitch,
.mx_CreateRoomDialog .mx_SettingsFlag {
  display: none !important;
}

/* Hide encryption-related UI noise (safe) */
.mx_EncryptionEvent, 
.mx_EncryptionPanel, 
.mx_UserSettingsTab .mx_CrossSigningPanel,
.mx_UserSettingsTab .mx_KeyBackupPanel {
  display: none !important;
}

