/* cnc-auth.css — shared by the login page and the Nexus /access page:
   split screen with the animated lathe on the left (_CncVisual.cshtml) and the
   page's own panel on the right. On a desktop it fits the window exactly —
   the lathe scales to whatever height is left, nothing scrolls. */
:root {
    --lg-primary: #7367f0;
    --lg-ink: #2f2b3d;
    --lg-muted: #6d6b77;
    --lg-cyan: #3fd0f0;
    --lg-green: #2dd48f;
    --lg-amber: #ffb020;
    --lg-red: #ff5f52;
}
html, body { height: 100%; margin: 0; }
body { background: #f6f6fb; font-family: 'Public Sans', system-ui, sans-serif; }

/* ================= layout ================= */
.lg-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
@media (min-width: 992px) {
    .lg-shell { height: 100vh; height: 100dvh; }
    .lg-visual { min-height: 0; overflow: hidden; }
    .lg-side { min-height: 0; overflow-y: auto; }      /* only on a really short window */
}

/* ---------- left: the shop floor ---------- */
.lg-visual {
    position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column;
    padding: clamp(1rem, 3.2vh, 2.4rem) clamp(1.5rem, 3vw, 3rem) clamp(.9rem, 2.6vh, 2rem);
    background:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 28px 28px,
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 28px 28px,
        radial-gradient(120% 80% at 80% 0%, #4a3fc4 0%, transparent 60%),
        linear-gradient(160deg, #1d1850 0%, #241d63 45%, #15123a 100%);
}
.lg-visual::after {            /* soft glow behind the machine */
    content: ""; position: absolute; left: 50%; top: 45%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(115,103,240,.35), transparent 65%); pointer-events: none;
}
.lg-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: .9rem; flex: 0 0 auto; }
.lg-brand img { height: clamp(2.1rem, 5vh, 2.6rem); background: #fff; border-radius: .55rem; padding: .3rem .5rem; box-shadow: 0 .4rem 1rem rgba(0,0,0,.25); }
.lg-brand b { display: block; font-size: 1.05rem; letter-spacing: .02em; }
.lg-brand small { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); }

/* the lathe takes all the height that is left and scales down to it */
.lg-machine { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: clamp(.3rem, 1.6vh, 1rem) 0; }
.lg-machine svg { width: 100%; height: 100%; max-width: 640px; overflow: visible; }

.lg-copy { position: relative; z-index: 1; flex: 0 0 auto; }
.lg-copy h2 { color: #fff; font-weight: 700; font-size: clamp(1.35rem, 3.4vh, 2rem); line-height: 1.15; margin: 0 0 .45rem; letter-spacing: -.01em; }
.lg-copy h2 span { background: linear-gradient(90deg, var(--lg-cyan), #a99bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-copy p { color: rgba(255,255,255,.72); max-width: 34rem; margin: 0 0 clamp(.6rem, 1.7vh, 1.2rem); font-size: clamp(.82rem, 1.8vh, .95rem); }
.lg-feats { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.lg-feats li { display: inline-flex; align-items: center; gap: .45rem; padding: .38rem .78rem; border-radius: 99px; font-size: .8rem;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(4px); }
.lg-feats i { color: var(--lg-cyan); font-size: 1rem; }
.lg-foot { position: relative; z-index: 1; flex: 0 0 auto; margin-top: clamp(.5rem, 2vh, 1.4rem); font-size: .75rem; color: rgba(255,255,255,.45); }

/* a short window keeps the machine and the headline, drops the small print */
@media (max-height: 720px) {
    .lg-copy p, .lg-foot { display: none; }
}

/* ---------- right panel ---------- */
.lg-side { display: flex; align-items: center; justify-content: center; padding: clamp(1.2rem, 4vh, 2.5rem) 1.5rem; }
.lg-mobile-brand { display: none; text-align: center; margin-bottom: 1.6rem; }
.lg-mobile-brand img { height: 3rem; }

@media (max-width: 991.98px) {
    .lg-shell { grid-template-columns: 1fr; }
    .lg-visual { display: none; }
    .lg-mobile-brand { display: block; }
}

/* ================= the lathe ================= */
.cnc .ln { fill: none; stroke: rgba(255,255,255,.62); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.cnc .fill { fill: rgba(255,255,255,.06); }
.cnc .dim { stroke: rgba(63,208,240,.55); stroke-width: 1; stroke-dasharray: 4 4; fill: none; }
.cnc .lbl { fill: rgba(255,255,255,.7); font: 600 10px 'JetBrains Mono', monospace; letter-spacing: .06em; }
.cnc .lbl.c { fill: var(--lg-cyan); }
.cnc .rd { fill: #fff; font: 700 12px 'JetBrains Mono', monospace; }

/* spindle + chuck spin */
.cnc .chuck { transform-box: fill-box; transform-origin: center; animation: cncSpin .7s linear infinite; }
@keyframes cncSpin { to { transform: rotate(360deg); } }
/* light sweeping across the turning bar = rotation */
.cnc .sheen { animation: cncSheen .7s linear infinite; }
@keyframes cncSheen { from { transform: translateY(-30px); } to { transform: translateY(30px); } }
/* carriage traverses along Z */
.cnc .carriage { animation: cncFeed 7s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
@keyframes cncFeed { from { transform: translateX(0); } to { transform: translateX(150px); } }
/* cutting glow + chips */
.cnc .spark { transform-box: fill-box; transform-origin: center; animation: cncSpark .35s ease-in-out infinite alternate; }
@keyframes cncSpark { from { opacity: .55; transform: scale(.7); } to { opacity: 1; transform: scale(1.25); } }
.cnc .chip { opacity: 0; transform-box: fill-box; transform-origin: center; animation: cncChip 1.1s ease-out infinite; }
.cnc .chip:nth-of-type(2) { animation-delay: .28s; --dx: -18px; }
.cnc .chip:nth-of-type(3) { animation-delay: .55s; --dx: 14px; }
.cnc .chip:nth-of-type(4) { animation-delay: .8s; --dx: -8px; }
@keyframes cncChip {
    0% { opacity: 1; transform: translate(0, 0) rotate(0); }
    100% { opacity: 0; transform: translate(var(--dx, 22px), 34px) rotate(260deg); }
}
/* coolant */
.cnc .drop { opacity: 0; animation: cncDrop .9s linear infinite; }
.cnc .drop:nth-of-type(2) { animation-delay: .3s; }
.cnc .drop:nth-of-type(3) { animation-delay: .6s; }
@keyframes cncDrop { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: .9; } 100% { opacity: 0; transform: translateY(16px); } }
/* controller screen */
.cnc .scr-bar { transform-box: fill-box; transform-origin: bottom; animation: cncBar 2.4s ease-in-out infinite alternate; }
@keyframes cncBar { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
.cnc .led { animation: cncLed 1.6s ease-in-out infinite; }
@keyframes cncLed { 50% { opacity: .25; } }
/* utilisation dial */
.cnc .dial-arc { stroke-dasharray: 163; stroke-dashoffset: 163; animation: cncDial 6s ease-in-out infinite; transform: rotate(-90deg); transform-origin: 112px 66px; }
@keyframes cncDial { 0% { stroke-dashoffset: 163; } 35%, 70% { stroke-dashoffset: 42; } 100% { stroke-dashoffset: 163; } }
/* 24-hour strip grows in once, then breathes */
.cnc .hr { transform-box: fill-box; transform-origin: bottom; animation: cncHr .9s cubic-bezier(.3, 1.4, .5, 1) both, cncBreath 3.2s ease-in-out 1.6s infinite alternate; }
@keyframes cncHr { from { transform: scaleY(0); } }
@keyframes cncBreath { to { transform: scaleY(.82); } }

@media (prefers-reduced-motion: reduce) {
    .cnc *, .lg-shell * { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* slim scrollbars (only the right panel can ever scroll) */
* { scrollbar-width: thin; scrollbar-color: rgba(115, 103, 240, .4) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(115, 103, 240, .35); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
