/* Sign-in pages: one circuit-board background across the whole page, the logo and the system's connection on the left, the sign-in on the right (glass fields and dial pad). */
body.sx { --tx: #f3f5fa; --tx2: #b5bed3; --field: rgba(255, 255, 255, .07); --fieldtx: #f3f5fa; --ph: #9aa5bd; --line: rgba(255, 255, 255, .2); --btn1: #ecd08a; --btn2: #cfa94e; --btntx: #1a1204; --link: #ecd08a;
  margin: 0; padding: 14px; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); gap: 0; color: var(--tx); font: 15px/1.5 Inter, Outfit, Cairo, ui-sans-serif, system-ui, sans-serif;
  background: transparent !important; overflow-x: hidden; overflow-y: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
[dir="rtl"] body.sx { font-family: Cairo, ui-sans-serif, system-ui, sans-serif; }
body.sx *, body.sx *::before, body.sx *::after { box-sizing: border-box; }
body.sx [hidden] { display: none !important; }
.sx .ms, .sx .material-symbols-outlined { font-family: "Material Symbols Outlined"; font-weight: 400; font-style: normal; font-size: 20px; line-height: 1; display: inline-block; vertical-align: middle; font-feature-settings: "liga"; }

/* the background */
.sx-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(75% 95% at 62% 42%, #070f40 0%, #030820 52%, #010208 100%); }
.sx-bg::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(120% 100% at 50% 50%, transparent 45%, rgba(0, 1, 8, .72) 100%), linear-gradient(180deg, rgba(1, 3, 14, .4), rgba(1, 3, 14, .15) 55%, rgba(1, 3, 14, .5)); }
html.lg-day .sx-bg { background: radial-gradient(75% 95% at 62% 42%, #1a2f78 0%, #0e1b52 52%, #050a22 100%); }
.sx-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* the left part */
.sx-art { position: relative; min-width: 0; min-height: calc(100vh - 28px); display: flex; flex-direction: column; align-items: center; padding: 24px 34px 22px; color: #f3f5fa; }
.sx-mod { align-self: flex-start; display: grid; gap: 3px; justify-items: start; min-height: 22px; }
.sx-mod b { font: 800 20px/1.1 Inter, Outfit, Cairo, sans-serif; letter-spacing: -.01em; }
.sx-st { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15px; }
.sx-st i { width: 18px; height: 18px; border-radius: 50%; background: currentColor; }
.sx-st.on { color: #22c55e; } .sx-st.off { color: #ef4444; }
.sx-mid { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 22px; padding-top: 44px; }
.sx-logo { display: block; width: min(450px, calc(100% - 20px)); height: auto; }
.sx-info { width: min(380px, 100%); display: grid; gap: 10px; }
.sx-info .r { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(255, 255, 255, .05); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sx-info .r > .ms { font-size: 22px; color: var(--link); }
.sx-info small { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #a6aec0; }
.sx-info b { font-size: 15px; color: #f3f5fa; font-weight: 700; word-break: break-word; }
.sx-info .end { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.sx-info .end i { width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.sx-info .on { color: #22c55e; } .sx-info .off { color: #ef4444; }
.sx-foot { align-self: stretch; display: flex; align-items: center; justify-content: flex-start; gap: clamp(28px, 8vw, 130px); direction: ltr; }
.sx-pb { display:inline-flex;align-items:center;gap:6px;height:auto;padding:5px 11px 5px 12px;border-radius:999px;font:600 10.5px/1 system-ui,Segoe UI,Cairo,sans-serif;letter-spacing:.02em;color:#374151;background:linear-gradient(135deg,rgba(255,255,255,.72),rgba(255,255,255,.48));-webkit-backdrop-filter:blur(14px) saturate(1.7);backdrop-filter:blur(14px) saturate(1.7);border:1px solid rgba(255,255,255,.7);box-shadow:0 6px 18px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.85);text-decoration:none;white-space:nowrap;text-shadow:none; }
.sx-pb .m { display:block;width:94px;height:15px;padding:0;border-radius:0;box-shadow:none;background:url(/static/img/magnatech-wordmark.png) center/contain no-repeat;font-size:0;color:transparent;flex:none; }
.sx-cu, .sx-pb { white-space: nowrap; }
.sx-cu { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 196px; height: 34px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--link) 45%, transparent); border-radius: 9px; background: rgba(255, 255, 255, .04); color: var(--link); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.sx-cu .ms { font-size: 17px; } .sx-cu:hover { background: color-mix(in srgb, var(--link) 10%, transparent); }
.sx-cpop { position: absolute; inset-inline-start: 34px; bottom: 70px; width: min(330px, calc(100% - 68px)); padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--link) 35%, transparent); border-radius: 14px; background: #0a1124; box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .8); display: none; gap: 10px; z-index: 5; direction: ltr; text-align: start; }
.sx-cpop.show { display: grid; }
.sx-cpop b { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #a6aec0; }
.sx-cpop a { display: flex; align-items: center; gap: 10px; color: #f3f5fa; text-decoration: none; font-size: 15px; } .sx-cpop a:hover { color: var(--link); } .sx-cpop .ms { color: var(--link); font-size: 19px; }

/* the right part */
.sx-side { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 14px 40px 30px; }
.sx-tools { align-self: flex-end; display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.sx-clock { text-align: end; line-height: 1.2; } .sx-clock b { display: block; font: 700 14px "JetBrains Mono", ui-monospace, monospace; } .sx-clock small { font-size: 12px; color: var(--tx2); }
.sx-form { width: min(400px, 100%); margin-block: auto; }
.sx-form h1 { margin: 0 0 6px; font: 800 34px/1.15 Inter, Outfit, Cairo, sans-serif; letter-spacing: -.02em; color: var(--tx); }
.sx-form .sx-sub { margin: 0 0 26px; color: var(--tx2); font-size: 14px; }
.sx-foot-note { margin-top: 22px; text-align: center; font-size: 12px; color: var(--tx2); }
.sx-form .lg-field, .sx-in { display: block; width: 100%; height: 48px; padding: 0 14px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); color: var(--fieldtx); font: inherit; font-weight: 500; outline: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sx-form .lg-field::placeholder, .sx-in::placeholder { color: var(--ph); font-weight: 400; }
.sx-form .lg-field:focus, .sx-in:focus, .sx-box:focus-within { border-color: var(--btn2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn2) 25%, transparent); }
.sx-form label { color: var(--tx); font-size: 14px; font-weight: 600; }
.sx-box { position: relative; display: flex; align-items: center; height: 48px; margin-top: 8px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sx-box input { flex: 1; min-width: 0; height: 100%; padding: 0 14px; border: 0; outline: 0; background: none; color: var(--fieldtx); font: inherit; font-weight: 500; }
.sx-box input::placeholder { color: var(--ph); font-weight: 400; }
.sx-box button { border: 0; background: none; padding: 0 14px; color: var(--ph); display: grid; place-items: center; cursor: pointer; }
.sx-form .gold-btn, .sx-go { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--btn1), var(--btn2)); color: var(--btntx); font-weight: 700; font-size: 16px; text-transform: none; letter-spacing: 0; padding: 0 16px; box-shadow: none; cursor: pointer; }
.sx-form .gold-btn:hover:not(:disabled), .sx-go:hover:not(:disabled) { filter: brightness(1.06); box-shadow: none; }
.sx-form .gold-btn:disabled, .sx-go:disabled { opacity: .45; cursor: not-allowed; }
.sx-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; font-size: 14px; color: var(--tx2); }
.sx-row label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--tx2); font-weight: 400; }
.sx-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--btn2); }
.sx-or { display: flex; align-items: center; gap: 14px; margin: 22px 0 16px; color: var(--tx2); font-size: 14px; }
.sx-or::before, .sx-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sx-alt { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sx-alt a, .sx-alt button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--tx); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.sx-alt a:hover, .sx-alt button:hover { border-color: var(--tx2); } .sx-alt .ms { color: var(--link); }
.sx-form .lg-forgot { margin-top: 14px; } .sx-form .lg-forgot a, .sx-form .lg-forgot summary { color: var(--link); font-size: 14px; font-weight: 600; list-style: none; cursor: pointer; } .sx-form .lg-forgot summary::-webkit-details-marker { display: none; }
.sx-form .lg-forgot p { color: var(--tx2); }
.sx-msg { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.sx-msg.bad { background: rgba(220, 38, 38, .16); color: #ff9a9a; } .sx-msg.good { background: rgba(16, 185, 129, .14); color: #6ee7b7; }
.sx-prompt.error, .prompt.error { color: #ff9a9a !important; }
.sx-cnote { display: none; margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: rgba(239, 68, 68, .14); color: #ff9a9a; font-size: 14px; font-weight: 600; }
body.sx-offline .sx-cnote { display: block; }

/* the dial pad */
.sx-disp { display: flex; align-items: center; justify-content: center; height: 56px; margin: 8px 0 14px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--fieldtx); font: 700 26px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .3em; overflow: hidden; }
.sx-disp:empty { letter-spacing: normal; }
.sx-disp:empty::before { content: attr(data-empty); font: 400 14px Inter, Cairo, sans-serif; letter-spacing: 0; color: var(--ph); }
.sx-disp.shake { animation: sxsh .35s; } @keyframes sxsh { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.sx-lbl { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.sx-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.sx-key { height: 58px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .05); color: var(--tx); font: 700 22px/1 Inter, sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .08s, border-color .15s, background .15s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sx-key:hover { border-color: var(--btn2); } .sx-key:active { transform: scale(.96); background: color-mix(in srgb, var(--btn2) 18%, transparent); }
.sx-key.fn { font-size: 15px; color: var(--tx2); }
.sx-pad .sx-ok { grid-column: 1 / -1; margin-top: 2px; }
.sx-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.sx-quick button { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .04); color: var(--tx); text-align: start; cursor: pointer; min-width: 0; }
.sx-quick .av { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, var(--btn2) 22%, transparent); color: var(--link); font-weight: 800; font-size: 12px; }
.sx-quick b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sx-quick small { display: block; font-size: 11.5px; color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-cardbox { display: grid; gap: 14px; justify-items: center; text-align: center; }
.sx-cardbox .ic { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 24px; background: color-mix(in srgb, var(--btn2) 12%, transparent); border: 1px solid color-mix(in srgb, var(--btn2) 35%, transparent); color: var(--link); }
.sx-cardbox input { width: 100%; height: 48px; text-align: center; border-radius: 10px; background: var(--field); border: 1px solid var(--line); color: var(--link); font: 700 18px "JetBrains Mono", monospace; letter-spacing: .3em; outline: none; }
.sx-cardbox input::placeholder { letter-spacing: normal; font: 400 14px Inter, Cairo, sans-serif; color: var(--ph); }
.sx-back { background: none; border: 0; color: var(--tx2); font-size: 14px; cursor: pointer; } .sx-back:hover { color: var(--link); }

@media (max-width: 900px) {
  body.sx { grid-template-columns: 1fr; padding: 0; }
  .sx-art { min-height: 0; padding: 18px 20px 14px; } .sx-mid { padding-bottom: 0; gap: 14px; } .sx-logo { width: 230px; } .sx-info { display: none; }
  .sx-side { padding: 14px 22px 40px; }
  .sx-foot { gap: 16px; } .sx-cu { width: 168px; } .sx-cpop { bottom: 62px; }
}
@media (prefers-reduced-motion: reduce) { .sx-disp.shake { animation: none; } }

.sx-tbtn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--link) 40%, transparent); background: color-mix(in srgb, var(--link) 8%, transparent); color: var(--link); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.sx-tbtn:hover { background: color-mix(in srgb, var(--link) 20%, transparent); } .sx-tbtn.danger { border-color: rgba(244, 63, 94, .45); background: rgba(244, 63, 94, .1); color: #fda4af; } .sx-tbtn.danger:hover { background: #e11d48; color: #fff; }
.sx-tbtn svg { width: 16px; height: 16px; }

/* Every sign-in page fits its window: nothing scrolls. Sizes follow the window's height, and the least important lines go first when it is short. */
html, body.sx { height: 100vh; overflow: hidden !important; }
body.sx { min-height: 0; padding: 12px; grid-template-rows: minmax(0, 1fr); }
.sx-art { min-height: 0; height: 100%; padding: clamp(12px, 2.4vh, 24px) 34px clamp(10px, 2vh, 22px); }
.sx-mid { min-height: 0; gap: clamp(8px, 1.8vh, 22px); padding-top: clamp(4px, 3vh, 44px); }
.sx-logo { width: min(450px, calc(100% - 20px), 60vh); }
.sx-info { gap: clamp(5px, 1vh, 10px); }
.sx-info .r { padding: clamp(5px, 1.1vh, 11px) 16px; }
.sx-side { height: 100%; min-height: 0; overflow: hidden; padding: 8px 40px clamp(10px, 2vh, 30px); }
.sx-tools { margin-bottom: clamp(4px, 1.4vh, 18px); flex-wrap: nowrap; }
.sx-form { max-height: 100%; }
.sx-form h1 { font-size: clamp(22px, 4.2vh, 34px); }
.sx-form .sx-sub { margin-bottom: clamp(8px, 2.2vh, 26px); }
.sx-form .lg-field, .sx-in, .sx-box { height: clamp(38px, 5.8vh, 48px); }
.sx-form .gold-btn, .sx-go { height: clamp(40px, 6vh, 50px); }
.sx-row { margin-bottom: clamp(8px, 1.8vh, 20px); }
.sx-or { margin: clamp(8px, 1.8vh, 22px) 0 clamp(6px, 1.4vh, 16px); }
.sx-alt a, .sx-alt button { height: clamp(36px, 5.4vh, 46px); }
.sx-foot-note { margin-top: clamp(6px, 1.5vh, 22px); }
.sx-form .lg-forgot { margin-top: clamp(6px, 1.4vh, 14px); }
.sx-disp { height: clamp(38px, 5.8vh, 56px); margin: 6px 0 clamp(6px, 1.4vh, 14px); }
.sx-pad { gap: clamp(6px, 1.1vh, 10px); margin-bottom: clamp(6px, 1.4vh, 14px); }
.sx-key, .sx-key.fn { height: clamp(36px, 6.2vh, 58px); font-size: clamp(15px, 2.7vh, 20px); font-weight: 700; line-height: 1; }
.sx-quick { margin-top: clamp(6px, 1.4vh, 16px); }
@media (max-height: 660px) { .sx-form .sx-sub, .sx-foot-note { display: none; } }
@media (max-width: 900px) {
  body.sx { grid-template-rows: auto minmax(0, 1fr); padding: 0; }
  .sx-art { height: auto; padding: 10px 16px 6px; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
  .sx-mid { flex: 0 0 auto; padding: 0; } .sx-logo { width: min(130px, 16vh); } .sx-foot { display: none; }
  .sx-side { padding: 6px 18px 12px; }
}

/* the way back to the landing page, top left of every sign-in */
.sx-hub { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; margin-bottom: 4px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--link) 40%, transparent); background: color-mix(in srgb, var(--link) 8%, transparent); color: var(--link); font-size: 12px; font-weight: 700; text-decoration: none; transition: background .2s, transform .2s; }
.sx-hub:hover { background: color-mix(in srgb, var(--link) 20%, transparent); transform: translateX(-2px); } .sx-hub .ms { font-size: 16px; }

/* the Update button: a green dot while a new version is waiting, and a short line under it when there is none */
.sx-tbtn { position: relative; }
.sx-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .28); animation: sxdot 1.8s ease-in-out infinite; flex: none; }
@keyframes sxdot { 50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, .08); } }
.sx-note { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 30; white-space: nowrap; padding: 7px 12px; border-radius: 8px; background: #0a1124; border: 1px solid color-mix(in srgb, var(--link) 45%, transparent); color: var(--link); font-size: 12.5px; font-weight: 700; box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .9); animation: sxnote .25s ease both; pointer-events: none; }
@keyframes sxnote { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .sx-dot, .sx-note { animation: none; } }

body.sx, body.sx button, body.sx input { font-family: Inter, "Noto Kufi Arabic", Cairo, system-ui, sans-serif; }
body.sx :is(h1, .sx-mod b) { font-family: Outfit, "Noto Kufi Arabic", Inter, sans-serif; }

/* the Kanōn Manager app (phone and tablet): a bigger logo in the middle, no clock or appearance button, Powered By under the form */
body.sx.sx-app .sx-art { justify-content: center; padding-top: max(18px, env(safe-area-inset-top)); }
body.sx.sx-app .sx-logo { width: min(270px, 64vw, 30vh); }
body.sx.sx-app .sx-tools:empty { display: none; }
body.sx.sx-app .sx-app-pb { display: flex; margin: 16px auto 0; }
@media (max-width: 900px) { body.sx.sx-app .sx-mod { position: absolute; } }

/* ==== THEME OF THE SIGN-IN (login_theme.py) BEGIN ==== */
/* The sign-in page has no themes and nothing here depends on the modules' theme. Its own look: navy background with a blue circuit and gold buttons.
   A colour picked in the Appearance panel (--lg-custom, kept only for this page) tints the background, the animation, the buttons, the links and the focus rings. */
body.sx { --acc: var(--lg-custom, #cfa94e); --bgacc: var(--lg-custom, #3b6cf0); --btn1: color-mix(in srgb, var(--acc) 80%, #fff); --btn2: var(--acc); --btntx: var(--lg-custom-on, #1a1204);
  --link: color-mix(in srgb, var(--acc) 62%, #fff); --lg-bg: #030820; }
.sx-bg { background: radial-gradient(75% 95% at 62% 42%, color-mix(in srgb, var(--bgacc) 14%, var(--lg-bg)) 0%, var(--lg-bg) 56%, color-mix(in srgb, var(--lg-bg) 55%, #000) 100%); }
html.lg-day .sx-bg { background: radial-gradient(75% 95% at 62% 42%, color-mix(in srgb, var(--bgacc) 30%, #0e1b52) 0%, #0e1b52 56%, #050a22 100%); }
/* ==== THEME OF THE SIGN-IN END ==== */
.sx-bg::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 52%; z-index: 1; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .5) 38%); opacity: 0; transition: opacity .4s; }
html.lg-scene .sx-bg::after { opacity: 1; }
[dir="rtl"] .sx-bg::after { inset: 0 auto 0 0; transform: scaleX(-1); }

/* the two video backgrounds are played as they are: full cover, no tint, no vignette over them */
.sx-bg video.lg-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; background: #000; }
html.lg-video .sx-bg::before, html.lg-video .sx-bg::after { display: none; }
/* the video is bright and moving: the form sits on a frosted panel and the logo gets a soft shadow, the video itself is never touched */
html.lg-video .sx-form { background: color-mix(in srgb, #050a1e 60%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 26px; padding: clamp(20px, 3.2vh, 34px) clamp(20px, 3vw, 36px); box-shadow: 0 24px 60px -20px rgba(0, 10, 40, .6); }
html.lg-video .sx-logo, html.lg-video .sx-hub, html.lg-video .sx-foot { filter: drop-shadow(0 3px 14px rgba(0, 16, 56, .6)); }
