/* ============================================================================
   Digit — branded login (Abstract Orbit). Injected ONLY on /login as a
   full-screen overlay (#digit-login-root) by digit_login.js. If the JS fails,
   nothing is added and Frappe's default login stays intact. All rules are scoped
   under html.digit-login-ready so no other web page is affected.
   ============================================================================ */
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url("/assets/digit/fonts/digit/IBMPlexSansArabic-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url("/assets/digit/fonts/digit/IBMPlexSansArabic-Medium.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url("/assets/digit/fonts/digit/IBMPlexSansArabic-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url("/assets/digit/fonts/digit/IBMPlexSansArabic-Bold.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 800; font-display: swap; src: url("/assets/digit/fonts/digit/IBMPlexSansArabic-Bold.ttf") format("truetype"); }

html.digit-login-ready, html.digit-login-ready body { overflow: hidden !important; }

#digit-login-root {
  --d: #064E3B; --m: #0A8754; --mint: #34D399; --ink: #0B1F17; --mut: #64756C; --line: #E4E9E6;
  position: fixed; inset: 0; z-index: 99999;
  display: flex; direction: rtl;
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  background: #faf9f5; color: var(--ink);
  animation: dl-fade .4s ease both;
}
@keyframes dl-fade { from { opacity: 0; } to { opacity: 1; } }
#digit-login-root *, #digit-login-root *::before, #digit-login-root *::after { box-sizing: border-box; }

