/* Adapted from supplied NowCRM Redesign/sorgenti/css/login.css. Loaded only by the auth layout. */
/* Schermata di accesso con la scena animata. */

#app {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  background: #fbfaf9;
  overflow: hidden;
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
}
#app.leaving {
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
}
.lg-stage {
  position: relative;
  overflow: hidden;
  background: #0a0b0f;
  color: #fff;
  isolation: isolate;
}
.lg-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.lg-aurora {
  position: absolute;
  inset: -20%;
  z-index: 0;
  filter: blur(80px) saturate(110%);
  opacity: 0.75;
}
.lg-aurora i {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
}
.lg-aurora i:nth-child(1) {
  width: 46%;
  height: 46%;
  left: 28%;
  top: 22%;
  background: radial-gradient(circle, #b0231f 0, rgba(176, 35, 31, 0) 70%);
  animation: au1 20s ease-in-out infinite alternate;
}
.lg-aurora i:nth-child(2) {
  width: 40%;
  height: 40%;
  left: -6%;
  bottom: -4%;
  background: radial-gradient(circle, #2a1f3d 0, rgba(42, 31, 61, 0) 70%);
  animation: au2 24s ease-in-out infinite alternate;
}
.lg-aurora i:nth-child(3) {
  width: 38%;
  height: 38%;
  right: -6%;
  top: -8%;
  background: radial-gradient(circle, #3b1d1c 0, rgba(59, 29, 28, 0) 70%);
  animation: au3 28s ease-in-out infinite alternate;
}
@keyframes au1 {
  to {
    transform: translate(8%, 10%) scale(1.12);
  }
}
@keyframes au2 {
  to {
    transform: translate(14%, -10%) scale(0.92);
  }
}
@keyframes au3 {
  to {
    transform: translate(-10%, 14%) scale(1.15);
  }
}
.lg-grid {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -2%;
  height: 46%;
  z-index: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(600px) rotateX(64deg);
  transform-origin: 50% 0;
  mask-image: linear-gradient(180deg, transparent 0, #000 30%, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30%, #000 70%, transparent 100%);
}
.lg-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.lg-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(110% 80% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
}
.lg-brand {
  position: absolute;
  z-index: 4;
  left: 48px;
  top: 40px;
}
.lg-brand .logo .wm {
  color: #fff;
  font-size: 22px;
}
.lg-tag {
  position: absolute;
  z-index: 4;
  left: 48px;
  right: 48px;
  bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.lg-tag p {
  margin: 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.62);
  max-width: 380px;
  line-height: 1.5;
}
.lg-tag p b {
  color: #fff;
  font-weight: 600;
}
.lg-tag .live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  white-space: nowrap;
}
.lg-tag .live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0.06);
  }
}
.lg-nodes {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.lg-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  opacity: 0;
  animation: nodeIn 1s var(--ease) forwards;
}
.lg-node:nth-child(2) {
  animation-delay: 0.1s;
}
.lg-node:nth-child(3) {
  animation-delay: 0.2s;
}
.lg-node:nth-child(4) {
  animation-delay: 0.3s;
}
.lg-node:nth-child(5) {
  animation-delay: 0.4s;
}
.lg-node:nth-child(6) {
  animation-delay: 0.5s;
}
.lg-node:nth-child(7) {
  animation-delay: 0.6s;
}
.lg-node:nth-child(8) {
  animation-delay: 0.7s;
}
@keyframes nodeIn {
  to {
    opacity: 1;
  }
}
.lg-node .ic {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.lg-node .ic svg {
  width: 22px;
  height: 22px;
  color: #fff;
  stroke-width: 1.6;
}
.lg-node.out .ic {
  border-color: rgba(255, 138, 128, 0.35);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(227, 52, 47, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.lg-node.out .ic svg {
  color: #ffb4b1;
}
.lg-node span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  white-space: nowrap;
}
.lg-node.core {
  width: 170px;
  height: 170px;
  gap: 0;
}
.lg-node.core .orb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  animation: spin 40s linear infinite;
}
.lg-node.core .orb.r2 {
  inset: 22px;
  border: 1.5px solid transparent;
  border-top-color: rgba(227, 52, 47, 0.9);
  border-right-color: rgba(227, 52, 47, 0.25);
  animation: spin 6s linear infinite;
}
.lg-node.core .orb.r3 {
  inset: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.lg-node.core .core-in {
  position: absolute;
  inset: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a1a1b, #0e0b0c 70%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  box-shadow:
    0 0 70px rgba(227, 52, 47, 0.42),
    0 0 0 10px rgba(227, 52, 47, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.lg-node.core .core-in svg {
  filter: drop-shadow(0 0 12px rgba(227, 52, 47, 0.55));
}

.lg-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.lg-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 50% 0%, rgba(227, 52, 47, 0.05), transparent 70%);
  pointer-events: none;
}
.lg-card {
  width: 100%;
  max-width: 392px;
  position: relative;
  animation: rise 0.9s var(--ease) both 0.1s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.lg-card .logo {
  margin-bottom: 38px;
}
.lg-card h2 {
  font-size: 27px;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  font-weight: 650;
}
.lg-card .sub {
  color: var(--muted);
  margin: 0 0 28px;
}
.lg-agency {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 22px;
  font-size: 13px;
}
.lg-agency .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-50);
}
.lg-agency span {
  color: var(--muted);
}
.lg-agency code {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--slate-50);
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}
.fl {
  position: relative;
  margin-bottom: 14px;
}
.fl input {
  width: 100%;
  height: 54px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 20px 44px 6px 14px;
  background: #fff;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-size: 15px;
}
.fl label {
  position: absolute;
  left: 15px;
  top: 17px;
  color: var(--muted);
  pointer-events: none;
  transition: all 0.18s var(--ease);
  font-size: 15px;
}
.fl input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(14, 17, 22, 0.06);
}
.fl input:focus + label,
.fl input:not(:placeholder-shown) + label {
  top: 8px;
  font-size: 11.5px;
  letter-spacing: 0.01em;
}
.fl .eye {
  position: absolute;
  right: 8px;
  top: 11px;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
}
.fl .eye:hover {
  background: var(--hover);
  color: var(--ink);
}
.fl.err input {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-50);
}
.fl .msg {
  font-size: 12px;
  color: var(--brand);
  margin: 6px 2px 0;
  display: none;
}
.fl.err .msg {
  display: block;
}
.caps {
  font-size: 12px;
  color: var(--brand-700);
  display: none;
  align-items: center;
  gap: 6px;
  margin: -6px 2px 12px;
}
.caps.on {
  display: flex;
}
.caps svg {
  width: 14px;
  height: 14px;
}
.lg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 22px;
  font-size: 13.5px;
}
.lg-row a {
  color: var(--ink);
  font-weight: 550;
  border-bottom: 1px solid transparent;
}
.lg-row a:hover {
  border-color: currentColor;
}
.btn-xl {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.15s,
    background 0.2s,
    box-shadow 0.2s;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 8px 20px -6px rgba(14, 17, 22, 0.4);
}
.btn-xl:hover {
  background: #000;
}
.btn-xl:active {
  transform: scale(0.99);
}
.btn-xl::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.18) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 0.8s;
}
.btn-xl:hover::after {
  transform: translateX(100%);
}
.btn-xl .spin {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sp 0.7s linear infinite;
  display: none;
}
.btn-xl.loading .spin {
  display: block;
}
.btn-xl.loading .t {
  opacity: 0.7;
}
.btn-xl.ok {
  background: var(--green);
}
@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}
.lg-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-2);
  font-size: 12px;
  margin: 22px 0;
}
.lg-sep::before,
.lg-sep::after {
  content: '';
  height: 1px;
  background: var(--line);
  flex: 1;
}
.lg-legal {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 12px;
  color: var(--muted);
}
.lg-legal a:hover {
  color: var(--ink);
}
.lg-charity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lg-charity svg {
  width: 13px;
  height: 13px;
  color: var(--brand);
}
.lg-ok {
  text-align: center;
  padding: 10px 0;
}
.lg-ok .okring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}
.lg-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 22px;
  border: 0;
  background: none;
  padding: 0;
}
.lg-back:hover {
  color: var(--ink);
}
.lg-back svg {
  width: 15px;
  height: 15px;
}

