/* BABYLON login-only styling for Roundcube Elastic 1.7.5
 * Loaded only on the login task. Does not affect inbox or settings.
 */
@import url('https://fonts.googleapis.com/css2?family=Changa:wght@300;400;500;600;700&display=swap');

body.task-login {
  background: #ffffff;
  font-family: 'Changa', Tahoma, Arial, sans-serif;
}

body.task-login #layout {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

body.task-login #layout-content.babylon-login-page {
  display: block !important;
  position: relative;
  top: auto;
  bottom: auto;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  text-align: initial;
  background: #fff;
}

body.task-login .babylon-login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 1fr);
  direction: ltr;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

body.task-login .babylon-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  overflow: hidden;
  padding: 38px clamp(24px, 5vw, 75px) 44px;
  background: linear-gradient(155deg, #faf5e8 0%, #f3e3bf 100%);
  color: #453318;
}

body.task-login .babylon-visual:before {
  content: '';
  position: absolute;
  width: 45vw;
  height: 45vw;
  max-width: 700px;
  max-height: 700px;
  border: 1px solid rgba(196, 148, 47, .22);
  border-radius: 50%;
  top: 11%;
  left: -18%;
  pointer-events: none;
}

body.task-login .babylon-visual-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  letter-spacing: .18em;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #916819;
}
body.task-login .babylon-visual-rule {
  display: block;
  width: 40px;
  height: 2px;
  background: #c4942f;
}

body.task-login .babylon-illustration {
  position: relative;
  z-index: 1;
  max-width: 600px;
  width: 100%;
  margin: 30px auto;
  min-height: 280px;
}
body.task-login .babylon-illustration-main {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}
body.task-login .babylon-shape {
  position: absolute;
  max-width: 100%;
  pointer-events: none;
}
body.task-login .babylon-shape-one { top: 6%; left: 5%; width: 23%; }
body.task-login .babylon-shape-two { bottom: 0; right: 3%; width: 25%; }

body.task-login .babylon-visual-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
  direction: rtl;
}
body.task-login .babylon-visual-bottom strong { font-size: clamp(19px, 2vw, 28px); font-weight: 600; }
body.task-login .babylon-visual-bottom span { font-size: 14px; opacity: .8; }

body.task-login .babylon-login-panel {
  direction: rtl;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #292c2b;
  min-width: 0;
  padding: 26px clamp(24px, 5vw, 78px) 22px;
}
body.task-login .babylon-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
body.task-login .babylon-company-logo {
  display: block;
  max-width: 170px;
  max-height: 75px;
  width: auto;
  height: auto;
  object-fit: contain;
}
body.task-login .babylon-home-link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 10px 16px;
  color: #8c661e;
  background: #fbf6eb;
  border: 1px solid #e7d7b5;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