/* ── Left: form panel ─────────────────────────────────────────────────────── */
.dl-left {
  flex: 0 0 44%; max-width: 520px;
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 56px; background: #ffffff; position: relative;
}
.dl-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 34px; }
.dl-brand .dl-wordmark { height: 30px; display: block; }
.dl-brand .wm { font-size: 21px; font-weight: 800; letter-spacing: .06em; color: var(--ink); }
.dl-h1 { font-size: 26px; font-weight: 800; margin: 0 0 6px; color: var(--ink); }
.dl-sub { font-size: 13px; color: var(--mut); margin: 0 0 26px; }
.dl-field { margin-bottom: 15px; }
.dl-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--mut); margin-bottom: 6px; }
.dl-input-wrap { position: relative; }
.dl-input {
  width: 100%; height: 46px; padding: 0 14px; direction: ltr; text-align: left;
  border: 1.5px solid var(--line); border-radius: 11px; background: #fbfcfb;
  font: 500 14px "IBM Plex Sans Arabic", sans-serif; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.dl-input::placeholder { color: #9aa8a1; }
.dl-input:focus { border-color: var(--m); background: #fff; box-shadow: 0 0 0 3px rgba(10,135,84,.13); }
.dl-input.has-icon { padding-left: 44px; }
.dl-eye {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer;
  color: var(--mut); display: flex; align-items: center; justify-content: center; border-radius: 8px;
}
.dl-eye:hover { color: var(--m); background: #f0f6f2; }
.dl-row { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 20px; }
.dl-remember { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--mut); cursor: pointer; user-select: none; }
.dl-remember input { width: 15px; height: 15px; accent-color: var(--m); cursor: pointer; }
.dl-forgot { font-size: 12.5px; font-weight: 600; color: var(--m); text-decoration: none; cursor: pointer; }
.dl-forgot:hover { text-decoration: underline; }
.dl-btn {
  width: 100%; height: 48px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(120deg, var(--d), var(--m)); color: #fff;
  font: 700 14.5px "IBM Plex Sans Arabic", sans-serif;
  box-shadow: 0 10px 22px -10px rgba(10,135,84,.65); transition: filter .15s, transform .1s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.dl-btn:hover { filter: brightness(1.06); }
.dl-btn:active { transform: translateY(1px); }
.dl-btn:disabled { opacity: .7; cursor: default; }
.dl-divider { display: flex; align-items: center; gap: 12px; color: var(--mut); font-size: 12px; margin: 20px 0; }
.dl-divider::before, .dl-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dl-btn-ghost {
  width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
  background: #fff; color: var(--ink); font: 600 13.5px "IBM Plex Sans Arabic", sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: border-color .15s, background .15s;
}
.dl-btn-ghost:hover { border-color: var(--m); background: #f7fbf9; color: var(--d); }
.dl-error {
  margin: 0 0 14px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  background: #fdeceb; color: #b42318; border: 1px solid #f4c7c3; display: none;
}
.dl-error.show { display: block; }
.dl-foot { margin-top: 30px; display: flex; align-items: center; justify-content: space-between; }
.dl-lang { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--d);
  border: 1.5px solid var(--line); border-radius: 9px; padding: 5px 11px; cursor: pointer; background: #fff; }
.dl-lang:hover { border-color: var(--m); }
.dl-foot-note { font-size: 11px; color: var(--mut); display: flex; align-items: center; gap: 5px; }
.dl-secure { position: absolute; bottom: 20px; inset-inline: 56px; font-size: 10.5px; color: #9aa8a1; display: flex; align-items: center; gap: 5px; }

/* ── Right: orbit panel ───────────────────────────────────────────────────── */
.dl-right {
  flex: 1; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 60% 42%, #0c4030 0%, #072318 55%, #04140e 100%);
  display: flex; align-items: center; justify-content: center;
}
.dl-right::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 45%, rgba(52,211,153,.10), transparent 70%); }
.dl-right-brand { position: absolute; top: 30px; inset-inline-start: 40px; display: flex; align-items: center; gap: 8px; z-index: 3; }
.dl-right-brand .wm { font-size: 18px; font-weight: 800; letter-spacing: .06em; color: #eafff5; }

.dl-orbit { position: relative; width: 560px; height: 560px; max-width: 82vh; max-height: 82vh; z-index: 2; }
.dl-circle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; border: 1px dashed rgba(120,200,170,.20); }
.dl-circle.c1 { width: 34%; height: 34%; }
.dl-circle.c2 { width: 62%; height: 62%; }
.dl-circle.c3 { width: 92%; height: 92%; border-color: rgba(120,200,170,.13); }

.dl-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 92px; height: 92px; border-radius: 24px; z-index: 4;
  background: linear-gradient(135deg, var(--m), var(--d));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 10px rgba(10,135,84,.10), 0 0 40px rgba(52,211,153,.35);
}
.dl-center svg, .dl-center img { width: 52px; height: 52px; }
.dl-right-brand img { display: block; }

.dl-ring { position: absolute; inset: 0; }
.dl-ring.spin { animation: dl-spin 70s linear infinite; }
.dl-ring.spin-slow { animation: dl-spin 95s linear infinite reverse; }
@keyframes dl-spin { to { transform: rotate(360deg); } }
.dl-node { position: absolute; top: 50%; left: 50%; }
.dl-node-in { transform: translate(-50%, -50%); animation: dl-spin-rev 70s linear infinite; }
.dl-ring.spin-slow .dl-node-in { animation: dl-spin-rev 95s linear infinite reverse; }
@keyframes dl-spin-rev { to { transform: translate(-50%, -50%) rotate(-360deg); } }

.dl-chip {
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(120,200,170,.22);
  backdrop-filter: blur(3px); box-shadow: 0 6px 18px -10px rgba(0,0,0,.6);
}
.dl-chip .ic { width: 22px; height: 22px; flex: none; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  background: rgba(52,211,153,.15); color: #7ff0c4; }
.dl-chip .ic svg { width: 13px; height: 13px; }
.dl-chip .lb { font-size: 12px; font-weight: 700; color: #eafff5; }
.dl-chip .tg { font-size: 8.5px; font-weight: 700; letter-spacing: .08em; color: rgba(180,240,215,.55); font-family: "Archivo", sans-serif; }

.dl-tagline { position: absolute; bottom: 40px; inset-inline-start: 44px; inset-inline-end: 44px; z-index: 3; text-align: start; }
.dl-tagline .eyebrow { font: 700 10px "Archivo", sans-serif; letter-spacing: .28em; color: rgba(120,220,180,.7); margin-bottom: 8px; }
.dl-tagline .big { font-size: 22px; font-weight: 800; color: #f2fff9; line-height: 1.35; }
.dl-tagline .small { font-size: 12px; color: rgba(200,235,220,.6); margin-top: 8px; max-width: 460px; line-height: 1.6; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #digit-login-root { flex-direction: column; }
  .dl-right { display: none; }
  .dl-left { flex: 1; max-width: none; padding: 32px 24px; justify-content: flex-start; padding-top: 48px; }
  .dl-secure { position: static; margin-top: 20px; inset-inline: 0; }
}
