/* Both sign-in pages, one design (templates/cloud_login.html, login.html; the brand side: templates/_sign_in.html;
   docs/brand.md). The side carries Evox ERP's dominant colour in both themes, with the full logo built as the page
   opens and the network growing out of its pixel heart; the form follows the theme (tokens.css) and is ready from the
   first moment. Only the content differs between the two pages. */

:root{--si-ease:cubic-bezier(.22,.75,.25,1)}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;min-height:100%}
body{
  min-height:100dvh;overflow-x:hidden;background:var(--bg);color:var(--ink);
  font-family:var(--font-ui,"Tajawal","Segoe UI",Tahoma,sans-serif);
}
.si{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(380px,.85fr);min-height:100dvh}

/* ---------------------------------------------------------------- the brand side */
.si-side{
  position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;gap:14px;
  padding:44px 52px;color:#eaf4f2;
  background:
    radial-gradient(75% 55% at 85% 10%,rgba(20,184,166,.32),transparent 62%),
    radial-gradient(70% 70% at 8% 92%,rgba(45,212,191,.14),transparent 60%),
    linear-gradient(160deg,var(--evx-3),var(--evx-2) 45%,var(--evx-1));
}
.si-side::after{                                    /* a fine grid that fades toward the edges */
  content:"";position:absolute;inset:0;z-index:-1;opacity:.4;background-size:30px 30px;
  background-image:linear-gradient(rgba(255,255,255,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.06) 1px,transparent 1px);
  -webkit-mask-image:radial-gradient(70% 60% at 55% 55%,#000,transparent);mask-image:radial-gradient(70% 60% at 55% 55%,#000,transparent);
}
/* the full logo leads the side: the mark, EVOX ERP, the tagline */
.si-lockup{display:flex;align-items:center;gap:18px;direction:ltr;justify-content:flex-end}
.si-mark{width:clamp(70px,8vw,118px);flex:none}
.si-words{display:grid;gap:6px}
.si-words .evx-name{font-size:clamp(26px,3vw,42px);line-height:1;display:flex;gap:.22em}
.si-words .evx-tagline{font-size:clamp(10px,.95vw,13px)}
.si-kind{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:700;color:rgba(234,244,242,.82);animation:si-fade-up .5s ease-out 1.8s both}
.si-kind::before{content:"";flex:none;width:8px;height:8px;border-radius:2px;background:#2dd4bf;box-shadow:0 0 10px rgba(45,212,191,.9)}

/* the network: the server (the logo's pixels) in the middle, the devices or the sections around it */
/* as large as the screen's height leaves beside the logo, so the page never scrolls on a laptop */
.si-net{position:relative;width:min(100%,clamp(240px,calc(100dvh - 250px),500px));aspect-ratio:1;align-self:center;margin-block:auto}
.si-net svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.si-orbit{fill:none;stroke:rgba(255,255,255,.1);stroke-width:1;transform-origin:260px 260px}
.si-orbit.a{stroke-dasharray:2 10;animation:si-grow .6s ease-out 1s both,si-spin 60s linear infinite}
.si-orbit.b{stroke-dasharray:1 7;animation:si-grow .6s ease-out 1.05s both,si-spin 90s linear infinite reverse}
.si-orbit.c{stroke:rgba(94,234,212,.16);animation:si-grow .6s ease-out .95s both}
.si-link{fill:none;stroke:rgba(94,234,212,.3);stroke-width:1.4;stroke-dasharray:1;animation:si-draw .5s ease-out calc(1.05s + var(--i) * .06s) both}
/* square data packets running along the links */
.si-flow{fill:none;stroke:#5eead4;stroke-width:7;stroke-dasharray:2.8 38.7;filter:drop-shadow(0 0 5px rgba(94,234,212,.85));
  animation:si-fade .4s ease-out 1.8s both,si-flow 3.6s linear infinite}
.si-flow:nth-of-type(2n){animation:si-fade .4s ease-out 1.85s both,si-flow 4.4s linear -1.2s infinite}
.si-flow:nth-of-type(3n){animation:si-fade .4s ease-out 1.9s both,si-flow 5.2s linear -2.4s infinite}
.si-node,.si-node-dot,.si-hub{transform-box:fill-box;transform-origin:center}
.si-node{fill:rgba(0,0,0,.22);stroke:rgba(94,234,212,.7);stroke-width:1.5;animation:si-pop .4s cubic-bezier(.3,1.5,.5,1) calc(1.35s + var(--i) * .06s) both}
.si-node-dot{fill:#5eead4;animation:si-pop .4s cubic-bezier(.3,1.5,.5,1) calc(1.4s + var(--i) * .06s) both,si-blink 2.6s ease-in-out 2.2s infinite}
.si-label{fill:rgba(234,244,242,.78);font-family:inherit;font-size:15px;font-weight:700;animation:si-fade .4s ease-out calc(1.5s + var(--i) * .06s) both}
.si-ring{fill:none;stroke:rgba(94,234,212,.45);stroke-width:1.5;transform-origin:260px 260px;animation:si-fade .3s 1.7s both,si-pulse 3.2s ease-out 1.7s infinite}
.si-ring.late{animation:si-fade .3s 3.3s both,si-pulse 3.2s ease-out 3.3s infinite}
.si-hub{animation:si-pop .45s cubic-bezier(.3,1.5,.5,1) .7s both}
.si-hub-frame{fill:#0c5551;stroke:rgba(94,234,212,.55);stroke-width:1.5}   /* solid: the links end at its edge */
.si-hp{fill:#2dd4bf;transform-box:fill-box;transform-origin:center;animation:si-breathe 2.8s ease-in-out infinite}
.si-hp.alt{fill:#99f6e4}
.si-hp:nth-child(2){animation-delay:-.5s}.si-hp:nth-child(3){animation-delay:-1.1s}.si-hp:nth-child(4){animation-delay:-1.6s}.si-hp:nth-child(5){animation-delay:-2.2s}

/* ---------------------------------------------------------------- the form */
.si-main{position:relative;display:grid;place-items:center;padding:40px 32px;background:var(--surface);isolation:isolate}
.si-main::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:radial-gradient(60% 40% at 50% 0%,rgba(20,184,166,.08),transparent 70%)}
.si-card{width:min(380px,100%);animation:si-fade-up .6s .15s var(--si-ease) both}
/* the company on its own link, above the form */
.si-company{display:flex;align-items:center;gap:12px;margin-bottom:18px}
.si-company-logo{flex:none;width:56px;height:56px;border-radius:14px;display:grid;place-items:center;padding:6px;overflow:hidden;
  background:#ffffff;border:1px solid var(--line);box-shadow:var(--shadow-sm)}
.si-company-logo img{max-width:100%;max-height:100%;object-fit:contain}
.si-company b{font-size:18px;font-weight:800;color:var(--ink);line-height:1.4}
.si-title{margin:0 0 4px;font-size:24px;font-weight:800;color:var(--ink)}
.si-sub{margin:0 0 22px;font-size:13px;font-weight:600;color:var(--muted)}
.si-sub b{font-weight:700;direction:ltr;unicode-bidi:isolate}
.si-msg{display:flex;align-items:center;gap:8px;margin-bottom:14px;padding:11px 13px;border-radius:12px;
  background:var(--danger-soft);border:1px solid var(--danger-line);color:var(--danger);font-size:13px;font-weight:700;line-height:1.6;
  animation:si-shake .45s ease both}
.si-msg.is-note{background:var(--warning-soft);border-color:var(--warning-line);color:var(--ink);animation:none}
.si-msg svg{flex:none;width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2}
/* the company file the sign-in goes to */
.si-file{display:flex;align-items:center;gap:12px;margin-bottom:16px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
.si-file svg{width:22px;height:22px;flex:none;fill:none;stroke:var(--accent);stroke-width:1.7}
.si-file-meta{display:grid;min-width:0;flex:1}
.si-file-meta small{color:var(--muted);font-size:11px}
.si-file-meta b{font-size:14px;font-weight:700;word-break:break-word}
.si-file-meta b.is-empty{color:var(--muted);font-weight:500}
.si-file em{display:inline-flex;align-items:center;gap:6px;font-style:normal;font-size:11px;font-weight:700;color:var(--success);white-space:nowrap}
.si-file em::before{content:"";width:7px;height:7px;border-radius:2px;background:currentColor}

.si-form{display:grid;gap:14px}
.si-field{position:relative}
.si-field input{
  width:100%;height:52px;padding:18px 44px 6px 44px;border-radius:14px;
  border:1.5px solid var(--line-strong);background:var(--surface-2);color:var(--ink);font:inherit;font-size:15px;font-weight:600;
  transition:border-color .25s,box-shadow .25s,background .25s;
}
.si-field input:focus{outline:0;border-color:var(--accent);background:var(--surface);box-shadow:0 0 0 4px rgba(var(--accent-rgb),.14)}
.si-field label{
  position:absolute;right:44px;top:50%;transform:translateY(-50%);transform-origin:right center;pointer-events:none;
  font-size:14px;font-weight:700;color:var(--muted);transition:transform .25s var(--si-ease),color .25s,top .25s var(--si-ease);
}
.si-field input:focus + label,.si-field input:not(:placeholder-shown) + label{top:15px;transform:translateY(-50%) scale(.78);color:var(--accent)}
.si-field .si-ico{position:absolute;right:15px;top:50%;width:18px;height:18px;transform:translateY(-50%);
  fill:none;stroke:var(--muted);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:stroke .25s;pointer-events:none}
.si-field input:focus ~ .si-ico{stroke:var(--accent)}
.si-eye{position:absolute;left:8px;top:50%;transform:translateY(-50%);width:34px;height:34px;border:0;border-radius:10px;
  background:transparent;color:var(--muted);cursor:pointer;display:grid;place-items:center;transition:background .2s,color .2s}
.si-eye:hover{background:var(--surface-3);color:var(--ink)}
.si-eye svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.si-eye .off{display:none}
.si-eye[aria-pressed="true"] .on{display:none}
.si-eye[aria-pressed="true"] .off{display:block}
.si-submit{
  position:relative;overflow:hidden;width:100%;height:52px;margin-top:6px;border:0;border-radius:14px;cursor:pointer;
  background:linear-gradient(135deg,var(--evx-2),var(--evx-3) 55%,var(--evx-teal));color:#ffffff;
  font:inherit;font-size:15px;font-weight:800;letter-spacing:.2px;
  box-shadow:0 12px 26px rgba(20,184,166,.26);transition:transform .2s var(--si-ease),box-shadow .25s;
}
.si-submit:hover{transform:translateY(-1px);box-shadow:0 16px 32px rgba(20,184,166,.36)}
.si-submit:active{transform:translateY(0) scale(.99)}
.si-submit:focus-visible{outline:3px solid rgba(20,184,166,.45);outline-offset:3px}
.si-submit::after{content:"";position:absolute;inset:0;transform:translateX(120%);
  background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.3) 50%,transparent 70%);animation:si-shine 3.8s 1.2s ease-in-out infinite}
.si-submit span{position:relative;display:inline-flex;align-items:center;gap:9px}
.si-spin{display:none;width:18px;height:18px;border-radius:50%;border:2.5px solid rgba(255,255,255,.35);border-top-color:#fff;animation:si-spin .8s linear infinite}
.si-submit.is-busy{pointer-events:none}
.si-submit.is-busy .si-spin{display:inline-block}
.si-back{display:grid;place-items:center;height:46px;border:1.5px solid var(--line-strong);border-radius:14px;
  color:var(--ink-2);font-size:14px;font-weight:700;text-decoration:none;transition:background .2s,border-color .2s}
.si-back:hover{background:var(--surface-2);border-color:var(--accent-line)}
.si-back:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.si-foot{display:flex;align-items:center;justify-content:center;gap:7px;margin-top:22px;font-size:12px;font-weight:700;color:var(--muted)}
.si-foot svg{width:14px;height:14px;fill:none;stroke:var(--evx-teal);stroke-width:2}

/* ---------------------------------------------------------------- motion */
@keyframes si-fade-up{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes si-fade{from{opacity:0}to{opacity:1}}
@keyframes si-grow{from{opacity:0;transform:scale(.4)}to{opacity:1;transform:none}}
@keyframes si-draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@keyframes si-pop{from{opacity:0;transform:scale(0)}to{opacity:1;transform:none}}
@keyframes si-spin{to{transform:rotate(360deg)}}
@keyframes si-flow{from{stroke-dashoffset:41.5}to{stroke-dashoffset:0}}
@keyframes si-blink{50%{opacity:.3}}
@keyframes si-pulse{0%{transform:scale(.75);opacity:.9}100%{transform:scale(1.9);opacity:0}}
@keyframes si-breathe{0%,100%{opacity:.55;transform:scale(.86)}50%{opacity:1;transform:none}}
@keyframes si-shine{0%,55%{transform:translateX(120%)}85%,100%{transform:translateX(-120%)}}
@keyframes si-shake{20%{transform:translateX(-6px)}40%{transform:translateX(6px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* a short laptop screen: less room around both halves */
@media (min-width:901px) and (max-height:760px){
  .si-side{padding-block:28px}
  .si-main{padding-block:24px}
}

/* ---------------------------------------------------------------- narrow screens: the logo stays on top, the
   network quiet behind it */
@media (max-width:900px){
  .si{grid-template-columns:1fr;grid-template-rows:auto 1fr}
  .si-side{padding:20px 18px 18px;gap:10px}
  .si-mark{width:58px}
  .si-words .evx-name{font-size:26px}
  .si-kind{font-size:12.5px}
  .si-net{position:absolute;inset:auto auto -80px -60px;width:230px;margin:0;opacity:.45;z-index:-1}
  .si-label{display:none}
  .si-main{place-items:start center;padding:26px 16px 32px}
  .si-title{font-size:21px}
}