body.task-login .babylon-home-link:hover,
body.task-login .babylon-home-link:focus { color: #66490e; background: #f7edda; }

body.task-login .babylon-form-wrap {
  width: 100%;
  max-width: 470px;
  margin: auto;
  padding: 54px 0 28px;
  text-align: right;
}
body.task-login .babylon-eyebrow { color: #a77d27; font-size: 14px; font-weight: 600; }
body.task-login .babylon-welcome {
  color: #242927;
  font-size: clamp(34px, 3.4vw, 54px);
  font-weight: 700;
  line-height: 1.35;
  margin: 10px 0 13px;
}
body.task-login .babylon-lead { color: #6d706e; font-size: 14px; line-height: 1.95; margin-bottom: 29px; }

/* Override Elastic's floating / 320px login form only on login page */
body.task-login #login-form {
  position: static !important;
  top: auto !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0;
  text-align: right;
  color: #292c2b;
}
body.task-login #login-form table,
body.task-login #login-form tbody { width: 100%; max-width: none; }
body.task-login #login-form tr { width: 100%; }
body.task-login #login-form label { color: #343a36; font-weight: 500; text-align: right; }
body.task-login #login-form .form-control,
body.task-login #login-form input[type="email"],
body.task-login #login-form input[type="text"],
body.task-login #login-form input[type="password"],
body.task-login #login-form select {
  width: 100%;
  min-height: 50px;
  background-color: #fff;
  border: 1px solid #e3e0d8;
  border-radius: 9px;
  color: #252525;
  font-size: 15px;
  box-shadow: none;
}
body.task-login #login-form input[type="email"],
body.task-login #login-form input[type="text"],
body.task-login #login-form input[type="password"] { direction: ltr; text-align: left; }
body.task-login #login-form .form-control:focus,
body.task-login #login-form input:focus,
body.task-login #login-form select:focus {
  border-color: #c4942f;
  box-shadow: 0 0 0 3px rgba(196,148,47,.14);
  outline: none;
}
body.task-login #rcmloginsubmit {
  width: 100%;
  min-height: 53px;
  border: 1px solid #b08428;
  border-radius: 10px;
  color: #241b0c;
  background: #c4942f;
  font-weight: 700;
  font-family: inherit;
  font-size: 17px;
  margin-top: 20px;
  box-shadow: none;
}
body.task-login #rcmloginsubmit:hover,
body.task-login #rcmloginsubmit:focus { color: #241b0c; background: #d2a23f; border-color: #b08428; }
body.task-login #rcmloginsubmit:before { display: none !important; }
body.task-login #login-footer { text-align: center; margin-top: 12px; color: #7e817d; font-size: 12px; }
body.task-login #login-footer > div { background: transparent; padding: 0; margin-top: 8px; }
body.task-login .babylon-browser-tip { font-size: 12px; line-height: 1.8; color: #7f817e; margin-top: 16px; }
body.task-login .babylon-page-footer { text-align: center; color: #979995; font-size: 12px; }

/* Keep the original inbox entirely unchanged, including its dark theme. */
@media (max-width: 960px) {
  body.task-login .babylon-login-layout { grid-template-columns: 1fr; }
  body.task-login .babylon-visual { display: none; }
  body.task-login .babylon-login-panel { min-height: 100vh; min-height: 100dvh; }
  body.task-login .babylon-form-wrap { padding: 50px 0 28px; }
}
@media (max-width: 480px) {
  body.task-login .babylon-login-panel { padding: 18px 20px 22px; }
  body.task-login .babylon-company-logo { max-width: 135px; max-height: 65px; }
  body.task-login .babylon-home-link { font-size: 12px; padding: 9px 11px; }
  body.task-login .babylon-welcome { font-size: 37px; }
  body.task-login .babylon-form-wrap { padding: 38px 0 20px; }
}

/* Prevent dark-mode preferences from making the white corporate login illegible */
html.dark-mode body.task-login .babylon-login-panel,
html.dark-mode body.task-login #layout-content.babylon-login-page { background: #fff; color: #292c2b; }
html.dark-mode body.task-login #login-form label { color: #343a36; }
html.dark-mode body.task-login #login-form input,
html.dark-mode body.task-login #login-form select { background-color: #fff; color: #252525; }

/* =========================================
   Fix login field icons alignment
   ========================================= */

/* غلاف كل حقل */
#login-form .form-group,
#login-form .input-group,
#login-form .input-box,
#login-form .login-field {
    position: relative;
}

/* حقول الإدخال */
#login-form input[type="text"],
#login-form input[type="email"],
#login-form input[type="password"] {
    width: 100%;
    height: 62px;
    padding-right: 65px;
    padding-left: 18px;
    box-sizing: border-box;
    border-radius: 14px;
}

/* الأيقونات داخل الحقول */
#login-form .field-icon,
#login-form .input-icon,
#login-form .icon-user,
#login-form .icon-pass,
#login-form .username-icon,
#login-form .password-icon,
#login-form .icon {
    position: absolute;
    top: 50%;
    right: 18px;
    left: auto;
    transform: translateY(-50%);
    width: 44px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f3f3;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    z-index: 2;
    color: #2f3437;
}

/* لو فيه SVG أو img أو i داخل الأيقونة */
#login-form .field-icon img,
#login-form .input-icon img,
#login-form .icon img,
#login-form .field-icon svg,
#login-form .input-icon svg,
#login-form .icon svg,
#login-form .field-icon i,
#login-form .input-icon i,
#login-form .icon i {
    width: 18px;
    height: 18px;
    display: block;
    line-height: 1;
}

/* تحسين محاذاة الحقول في العربي */
html[dir="rtl"] #login-form input[type="text"],
html[dir="rtl"] #login-form input[type="email"],
html[dir="rtl"] #login-form input[type="password"] {
    text-align: right;
}
