/* =====================================================================
 * Login drawer — slide-in panel from the LEFT (RTL-correct, responsive).
 * Self-contained; matches the site design system (navy primary #1d3d7c,
 * rounded 10px controls, GE SS Two / Cairo via var(--font-primary)).
 *
 * Layout rules (approved mockup):
 *   • ONE consistent 18px padding + vertical rhythm — no inner border box.
 *   • Two dividers only: "أو الدخول برقم الهاتف" + "أو المتابعة بواسطة".
 *   • Inputs 42px / radius 10, labels 13px above. Buttons 46px / radius 10.
 *   • SMS/WhatsApp = segmented control in a rounded track (4px padding).
 *   • Header + footer hairlines; SVG icons only (no emoji).
 * ===================================================================== */

.gz-login-drawer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  visibility: hidden;
}
.gz-login-drawer.is-open { visibility: visible; }

.gz-login-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gz-login-drawer.is-open .gz-login-drawer__overlay { opacity: 1; }

.gz-login-drawer__panel {
  position: absolute;
  top: 0;
  left: 0;                       /* slide-in from the LEFT */
  height: 100%;
  width: 400px;
  max-width: 92vw;
  background: #fff;
  box-shadow: 4px 0 28px rgba(0, 38, 99, 0.20);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  direction: rtl;
  font-family: var(--font-primary, "Cairo", sans-serif);
  --gz-pad: 18px;
  --gz-line: #e6ebf2;            /* hairline / input border */
  --gz-muted: #7c8aa0;          /* muted divider / helper text */
}
.gz-login-drawer.is-open .gz-login-drawer__panel { transform: translateX(0); }

/* ---- Header: title (navy) + close X, bottom hairline ---- */
.gz-login-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gz-pad);
  border-bottom: 1px solid var(--gz-line);
}
.gz-login-drawer__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary, #1d3d7c);
}
.gz-login-drawer__close {
  background: none;
  border: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.gz-login-drawer__close:hover { background: #f1f5f9; color: var(--primary, #1d3d7c); }

/* ---- Body: single consistent padding + vertical rhythm ---- */
.gz-login-drawer__body {
  padding: var(--gz-pad);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Pin the login form block first regardless of plugin DOM injection order
   (WP SMS Pro wraps #loginform in .login-form-container; when absent, the
   bare #loginform is the direct child). Everything else follows DOM order. */
.gz-login-drawer .login-form-container,
.gz-login-drawer #loginform { order: -1; }

/* KILL the bordered card box WP SMS Pro draws around the form
   (login.css: div.login-form-container{border;box-shadow;background}). */
.gz-login-drawer .login-form-container {
  width: 100%;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  overflow: visible !important;
  padding: 0 !important;
}

/* --- native wp_login_form --- */
.gz-login-drawer #loginform {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.gz-login-drawer #loginform p { margin: 0; }
.gz-login-drawer #loginform label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #1d3d7c);
  margin-bottom: 6px;
}
.gz-login-drawer #loginform input[type="text"],
.gz-login-drawer #loginform input[type="password"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--gz-line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  box-sizing: border-box;
  direction: rtl;
  background: #fff;
}
.gz-login-drawer #loginform input:focus {
  outline: none;
  border-color: var(--primary, #1d3d7c);
  box-shadow: 0 0 0 3px rgba(29, 61, 124, 0.12);
}
.gz-login-drawer #loginform .login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #475569;
  font-weight: 400;
}
.gz-login-drawer #loginform .login-remember label {
  font-size: 14px;
  font-weight: 400;
  color: #475569;
  margin: 0;
}
.gz-login-drawer #loginform .login-remember input { width: auto; height: auto; }

/* Neutralise WP SMS Pro's floated/transparent submit wrapper so our
   full-width navy button always wins. */
.gz-login-drawer #loginform .login-btn-wrapper {
  float: none;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
}
.gz-login-drawer #wp-submit {
  width: 100% !important;
  height: 46px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: var(--primary, #1d3d7c) !important;
  color: #fff !important;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  float: none !important;
  display: block !important;
}
.gz-login-drawer #wp-submit:hover { background: var(--primary-dark, #173061) !important; }

/* ---- Forgot password ---- */
.gz-login-drawer__lost { margin: 0; text-align: left; }
.gz-login-drawer__lost a { color: var(--gz-muted); font-size: 13px; text-decoration: none; }
.gz-login-drawer__lost a:hover { color: var(--primary, #1d3d7c); }

/* ---- Divider: thin line + centered muted text ---- */
.gz-login-drawer__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gz-muted);
  font-size: 13px;
  margin: 0;
}
.gz-login-drawer__divider::before,
.gz-login-drawer__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gz-line);
}

/* ---- Phone-OTP block ---- */
.gz-otp { display: flex; flex-direction: column; gap: 14px; }
.gz-otp__step { display: flex; flex-direction: column; gap: 12px; }