/* ---- Login chiaro (versione neutra NowCRM) ---- */
#app.light {
  background: #fff;
}
#app.light .lg-stage {
  background: #f4f4f6;
  color: var(--ink);
}
#app.light .lg-aurora i:nth-child(1) {
  background: radial-gradient(circle, #d9dce1 0, rgba(217, 220, 225, 0) 70%);
}
#app.light .lg-aurora i:nth-child(2) {
  background: radial-gradient(circle, #e8e9ec 0, rgba(232, 233, 236, 0) 70%);
}
#app.light .lg-aurora i:nth-child(3) {
  background: radial-gradient(circle, #e3e5e9 0, rgba(227, 229, 233, 0) 70%);
}
#app.light .lg-aurora {
  opacity: 1;
  filter: blur(60px);
}
#app.light .lg-grid {
  background-image: linear-gradient(rgba(14, 17, 22, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(14, 17, 22, 0.07) 1px, transparent 1px);
}
#app.light .lg-grain {
  opacity: 0.04;
}
#app.light .lg-vignette {
  background: radial-gradient(110% 80% at 50% 45%, transparent 50%, rgba(14, 17, 22, 0.08) 100%);
}
#app.light .lg-brand .logo {
  color: var(--ink) !important;
}
#app.light .lg-brand .logo .wm {
  color: var(--ink);
}
#app.light .lg-node.core .core-in svg rect {
  fill: #fff;
}
#app.light .lg-node.core .core-in svg path {
  stroke: #0e1116;
}
#app.light .lg-tag p {
  color: var(--muted);
}
#app.light .lg-tag p b {
  color: var(--ink);
}
#app.light .lg-tag .live {
  color: var(--muted);
}
#app.light .lg-node .ic {
  background: #fff;
  border-color: var(--line-2);
  box-shadow:
    0 10px 30px rgba(16, 24, 40, 0.08),
    0 1px 2px rgba(16, 24, 40, 0.04);
}
#app.light .lg-node .ic svg {
  color: var(--ink);
}
#app.light .lg-node.out .ic {
  border-color: #cfd3d9;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.1);
}
#app.light .lg-node.out .ic svg {
  color: var(--ink);
}
#app.light .lg-node span {
  color: var(--muted);
}
#app.light .lg-node.core .orb {
  border-color: rgba(14, 17, 22, 0.18);
}
#app.light .lg-node.core .orb.r2 {
  border-top-color: var(--ink);
  border-right-color: rgba(14, 17, 22, 0.25);
}
#app.light .lg-node.core .orb.r3 {
  border-color: rgba(14, 17, 22, 0.06);
}
#app.light .lg-node.core .core-in {
  background: radial-gradient(circle at 35% 30%, #2a2f37, #0e1116 70%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 60px rgba(14, 17, 22, 0.28),
    0 0 0 10px rgba(14, 17, 22, 0.04);
}
#app.light .lg-node.core .core-in svg {
  filter: none;
  color: #fff;
}
#app.light .lg-panel {
  border-left: 1px solid var(--line);
}
/* Laravel integration: preserve page scrolling, validation and real form controls. */
body[data-theme="nowcrm"].auth-layout { --ease:cubic-bezier(.2,.8,.2,1); background:#fff; }
body[data-theme="nowcrm"].auth-layout #app { position:relative; inset:auto; z-index:auto; min-height:100dvh; display:grid!important; grid-template-columns:1.12fr 1fr; overflow:visible; align-items:stretch!important; }
body[data-theme="nowcrm"].auth-layout .auth-container.lg-panel { width:100%; max-width:none; margin:0; align-self:stretch; padding:70px 32px 85px; min-width:0; }
body[data-theme="nowcrm"].auth-layout .lg-stage { min-height:100dvh; }
body[data-theme="nowcrm"] .lg-card h1 { font-size:27px; font-weight:650; letter-spacing:-.03em; margin:0 0 10px; }
body[data-theme="nowcrm"] .lg-card .sub { font-size:14px; }
body[data-theme="nowcrm"] .lg-card .logo { display:flex; align-items:center; gap:8px; color:#0e1116; margin-bottom:40px; }
.logo.now { display:inline-flex; align-items:center; gap:8px; color:#0e1116; }
.logo.now > svg { width:26px; flex:none; }
.logo.now .wm { font-size:23px; font-weight:650; letter-spacing:-1px; }
.logo.now .wm b { font-weight:450; color:#696969; }
.lg-node .ic svg { width:23px; height:23px; }
body[data-theme="nowcrm"] .lg-remember { display:flex; align-items:center; gap:10px; cursor:pointer; }
.lg-row .sw { position:relative; display:inline-flex; width:34px; height:20px; }
.lg-row .sw input { position:absolute; inset:0; opacity:0; width:100%; height:100%; cursor:pointer; }
.lg-row .sw i { pointer-events:none; width:34px; height:20px; background:#ccd0d5; border-radius:20px; }
.lg-row .sw i::before { content:''; display:block; width:16px; height:16px; margin:2px; border-radius:50%; background:#fff; box-shadow:0 1px 2px #0003; transition:transform .15s; }
.lg-row .sw input:checked + i { background:var(--ink); }
.lg-row .sw input:checked + i::before { transform:translateX(14px); }
.lg-row .sw input:focus-visible + i { outline:2px solid var(--ink); outline-offset:3px; }
.lg-security { display:flex; flex-wrap:wrap; justify-content:center; gap:18px; color:var(--muted); font-size:11.5px; }
.lg-security span { display:inline-flex; gap:6px; align-items:center; }
.lg-security svg,.fl .eye svg { width:16px; height:16px; }
.lg-legal a,.lg-row a { text-decoration:none; color:inherit; }
.lg-agency b { min-width:0; overflow-wrap:anywhere; }
.lg-legal { flex-wrap:wrap; padding:0 16px; }
@media(max-width:1100px) { .lg-tag { left:28px; right:28px; flex-wrap:wrap; gap:14px; } .lg-tag p { font-size:13px; } .lg-tag .live { font-size:10px; } }
@media(max-width:820px) { body[data-theme="nowcrm"].auth-layout #app { grid-template-columns:1fr; } .lg-stage { display:none; } body[data-theme="nowcrm"].auth-layout .auth-container.lg-panel { min-height:100dvh; padding:40px 24px 90px; } .lg-agency { flex-wrap:wrap; } }
@media(prefers-reduced-motion:reduce) { .lg-stage *, .lg-card, .btn-xl::after { animation:none!important; transition:none!important; } }
body[data-theme="nowcrm"].auth-layout .lg-panel > .card { width:100%; max-width:392px; }
@media(prefers-reduced-motion:reduce) { .lg-node { opacity:1; } }
