/* ============================================================================
   MW sign-in (mw-login.css)
   Split screen on desktop (identity panel on the LEFT, form on the RIGHT), one tidy card on phones.
   Self-contained: it only uses the brand colours below and does not depend on the older app stylesheets.
   Navy #061023 / gold #C49640 come from the original MW logo.
   ============================================================================ */
.mwl-body {
  --l-navy: #061023; --l-navy-2: #0B1A33; --l-navy-3: #14233F;
  --l-gold: #C49640; --l-gold-hover: #B5873A; --l-gold-press: #A87B2B; --l-gold-ink: #8A6420;
  --l-text: #101828; --l-text-2: #3A4356; --l-muted: #5B6577;
  --l-border: #D5DBE5; --l-border-hover: #AEB8C8; --l-surface: #FFFFFF; --l-soft: #F5F6F9;
  --l-danger: #B42318; --l-danger-bg: #FDECEA; --l-danger-bd: #F5C2BD;
  --l-success: #1F7A4D; --l-success-bg: #E8F5EE; --l-success-bd: #BFE3CE;
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  color: var(--l-text); background: var(--l-navy); color-scheme: light;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
.mwl-body *, .mwl-body *::before, .mwl-body *::after { box-sizing: border-box; }
.mwl-skip { position: absolute; inset-inline-start: 12px; top: -48px; z-index: 20; background: var(--l-gold); color: var(--l-navy); padding: 8px 14px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.mwl-skip:focus { top: 12px; }
.mwl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.mwl { direction: ltr; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mwl > * { direction: rtl; }
/* the identity panel is first in the grid = on the left; the form is second = on the right */
.mwl-brand { order: 1; }
.mwl-form-side { order: 2; }

/* ---------------------------------------------------------------- identity panel */
.mwl-brand {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background: radial-gradient(900px 600px at 20% 0%, #14233F 0%, rgba(20, 35, 63, 0) 65%), linear-gradient(160deg, var(--l-navy-2) 0%, var(--l-navy) 70%);
  display: flex; align-items: center; justify-content: center; padding: 56px 48px;
}
.mwl-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.mwl-layer { transform: translate3d(calc(var(--mx, 0) * var(--d, 0) * 1px), calc(var(--my, 0) * var(--d, 0) * 1px), 0); transition: transform .7s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
.mwl-spin { transform-box: fill-box; transform-origin: center; }
.mwl-spin-a { animation: mwlSpin 220s linear infinite; }
.mwl-spin-b { animation: mwlSpin 160s linear infinite reverse; }
.mwl-drift-lines { animation: mwlDrift 48s linear infinite; }
.mwl-float { animation: mwlFloat 16s ease-in-out infinite; }
.mwl-float.f2 { animation-duration: 21s; animation-delay: -6s; }
.mwl-float.f3 { animation-duration: 18s; animation-delay: -3s; }
.mwl-float.f4 { animation-duration: 24s; animation-delay: -11s; }
@keyframes mwlSpin { to { transform: rotate(360deg); } }
@keyframes mwlDrift { from { transform: translate(0, 0); } to { transform: translate(-90px, 90px); } }
@keyframes mwlFloat { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(8px, -14px); } }

.mwl-brand-inner { position: relative; max-width: 440px; text-align: center; }
.mwl-brand-logo { display: block; width: min(260px, 72%); height: auto; margin: 0 auto 26px; filter: drop-shadow(0 14px 34px rgba(0, 0, 0, .35)); }
.mwl-brand-name { margin: 0 0 10px; color: #E6CC95; font-size: 15px; font-weight: 600; letter-spacing: .4px; }
.mwl-tagline { margin: 0 0 14px; font-size: clamp(26px, 2.7vw, 36px); line-height: 1.4; font-weight: 700; color: #fff; text-wrap: balance; }
.mwl-brand-text { margin: 0 auto; max-width: 360px; color: #B7C0D1; font-size: 16px; line-height: 1.9; }

/* ---------------------------------------------------------------- form side */
.mwl-form-side {
  background: var(--l-surface); display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 32px 28px; min-height: 100vh; min-height: 100dvh;
}
.mwl-card { width: 100%; max-width: 420px; margin-block: auto; }
.mwl-foot { margin: 28px 0 0; color: #7B8598; font-size: 12.5px; text-align: center; }
.mwl-mobile-brand { display: none; }

.mwl-title { margin: 0 0 8px; font-size: 28px; line-height: 1.3; font-weight: 700; color: var(--l-text); }
.mwl-sub { margin: 0 0 26px; color: var(--l-muted); font-size: 15px; line-height: 1.8; }

.mwl-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px; border-radius: 12px; border: 1px solid; font-size: 14.5px; line-height: 1.7; }
.mwl-alert svg { flex: 0 0 20px; margin-top: 2px; }
.mwl-alert p { margin: 0; }
.mwl-alert.danger { background: var(--l-danger-bg); border-color: var(--l-danger-bd); color: #7A1A12; }
.mwl-alert.success { background: var(--l-success-bg); border-color: var(--l-success-bd); color: #14573A; }

.mwl-form { display: flex; flex-direction: column; gap: 18px; }
.mwl-field { display: flex; flex-direction: column; gap: 8px; }
.mwl-field > label, .mwl-label-row { font-size: 14.5px; font-weight: 600; color: var(--l-text-2); }
.mwl-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mwl-optional { font-size: 12px; font-weight: 600; color: var(--l-gold-ink); background: #FBF5E6; border: 1px solid #F1E2BC; border-radius: 999px; padding: 1px 10px; }

.mwl-input {
  position: relative; display: flex; align-items: center; height: 48px;
  background: #fff; border: 1.5px solid var(--l-border); border-radius: 12px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.mwl-input:hover { border-color: var(--l-border-hover); }
.mwl-input:focus-within { border-color: var(--l-gold); box-shadow: 0 0 0 4px rgba(196, 150, 64, .22); }
.mwl-icon { position: absolute; inset-inline-start: 14px; display: grid; place-items: center; width: 22px; height: 22px; color: #7B8598; pointer-events: none; transition: color .2s ease, transform .25s cubic-bezier(.2, .7, .2, 1); }
.mwl-input:focus-within .mwl-icon { color: var(--l-gold-ink); transform: scale(1.12); }
.mwl-input input[type="text"], .mwl-input input[type="password"] {
  width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: var(--l-text);
  font: inherit; font-size: 16px; padding-block: 0; padding-inline: 46px 14px; border-radius: 12px;
}
.mwl-input input::placeholder { color: #98A1B2; }
.mwl-input.has-toggle input { padding-inline-end: 52px; }
.mwl-toggle {
  position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; border-radius: 9px; background: transparent; color: #5B6577; cursor: pointer;
  display: grid; place-items: center; transition: background-color .15s ease, color .15s ease;
}
.mwl-toggle:hover { background: #F1F3F7; color: var(--l-text); }
.mwl-toggle:focus-visible { outline: 3px solid rgba(196, 150, 64, .55); outline-offset: 0; }
.mwl-toggle .eye-off { display: none; }
.mwl-toggle.is-on .eye { display: none; }
.mwl-toggle.is-on .eye-off { display: block; }

.mwl-help { margin: 0; color: var(--l-muted); font-size: 13px; line-height: 1.7; }
.mwl-error { margin: 0; min-height: 0; color: var(--l-danger); font-size: 13.5px; line-height: 1.6; font-weight: 600; }
.mwl-error:empty { display: none; }
.mwl-field.has-error .mwl-input { border-color: var(--l-danger); background: #FFFBFA; }
.mwl-field.has-error .mwl-input:focus-within { box-shadow: 0 0 0 4px rgba(180, 35, 24, .16); }
.mwl-field.has-error .mwl-icon { color: var(--l-danger); }

.mwl-check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; color: var(--l-text-2); font-size: 15px; user-select: none; }
.mwl-check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; }
.mwl-box { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--l-border-hover); background: #fff; display: grid; place-items: center; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.mwl-box::after { content: ""; width: 10px; height: 6px; border: 2.5px solid var(--l-navy); border-top: 0; border-inline-end: 0; transform: rotate(-45deg) scale(0); transition: transform .15s ease; margin-top: -2px; }
.mwl-check input:checked + .mwl-box { background: var(--l-gold); border-color: var(--l-gold); }
.mwl-check input:checked + .mwl-box::after { transform: rotate(-45deg) scale(1); }
.mwl-check input:focus-visible + .mwl-box { box-shadow: 0 0 0 4px rgba(196, 150, 64, .35); }

.mwl-submit {
  position: relative; width: 100%; height: 52px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--l-gold); color: var(--l-navy); font: inherit; font-size: 16.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 8px 20px rgba(196, 150, 64, .28);
  transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.mwl-submit:hover { background: var(--l-gold-hover); }
.mwl-submit:active { background: var(--l-gold-press); transform: translateY(1px); }
.mwl-submit:focus-visible { outline: 3px solid var(--l-navy); outline-offset: 3px; }
.mwl-spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(6, 16, 35, .25); border-top-color: var(--l-navy); animation: mwlSpinner .8s linear infinite; }
@keyframes mwlSpinner { to { transform: rotate(360deg); } }
.mwl-submit.is-loading { cursor: progress; background: var(--l-gold-hover); box-shadow: none; }
.mwl-submit.is-loading .mwl-spinner { display: inline-block; }
.mwl-form.is-busy .mwl-input { background: var(--l-soft); }

.mwl-links { margin: 6px 0 0; text-align: center; font-size: 14px; }
.mwl-links a { color: var(--l-link, #1D5FA8); font-weight: 600; }

/* ---------------------------------------------------------------- phones & small tablets: one tidy card */
@media (max-width: 899.98px) {
  .mwl { display: block; }
  .mwl-brand { display: none; }
  .mwl-body {
    background:
      radial-gradient(520px 320px at 85% -10%, rgba(196, 150, 64, .22), rgba(196, 150, 64, 0) 70%),
      radial-gradient(520px 360px at 0% 100%, rgba(35, 52, 84, .85), rgba(35, 52, 84, 0) 70%),
      var(--l-navy);
  }
  .mwl-form-side { background: transparent; justify-content: flex-start; padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
  .mwl-card { background: var(--l-surface); border-radius: 22px; padding: 26px 20px 24px; margin-block: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, .38); position: relative; overflow: hidden; max-width: 460px; }
  .mwl-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--l-gold); }
  .mwl-mobile-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0 18px; color: var(--l-text); font-weight: 700; font-size: 14px; letter-spacing: .3px; }
  .mwl-mobile-brand img { width: 64px; height: 64px; }
  .mwl-title { font-size: 23px; text-align: center; }
  .mwl-sub { text-align: center; font-size: 14.5px; margin-bottom: 20px; }
  .mwl-foot { color: #8C97AC; margin-top: 18px; }
  /* room above the on-screen keyboard: the page can always scroll the focused field into view */
  .mwl-form-side { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .mwl-body::after { content: ""; display: block; height: 0; }
}
@media (max-width: 899.98px) and (max-height: 640px) { .mwl-mobile-brand { flex-direction: row; justify-content: center; margin-bottom: 12px; } .mwl-mobile-brand img { width: 40px; height: 40px; } }

/* short desktop windows: tighter vertical rhythm so the form fits without scrolling */
@media (min-width: 900px) and (max-height: 700px) {
  .mwl-form-side { padding-block: 20px 14px; }
  .mwl-title { font-size: 25px; margin-bottom: 4px; }
  .mwl-sub { margin-bottom: 16px; }
  .mwl-form { gap: 14px; }
  .mwl-foot { margin-top: 12px; }
}

/* medium desktops: tighter identity panel */
@media (min-width: 900px) and (max-width: 1100px) {
  .mwl-brand { padding: 40px 28px; }
  .mwl-form-side { padding-inline: 24px; }
}

/* reduced motion: still, with the same layout and colours */
@media (prefers-reduced-motion: reduce) {
  .mwl-spin-a, .mwl-spin-b, .mwl-drift-lines, .mwl-float { animation: none !important; }
  .mwl-layer, .mwl-input, .mwl-icon, .mwl-submit, .mwl-box, .mwl-toggle { transition-duration: .01ms !important; }
  .mwl-spinner { animation-duration: 1.6s; }
}
/* touch devices: the decoration is light (no pointer parallax; JS also skips it) */
@media (hover: none), (pointer: coarse) { .mwl-layer { transition: none; } }

@media print { .mwl-brand { display: none; } .mwl { display: block; } }