/* Segmented control: two equal halves inside a rounded 4px track. */
.gz-otp__channel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}
.gz-otp__chan {
  height: 40px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  background: transparent;
  color: var(--gz-muted);
  font-family: var(--font-primary, "Cairo", sans-serif);
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.gz-otp__chan.is-active {
  background: var(--primary, #1d3d7c);
  color: #fff;
  box-shadow: 0 1px 4px rgba(29, 61, 124, 0.25);
}
.gz-otp__chan-ico { display: inline-flex; align-items: center; justify-content: center; }
.gz-otp__chan-ico svg { display: block; }

.gz-otp__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #1d3d7c);
  margin-bottom: -6px;
}

/* Phone field: rounded input with a "+20" prefix box matching the border. */
.gz-otp__phone-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--gz-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.gz-otp__phone-wrap:focus-within {
  border-color: var(--primary, #1d3d7c);
  box-shadow: 0 0 0 3px rgba(29, 61, 124, 0.12);
}
.gz-otp__cc {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: #f8fafc;
  border-inline-start: 1px solid var(--gz-line);
  color: #334155;
  font-weight: 700;
  direction: ltr;
}
.gz-otp__phone {
  flex: 1;
  height: 42px;
  border: 0;
  padding: 0 12px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  background: transparent;
}
.gz-otp__code {
  width: 100%;
  height: 46px;
  border: 1px solid var(--gz-line);
  border-radius: 10px;
  box-sizing: border-box;
  text-align: center;
  letter-spacing: 8px;
  font-size: 20px;
  font-weight: 700;
  direction: ltr;
}
.gz-otp__code:focus {
  outline: none;
  border-color: var(--primary, #1d3d7c);
  box-shadow: 0 0 0 3px rgba(29, 61, 124, 0.12);
}

/* Primary OTP buttons */
.gz-otp__btn {
  height: 46px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  background: var(--primary, #1d3d7c);
  color: #fff;
  font-family: var(--font-primary, "Cairo", sans-serif);
  font-weight: 700;
  font-size: 16px;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.gz-otp__btn:hover { background: var(--primary-dark, #173061); }
.gz-otp__btn.is-busy { opacity: 0.6; cursor: default; }

.gz-otp__help { margin: 0; font-size: 14px; color: #475569; }
.gz-otp__row { display: flex; justify-content: space-between; gap: 12px; }
.gz-otp__link {
  background: none;
  border: 0;
  color: var(--primary, #1d3d7c);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.gz-otp__msg { margin: 0; font-size: 13px; min-height: 16px; }
.gz-otp__msg.is-err { color: #dc2626; }
.gz-otp__msg.is-ok { color: #16a34a; }

/* the [hidden] attribute must win over .gz-otp__step's display:flex */
.gz-otp__step[hidden] { display: none !important; }

/* ---- Social buttons: three equal 46px/radius-10, icon + label centered ---- */
.gz-login-drawer__social .nsl-container { margin: 0; }
.gz-login-drawer__social .nsl-container-block { display: flex; flex-direction: column; gap: 10px; }
.gz-login-drawer__social .nsl-container-block .nsl-button {
  width: 100% !important;
  height: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  border-radius: 10px !important;
  display: flex !important;
  flex-direction: row-reverse !important;   /* icon on the RIGHT in RTL */
  align-items: center !important;
  justify-content: center !important;
  gap: 10px;
  box-shadow: none !important;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.gz-login-drawer__social .nsl-button:hover { filter: brightness(0.96); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14); }
.gz-login-drawer__social .nsl-button svg { width: 20px !important; height: 20px !important; }
.gz-login-drawer__social .nsl-button .nsl-button-label-copy {
  font-family: var(--font-primary, "Cairo", sans-serif) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.gz-login-drawer__social .nsl-button-facebook { background: #1877F2 !important; border: 0 !important; }
.gz-login-drawer__social .nsl-button-facebook .nsl-button-label-copy { color: #fff !important; }
.gz-login-drawer__social .nsl-button-google { background: #fff !important; border: 1px solid #E0E0E0 !important; }
.gz-login-drawer__social .nsl-button-google .nsl-button-label-copy { color: #1f1f1f !important; }
.gz-login-drawer__social .nsl-button-twitter,
.gz-login-drawer__social .nsl-button-twitter-x,
.gz-login-drawer__social .nsl-button-x { background: #000 !important; border: 0 !important; }
.gz-login-drawer__social .nsl-button-twitter .nsl-button-label-copy,
.gz-login-drawer__social .nsl-button-twitter-x .nsl-button-label-copy,
.gz-login-drawer__social .nsl-button-x .nsl-button-label-copy { color: #fff !important; }

/* ---- Footer: centered register with a top hairline ---- */
.gz-login-drawer__register {
  text-align: center;
  font-size: 14px;
  color: #475569;
  padding-top: 16px;
  margin-top: 2px;
  border-top: 1px solid var(--gz-line);
}
.gz-login-drawer__register a {
  color: var(--primary, #1d3d7c);
  font-weight: 700;
  text-decoration: none;
}

/* =====================================================================
 * Suppress redundant plugin-injected chrome so only TWO dividers remain
 * and no stray "أو" appears.
 * ===================================================================== */

/* WP SMS Pro's injected "login with SMS" section + its own "أو" separator —
   the unified phone-OTP block above drives the SMS channel directly. */
.gz-login-drawer .or-login-with-wp-sms-otp-section,
.gz-login-drawer .login-form-container .or-separator { display: none !important; }

/* Nextend also auto-injects its buttons (and sometimes a separator) INTO
   wp_login_form via the login_form hook — hide the in-form copy + separator;
   keep only our explicit [nextend_social_login] block. */
.gz-login-drawer #loginform .nsl-container,
.gz-login-drawer .login-form-container .nsl-container,
.gz-login-drawer #loginform .nsl-separator { display: none !important; }

@media (max-width: 480px) {
  .gz-login-drawer__panel { width: 100vw; max-width: 100vw; }
}
