/* Zahra admin login — premium corporate auth screen.
   Full-bleed navy→indigo→cornflower gradient with oversized elliptical waves,
   and a floating near-white card pinned to the right (45% zone). Scoped under
   .signin-shell / .signin-panel / .zahra-* so the workspace keeps the original
   BCare palette. */

/* ---------- keyframes ---------- */
@keyframes zahraRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes zahraSpin { to { transform: rotate(360deg); } }

/* ---------- shell ---------- */
.signin-shell {
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-block-size: 100dvh;
  inline-size: 100vw !important;
  overflow: hidden !important;
  padding: 3rem 5vw !important;
  color: #080d35 !important;
  background-color: #202d87 !important;
  background-image:
    radial-gradient(150% 120% at 4% -10%, #202d87 0%, #2949c8 42%, transparent 78%),
    radial-gradient(120% 110% at 100% 110%, #e8edfc 0%, #648ff5 42%, transparent 76%),
    linear-gradient(135deg, #202d87 0%, #2949c8 34%, #3d55f5 62%, #648ff5 84%, #e8edfc 100%) !important;
}
/* oversized dark ellipse, upper-left */
.signin-shell::before {
  content: "";
  position: absolute;
  inset-inline-start: -18vw;
  inset-block-start: -32vh;
  inline-size: 78vw;
  block-size: 78vw;
  border-radius: 9999px;
  background-image:
    radial-gradient(closest-side at 40% 45%, #202d87 0%, #2949c8 55%, rgba(41, 73, 200, 0) 100%);
  opacity: .95;
  pointer-events: none;
}
/* pale curved sweep, bottom-right */
.signin-shell::after {
  content: "";
  position: absolute;
  inset-inline-end: -22vw;
  inset-block-end: -38vh;
  inline-size: 86vw;
  block-size: 86vw;
  border-radius: 9999px;
  background-image:
    radial-gradient(closest-side at 55% 45%, rgba(232, 237, 252, .95) 0%, rgba(100, 143, 245, .75) 48%, rgba(100, 143, 245, 0) 100%);
  pointer-events: none;
}

/* ---------- wave overlay (injected inline SVG) ---------- */
.signin-shell .zahra-waves {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.signin-shell .zahra-waves svg {
  inline-size: 100%;
  block-size: 100%;
  display: block;
}

/* ---------- card ---------- */
.signin-panel {
  position: relative !important;
  z-index: 1;
  inline-size: min(400px, calc(100vw - 2rem)) !important;
  max-inline-size: 400px !important;
  max-block-size: none !important;
  background-color: #f7f8fc !important;
  background-image: none !important;
  border: 1px solid rgba(232, 237, 252, .9) !important;
  border-radius: 28px !important;
  padding: 24px 26px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  overflow: visible !important;
  box-shadow:
    0 30px 80px rgba(32, 45, 135, .18),
    0 8px 24px rgba(32, 45, 135, .10) !important;
  animation: zahraRise .5s cubic-bezier(.22, .7, .3, 1.02) both;
}

/* ---------- top row: language pill ---------- */
.signin-shell .signin-panel > div:first-child {
  padding: 0 !important;
  margin-block-end: .5rem !important;
}
.signin-shell .signin-panel button.min-h-11 {
  border-color: #e3e8f7 !important;
  background-color: transparent !important;
  color: #2949c8 !important;
  border-radius: 10px !important;
  font-size: .8rem !important;
  transition: border-color .2s, color .2s;
}
.signin-shell .signin-panel button.min-h-11:hover {
  border-color: #0649ed !important;
  color: #0649ed !important;
}

/* ---------- header ---------- */
.signin-shell header {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  animation: none !important;
}
.signin-shell header .dashboard-brand-mark {
  inline-size: auto !important;
  block-size: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .55rem !important;
  margin-block-start: .5rem;
}
.signin-shell header .dashboard-brand-mark svg { display: none !important; }
.signin-shell header .dashboard-brand-mark::after {
  content: "";
  display: block;
  order: 1;
  inline-size: 26px;
  block-size: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230649ED' stroke='%230649ED' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z'/%3E%3Cpath d='m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65'/%3E%3Cpath d='m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 26px 26px;
  background-position: center;
}
.signin-shell header .dashboard-brand-mark::before {
  content: "Admin Panel";
  display: block;
  order: 2;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.015em;
  color: #080d35;
}
html[dir="rtl"] .signin-shell header .dashboard-brand-mark::before { content: "لوحة التحكم"; }

.signin-shell header h1 {
  margin-block: 1.4rem .45rem !important;
  font-size: 1.7rem !important;
  font-weight: 800 !important;
  letter-spacing: -.025em;
  line-height: 1.15;
  text-align: center !important;
  color: #080d35 !important;
  animation: none !important;
}
.signin-shell header p {
  color: #5c6b8a !important;
  font-size: .9rem !important;
  line-height: 1.5;
  text-align: center !important;
}

/* ---------- step wrappers ---------- */
.signin-shell .animate-slideLeft,
.signin-shell .animate-slideRight { animation: none !important; }
.signin-shell .signin-panel > div:nth-child(n+3) {
  inline-size: 100% !important;
  padding: 0 !important;
  gap: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

/* ---------- fields ---------- */
.signin-shell .signin-panel label:has(input[name="text"]), .signin-shell .signin-panel label:has(input[name="password"]) {
  position: relative !important;
  border: 1px solid #e3e8f7 !important;
  outline: none !important;
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  inline-size: 100% !important;
  min-block-size: 46px !important;
  block-size: 46px !important;
  margin-block-start: 1rem !important;
  margin-block-end: 0 !important;
  padding-inline: 3rem 1rem !important;
  background-color: #f7f9fe !important;
  border-color: #e3e8f7 !important;
  border-radius: 13px !important;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.signin-shell .signin-panel label:has(input[name="text"]):focus-within, .signin-shell .signin-panel label:has(input[name="password"]):focus-within {
  border-color: #0649ed !important;
  background-color: #fff !important;
  box-shadow: 0 0 0 3px rgba(6, 73, 237, .12) !important;
}
.signin-shell .signin-panel label:has(input[name="text"]).animate-pulse, .signin-shell .signin-panel label:has(input[name="password"]).animate-pulse {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .10) !important;
}
/* React's inline icon hidden; Lucide outline icons drawn by CSS */
.signin-shell .signin-panel label:has(input[name="text"]) > svg, .signin-shell .signin-panel label:has(input[name="password"]) > svg { display: none !important; }
.signin-shell .signin-panel label:has(input[name="text"])::after, .signin-shell .signin-panel label:has(input[name="password"])::after {
  content: "";
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: 50%;
  transform: translateY(-50%);
  inline-size: 20px;
  block-size: 20px;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323346B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E");
  pointer-events: none;
}
.signin-shell .signin-panel label:has(input[name="password"])::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2323346B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}
/* caption above the field */
.signin-shell .signin-panel label:has(input[name="text"])::before, .signin-shell .signin-panel label:has(input[name="password"])::before {
  content: "Email Address";
  display: block;
  position: absolute;
  inset-block-start: -1.75rem;
  inset-inline-start: 0;
  font-size: .85rem;
  font-weight: 700;
  color: #080d35;
  pointer-events: none;
}
/* captions need room above each field */
.signin-shell .signin-panel label:has(input[name="password"])::before { content: "Password"; }
.signin-shell .signin-panel label:has(input[name="text"]) {
  margin-block-start: 1.9rem !important;
}
.signin-shell .signin-panel label:has(input[name="password"]) {
  margin-block-start: 1.5rem !important;
}
html[dir="rtl"] .signin-shell .signin-panel label:has(input[name="text"])::before, html[dir="rtl"] .signin-shell .signin-panel label:has(input[name="password"])::before { content: "البريد الإلكتروني"; }
html[dir="rtl"] .signin-shell .signin-panel label:has(input[name="password"])::before { content: "كلمة المرور"; }

.signin-shell .signin-panel label:has(input[name="text"]) input, .signin-shell .signin-panel label:has(input[name="password"]) input {
  color: #080d35 !important;
  font-size: 1rem !important;
  padding-inline: 0 !important;
  block-size: 100% !important;
}
.signin-shell .signin-panel label:has(input[name="text"]) input::placeholder, .signin-shell .signin-panel label:has(input[name="password"]) input::placeholder { color: #9aa6bd !important; }

/* password visibility toggle (injected button) */
.signin-shell .signin-panel label:has(input[name="text"]), .signin-shell .signin-panel label:has(input[name="password"]) .zahra-eye {
  position: absolute;
  inset-inline-end: .8rem;
  inset-block-start: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 32px;
  block-size: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #5c6b8a;
  border-radius: 8px;
}
.signin-shell .signin-panel label:has(input[name="text"]), .signin-shell .signin-panel label:has(input[name="password"]) .zahra-eye:hover { color: #0649ed; }
.signin-shell .signin-panel label:has(input[name="text"]), .signin-shell .signin-panel label:has(input[name="password"]) .zahra-eye:focus-visible {
  outline: 2px solid #0649ed;
  outline-offset: 1px;
}
.signin-shell .signin-panel label:has(input[name="text"]), .signin-shell .signin-panel label:has(input[name="password"]) .zahra-eye svg {
  display: block;
  inline-size: 20px;
  block-size: 20px;
}

/* the email step keeps its button hidden: one Sign In button for the card */
.signin-shell .signin-panel > div:nth-child(3) .signin-primary { display: none !important; }
/* password step carries the remember row, secure note and the single button */
.signin-shell .signin-panel > div:nth-child(3) .zahra-remember,
.signin-shell .signin-panel > div:nth-child(3) .zahra-secure { display: none !important; }

/* ---------- remember / forgot row ---------- */
.signin-shell .zahra-remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block-start: .9rem;
  font-size: .9rem;
}
.signin-shell .zahra-remember-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  color: #080d35;
}
.signin-shell .zahra-remember-box {
  appearance: none;
  -webkit-appearance: none;
  inline-size: 20px;
  block-size: 20px;
  margin: 0;
  border-radius: 5px;
  border: 1px solid #c8d3ea;
  background-color: #fff;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.signin-shell .zahra-remember-box:checked {
  border-color: #0649ed;
  background-color: #0649ed;
}
.signin-shell .zahra-remember-box:checked + .zahra-remember-tick {
  display: block;
}
.signin-shell .zahra-remember-tick {
  display: none;
  position: absolute;
  inline-size: 20px;
  block-size: 20px;
  inset-inline-start: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 13px 13px;
  background-position: center;
}
.signin-shell .zahra-remember-box:focus-visible {
  outline: 2px solid #0649ed;
  outline-offset: 2px;
}
.signin-shell .zahra-forgot {
  border: 0;
  padding: 0;
  background: transparent;
  font-size: .95rem;
  font-weight: 500;
  color: #0649ed;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.signin-shell .zahra-forgot:hover { color: #0732cc; }

/* ---------- primary button ---------- */
.signin-shell .signin-primary {
  position: relative;
  inline-size: 100% !important;
  block-size: 50px !important;
  margin-block-start: 1rem !important;
  margin-block-end: 0 !important;
  border: 0 !important;
  border-radius: 14px !important;
  background-image: linear-gradient(135deg, #0649ed, #0732cc) !important;
  background-color: #0649ed !important;
  color: #fff !important;
  font-size: .95rem !important;
  font-weight: 700 !important;
  letter-spacing: .01em;
  padding-inline: 1rem 3rem !important;
  box-shadow: 0 12px 26px rgba(7, 50, 204, .28) !important;
  transition: box-shadow .2s, transform .12s, filter .2s;
}
.signin-shell .signin-primary:hover {
  background-image: linear-gradient(135deg, #0a54ff, #0842e0) !important;
  box-shadow: 0 14px 30px rgba(7, 50, 204, .34) !important;
  transform: translateY(-1px);
}
.signin-shell .signin-primary:active { transform: translateY(1px); filter: brightness(.96); }
.signin-shell .signin-primary:focus-visible {
  outline: 2px solid #648ff5;
  outline-offset: 2px;
}
.signin-shell .signin-primary:disabled {
  background-image: none !important;
  background-color: #9fb3e8 !important;
  box-shadow: none !important;
}
/* right-pointing arrow */
.signin-shell .signin-primary::after {
  content: "";
  position: absolute;
  inset-inline-end: 1.1rem;
  inset-block-start: 50%;
  transform: translateY(-50%);
  inline-size: 22px;
  block-size: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 22px 22px;
  background-position: center;
  pointer-events: none;
}
html[dir="rtl"] .signin-shell .signin-primary::after { transform: translateY(-50%) scaleX(-1); }

/* ---------- secure access box (injected node) ---------- */
.signin-shell .zahra-secure {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-block-start: .8rem;
  padding: .7rem .9rem;
  border-radius: 14px;
  background-color: #dee7fc;
  border: 1px solid rgba(232, 237, 252, .7);
  text-align: start;
}
.signin-shell .zahra-secure-icon {
  flex: none;
  inline-size: 26px;
  block-size: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230649ED' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3Ccircle cx='12' cy='16' r='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 26px 26px;
  background-position: center;
}
.signin-shell .zahra-secure-title {
  font-size: .85rem;
  font-weight: 700;
  color: #080d35;
  line-height: 1.4;
}
.signin-shell .zahra-secure-sub {
  font-size: .82rem;
  line-height: 1.5;
  color: #5c6b8a;
}

/* ---------- inline alert ---------- */
.signin-shell [role="alert"] {
  background-color: #fef2f2 !important;
  border-inline-start: 2px solid #dc2626 !important;
  border-radius: 10px !important;
  padding: .6rem .8rem !important;
  color: #b91c1c !important;
  font-size: .9rem !important;
}

/* ---------- spinner ---------- */
.signin-shell .loading-spinner {
  display: inline-block;
  inline-size: 1rem;
  block-size: 1rem;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  background: transparent !important;
  animation: zahraSpin .8s linear infinite;
}

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .signin-shell { padding: 2rem 4vw !important; }
  .signin-panel { padding: 30px 32px !important; max-inline-size: 400px !important; }
  .signin-shell header h1 { font-size: 1.9rem !important; }
}

/* ---------- mobile: card centred ---------- */
@media (max-width: 720px) {
  .signin-shell {
    justify-content: center !important;
    padding: 1.25rem !important;
  }
  .signin-panel {
    padding: 28px 26px !important;
    inline-size: min(460px, calc(100vw - 1.6rem)) !important;
    border-radius: 24px !important;
  }
  .signin-shell header .dashboard-brand-mark::before { font-size: 1.1rem; }
  .signin-shell header .dashboard-brand-mark::after { inline-size: 26px; block-size: 26px; background-size: 26px 26px; }
  .signin-shell header h1 { font-size: 1.7rem !important; margin-block-start: 1.2rem !important; }
  .signin-shell header p { font-size: .95rem !important; }
  .signin-shell::before { inline-size: 120vw; block-size: 120vw; }
  .signin-shell::after { inline-size: 110vw; block-size: 110vw; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .signin-panel { animation: none !important; }
}
