/* ─────────────────────────────────────────────────────────────────────────────
   EscalaSaúde — Tela de login (v2.1)
   Componente isolado do código legado: todas as classes começam com .lg-
   Paleta: marinho #102D59 · institucional #1457B8 · vibrante #2563EB · ciano #00C8F8 · suave #F2F7FF
   ───────────────────────────────────────────────────────────────────────────── */

.lg-root{
  --lg-navy:#102D59; --lg-blue:#1457B8; --lg-vivid:#2563EB; --lg-cyan:#00C8F8; --lg-soft:#F2F7FF;
  --lg-ink:#102D59; --lg-muted:#4b5d7a; --lg-line:#cfdcf1; --lg-danger:#b42318;
  --mx:0; --my:0;
  position:fixed; inset:0; z-index:9999; overflow-x:hidden; overflow-y:auto; -webkit-overflow-scrolling:touch;
  color:#fff; font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  background:
    radial-gradient(1100px 640px at 10% 6%, rgba(47,123,255,.55), transparent 62%),
    radial-gradient(860px 560px at 92% 18%, rgba(0,200,248,.34), transparent 58%),
    linear-gradient(135deg,#0d2549 0%,var(--lg-navy) 14%,var(--lg-blue) 52%,var(--lg-vivid) 100%);
}
.lg-root *,.lg-root *::before,.lg-root *::after{box-sizing:border-box}
.lg-shell{position:relative; min-height:100%; min-height:100dvh; display:flex; flex-direction:column;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.lg-icon{width:1em;height:1em;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

/* ── Fundo decorativo ─────────────────────────────────────────────────────── */
.lg-bg{position:absolute; inset:0; overflow:hidden; pointer-events:none}
.lg-hospital{position:absolute; left:-2%; top:0; width:min(46vw,640px); height:auto; opacity:.5}
.lg-glow{position:absolute; width:46vmax; height:46vmax; right:-12vmax; top:-14vmax; border-radius:50%;
  background:radial-gradient(circle,rgba(0,200,248,.30),transparent 62%); filter:blur(8px)}
.lg-waves{position:absolute; left:0; bottom:0; width:100%; height:min(30vh,260px)}
.lg-wave{position:absolute; left:0; bottom:0; width:200%; height:100%; animation:lg-drift 38s linear infinite}
.lg-wave.w2{animation-duration:54s; animation-direction:reverse; opacity:.7}
.lg-wave.w3{animation-duration:72s; opacity:.55}
.lg-particles i{position:absolute; left:var(--x); top:var(--y); width:var(--s); height:var(--s); border-radius:50%;
  background:rgba(255,255,255,.75); box-shadow:0 0 12px rgba(0,200,248,.9);
  opacity:.0; animation:lg-float var(--d) ease-in-out var(--dl) infinite}

/* ── Palco ────────────────────────────────────────────────────────────────── */
.lg-stage{position:relative; flex:1 1 auto; display:grid; align-items:center;
  grid-template-columns:minmax(0,1fr) minmax(320px,440px) minmax(0,1fr);
  gap:clamp(18px,3vw,56px); padding:clamp(16px,3.2vw,44px) clamp(16px,3vw,48px)}
.lg-side{position:relative; min-width:0; display:flex; flex-direction:column; gap:16px; pointer-events:none}
.lg-side-left{justify-self:end; align-items:flex-end}
.lg-side-right{justify-self:start; align-items:flex-start}

/* ── Cartão de login (vidro) ──────────────────────────────────────────────── */
.lg-card{position:relative; width:100%; color:var(--lg-ink); border-radius:30px; padding:clamp(24px,3vw,40px);
  background:linear-gradient(165deg,rgba(255,255,255,.94),rgba(238,245,255,.88));
  -webkit-backdrop-filter:blur(18px) saturate(150%); backdrop-filter:blur(18px) saturate(150%);
  border:1px solid rgba(255,255,255,.78);
  box-shadow:0 36px 90px -24px rgba(5,20,52,.62), 0 2px 0 rgba(255,255,255,.9) inset, 0 0 0 6px rgba(255,255,255,.07);
  animation:lg-rise .7s cubic-bezier(.2,.8,.2,1) both}
.lg-brand{display:flex; flex-direction:column; align-items:center; text-align:center}
.lg-logo{mix-blend-mode:multiply; width:100%; max-width:300px; height:auto; display:block; margin:0 auto 6px}
.lg-mark{width:68px; height:68px; filter:drop-shadow(0 8px 14px rgba(20,87,184,.35))}
.lg-title{margin:10px 0 2px; font-size:clamp(28px,3.4vw,38px); line-height:1.1; font-weight:800; letter-spacing:-.02em; color:var(--lg-navy)}
.lg-sub{margin:0; font-size:clamp(13px,1.3vw,15px); color:var(--lg-muted); line-height:1.4}
.lg-rule{display:block; width:68px; height:4px; margin:16px auto 22px; border-radius:4px;
  background:linear-gradient(90deg,var(--lg-vivid),var(--lg-cyan)); background-size:200% 100%; animation:lg-shimmer 3.2s linear infinite}

.lg-form{display:flex; flex-direction:column; gap:6px}
.lg-label{display:flex; align-items:center; gap:8px; margin:8px 0 6px; font-size:14px; font-weight:700; color:var(--lg-navy)}
.lg-label .lg-icon{font-size:17px; color:var(--lg-blue)}
.lg-field{position:relative; display:flex; align-items:center; min-height:50px; background:#fff;
  border:1.5px solid var(--lg-line); border-radius:14px; transition:border-color .18s, box-shadow .18s, transform .18s}
.lg-field > .lg-icon{position:absolute; left:14px; font-size:19px; color:#6b7f9f; transition:color .18s; pointer-events:none}
.lg-field input{width:100%; min-width:0; height:100%; min-height:48px; padding:12px 14px 12px 46px; border:0; background:transparent;
  font:inherit; font-size:16px; color:var(--lg-navy); outline:0; border-radius:14px}
.lg-field input::placeholder{color:#5b6b86; opacity:1}
.lg-field:hover{border-color:#a9c0e6}
.lg-field:focus-within{border-color:var(--lg-vivid); box-shadow:0 0 0 4px rgba(37,99,235,.20); transform:translateY(-1px)}
.lg-field:focus-within > .lg-icon{color:var(--lg-vivid)}
.lg-field[data-invalid="true"]{border-color:var(--lg-danger); box-shadow:0 0 0 4px rgba(180,35,24,.13)}
.lg-eye{position:relative; flex:none; width:46px; height:46px; margin-right:2px; display:grid; place-items:center;
  border:0; background:transparent; color:#4b5d7a; cursor:pointer; border-radius:12px; font-size:21px; transition:color .15s, background .15s, transform .15s}
.lg-eye:hover{color:var(--lg-vivid); background:rgba(37,99,235,.08)}
.lg-eye:active{transform:scale(.92)}
.lg-eye .lg-eye-off{display:none}
.lg-eye[aria-pressed="true"] .lg-eye-on{display:none}
.lg-eye[aria-pressed="true"] .lg-eye-off{display:block}

.lg-row{display:flex; align-items:center; justify-content:space-between; gap:10px 16px; flex-wrap:wrap; margin:8px 2px 4px}
.lg-check{position:relative; display:inline-flex; align-items:center; gap:10px; font-size:14px; font-weight:600; color:var(--lg-navy); cursor:pointer; min-height:32px}
.lg-check input{position:absolute; opacity:0; width:22px; height:22px; margin:0; cursor:pointer}
.lg-box{width:22px; height:22px; flex:none; display:grid; place-items:center; border-radius:7px; background:#fff;
  border:1.5px solid #8aa2c9; color:#fff; transition:background .15s, border-color .15s, transform .15s}
.lg-box .lg-icon{font-size:15px; stroke-width:3; opacity:0; transform:scale(.4); transition:opacity .15s, transform .18s}
.lg-check input:checked + .lg-box{background:var(--lg-vivid); border-color:var(--lg-vivid)}
.lg-check input:checked + .lg-box .lg-icon{opacity:1; transform:scale(1)}
.lg-check input:focus-visible + .lg-box{outline:3px solid var(--lg-cyan); outline-offset:2px}
.lg-check:active .lg-box{transform:scale(.92)}
.lg-hint{font-size:13px; color:var(--lg-muted)}

.lg-btn{position:relative; display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:54px; margin-top:12px;
  padding:12px 20px; border:0; border-radius:16px; cursor:pointer; font:inherit; font-size:18px; font-weight:800; letter-spacing:.01em; color:#fff;
  background:linear-gradient(90deg,var(--lg-blue) 0%,var(--lg-vivid) 100%);
  box-shadow:0 14px 28px -10px rgba(20,87,184,.7), 0 0 0 0 rgba(0,200,248,.0), inset 0 1px 0 rgba(255,255,255,.35);
  transition:transform .15s, box-shadow .2s, filter .2s}
.lg-btn .lg-icon{font-size:22px}
.lg-btn:hover{filter:brightness(1.06); box-shadow:0 18px 34px -10px rgba(20,87,184,.8), 0 0 0 5px rgba(0,200,248,.22), inset 0 1px 0 rgba(255,255,255,.35)}
.lg-btn:active{transform:translateY(1px) scale(.985)}
.lg-btn:focus-visible{outline:3px solid var(--lg-cyan); outline-offset:3px}
.lg-btn[disabled]{cursor:progress; filter:saturate(.8) brightness(.96)}
.lg-spinner{display:none; width:22px; height:22px; border-radius:50%; border:3px solid rgba(255,255,255,.4); border-top-color:#fff; animation:lg-spin .8s linear infinite}
.lg-btn[data-busy="true"] .lg-spinner{display:block}
.lg-btn[data-busy="true"] .lg-btn-icon{display:none}

.lg-err{min-height:22px; margin:8px 2px 0; font-size:14px; font-weight:600; color:var(--lg-danger); text-align:center; line-height:1.35}
.lg-err:not(:empty){padding:10px 12px; border-radius:12px; background:#fdecea; border:1px solid #f5c2bd; animation:lg-shake .4s}
.lg-resume{display:none; text-align:center; font-weight:700; color:var(--lg-navy); padding:18px 0 6px}
.lg-root[data-resuming="true"] .lg-form{display:none}
.lg-root[data-resuming="true"] .lg-resume{display:block}
.lg-resume .lg-spinner{display:block; margin:0 auto 12px; border-color:rgba(20,87,184,.25); border-top-color:var(--lg-vivid); width:30px; height:30px}

/* ── Ilustrações (dados 100% fictícios) ───────────────────────────────────── */
.lg-glass{background:linear-gradient(160deg,rgba(255,255,255,.20),rgba(255,255,255,.09)); border:1px solid rgba(255,255,255,.34);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); border-radius:22px; color:#fff;
  box-shadow:0 22px 50px -22px rgba(4,16,44,.7), inset 0 1px 0 rgba(255,255,255,.38)}
.lg-depth{transform:translate3d(calc(var(--mx)*var(--k,10)*1px),calc(var(--my)*var(--k,10)*1px),0); transition:transform .25s ease-out}
.lg-cal{width:min(100%,400px); padding:16px 16px 18px; animation:lg-slide-l .8s .1s cubic-bezier(.2,.8,.2,1) both}
.lg-cal-head{display:flex; align-items:center; gap:10px; font-weight:800; font-size:17px; margin-bottom:10px}
.lg-cal-head .lg-dots{display:flex; gap:5px; margin-left:auto}
.lg-cal-head .lg-dots i{width:8px; height:8px; border-radius:50%; background:rgba(255,255,255,.55)}
.lg-cal-week,.lg-cal-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:6px}
.lg-cal-week{font-size:11px; font-weight:700; text-align:center; opacity:.85; margin-bottom:6px}
.lg-cal-grid b{display:block; aspect-ratio:1.25; border-radius:8px; background:rgba(255,255,255,.14)}
.lg-cal-grid b.a{background:linear-gradient(135deg,#7ad8ff,#35b4f2)} .lg-cal-grid b.b{background:linear-gradient(135deg,#7aa2ff,#4d6ef5)}
.lg-cal-grid b.c{background:linear-gradient(135deg,#b5b0ff,#8b7dff)} .lg-cal-grid b.d{background:rgba(255,255,255,.34)}
.lg-shift{display:flex; align-items:center; gap:12px; width:min(100%,330px); padding:12px 14px; animation:lg-slide-l .8s cubic-bezier(.2,.8,.2,1) both}
.lg-shift.s1{animation-delay:.25s; margin-right:26px} .lg-shift.s2{animation-delay:.4s} .lg-shift.s3{animation-delay:.55s; margin-right:26px}
.lg-avatar{width:44px; height:44px; border-radius:50%; flex:none; display:grid; place-items:center; font-weight:800; font-size:17px;
  background:linear-gradient(135deg,#bfe9ff,#6fb7ff); color:#0d2e63; border:2px solid rgba(255,255,255,.85)}
.lg-avatar.v{background:linear-gradient(135deg,#d9ceff,#9a8bff)} .lg-avatar.g{background:linear-gradient(135deg,#c9f7ea,#5fd8b6)}
.lg-shift-t{flex:1; min-width:0; font-size:14px; font-weight:800; line-height:1.25}
.lg-shift-t small{display:flex; align-items:center; gap:5px; margin-top:3px; font-weight:600; font-size:12px; opacity:.92}
.lg-ok{width:26px; height:26px; flex:none; display:grid; place-items:center; border-radius:50%; background:#1fb86f; color:#fff; font-size:15px}
.lg-ok .lg-icon{stroke-width:3}
.lg-stat{width:min(100%,300px); padding:16px; animation:lg-slide-r .8s .2s cubic-bezier(.2,.8,.2,1) both}
.lg-stat h3,.lg-team h3{margin:0 0 12px; font-size:15px; font-weight:800}
.lg-ring-row{display:flex; align-items:center; gap:16px}
.lg-ring{--p:92; width:84px; height:84px; flex:none; border-radius:50%; display:grid; place-items:center; font-weight:800; font-size:20px;
  background:conic-gradient(var(--lg-cyan) calc(var(--p)*1%), rgba(255,255,255,.2) 0)}
.lg-ring span{display:grid; place-items:center; width:64px; height:64px; border-radius:50%; background:#1760c4}
.lg-bars{display:flex; align-items:flex-end; gap:6px; height:62px; flex:1}
.lg-bars i{flex:1; border-radius:5px 5px 2px 2px; background:linear-gradient(180deg,#8fe3ff,#3aa6ff); transform-origin:bottom; animation:lg-grow 1.1s cubic-bezier(.2,.8,.2,1) both}
.lg-team{width:min(100%,300px); padding:16px; animation:lg-slide-r .8s .38s cubic-bezier(.2,.8,.2,1) both}
.lg-team-row{display:flex; align-items:center}
.lg-team-row .lg-avatar{width:40px; height:40px; margin-left:-10px; font-size:15px} .lg-team-row .lg-avatar:first-child{margin-left:0}
.lg-more{margin-left:8px; font-weight:800; font-size:14px}
.lg-badge{position:absolute; width:74px; height:74px; border-radius:22px; display:grid; place-items:center; font-size:38px; color:#fff;
  background:linear-gradient(145deg,rgba(255,255,255,.34),rgba(255,255,255,.10)); border:1px solid rgba(255,255,255,.5);
  box-shadow:0 18px 36px -14px rgba(4,16,44,.7); animation:lg-bob 7s ease-in-out infinite}
.lg-badge.b1{right:-6px; top:-46px} .lg-badge.b2{left:-4px; bottom:-52px; width:64px; height:64px; font-size:32px; animation-delay:-3s}
.lg-note{font-size:11px; opacity:.8; margin:0}

/* ── Recursos e rodapé ────────────────────────────────────────────────────── */
.lg-features{position:relative; list-style:none; margin:0 auto; padding:14px clamp(16px,3vw,40px); width:min(100%,1180px);
  display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px}
.lg-features li{display:flex; align-items:center; gap:12px; padding:2px 14px; font-size:14px; font-weight:600; line-height:1.3; color:#fff}
.lg-features li + li{border-left:1px solid rgba(255,255,255,.28)}
.lg-features .lg-icon{font-size:34px; color:var(--lg-cyan); stroke-width:1.5}
.lg-footer{position:relative; margin-top:auto; padding:14px 18px calc(16px + env(safe-area-inset-bottom)); text-align:center;
  font-size:13px; line-height:1.6; color:#fff; text-shadow:0 1px 2px rgba(5,20,52,.45)}
.lg-footer p{margin:0}
.lg-footer .inst-sistema{opacity:.95}
.lg-footer nav ul{list-style:none; display:flex; flex-wrap:wrap; justify-content:center; gap:4px 18px; margin:6px 0 0; padding:0}
.lg-footer a{color:#fff; text-decoration:underline; text-underline-offset:3px; padding:6px 2px; display:inline-block}
.lg-footer a:hover{color:var(--lg-cyan)}
.lg-footer a:focus-visible{outline:3px solid var(--lg-cyan); outline-offset:2px; border-radius:4px}

/* ── Animações ────────────────────────────────────────────────────────────── */
@keyframes lg-rise{from{opacity:0; transform:translateY(26px) scale(.98)} to{opacity:1; transform:none}}
@keyframes lg-slide-l{from{opacity:0; transform:translateX(-34px)} to{opacity:1; transform:none}}
@keyframes lg-slide-r{from{opacity:0; transform:translateX(34px)} to{opacity:1; transform:none}}
@keyframes lg-drift{from{transform:translateX(0)} to{transform:translateX(-50%)}}
@keyframes lg-float{0%{opacity:0; transform:translateY(14px)} 20%{opacity:.85} 80%{opacity:.7} 100%{opacity:0; transform:translateY(-46px)}}
@keyframes lg-bob{0%,100%{transform:translateY(0) rotate(-3deg)} 50%{transform:translateY(-12px) rotate(3deg)}}
@keyframes lg-shimmer{from{background-position:0 0} to{background-position:-200% 0}}
@keyframes lg-spin{to{transform:rotate(360deg)}}
@keyframes lg-shake{0%,100%{transform:none} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)}}
@keyframes lg-grow{from{transform:scaleY(.1); opacity:.2} to{transform:scaleY(1); opacity:1}}

/* aba oculta ou aparelho modesto: sem animação contínua */
.lg-root[data-paused="true"] *,.lg-root[data-paused="true"] *::before{animation-play-state:paused !important}
.lg-root[data-lite="true"] .lg-particles,.lg-root[data-lite="true"] .lg-badge{display:none}
.lg-root[data-lite="true"] .lg-wave,.lg-root[data-lite="true"] .lg-rule{animation:none}
.lg-root[data-lite="true"] .lg-glass,.lg-root[data-lite="true"] .lg-card{-webkit-backdrop-filter:none; backdrop-filter:none}
@media (prefers-reduced-motion:reduce){
  .lg-root *,.lg-root *::before,.lg-root *::after{animation:none !important; transition-duration:.01ms !important}
  .lg-particles,.lg-badge{display:none}
  .lg-depth{transform:none !important}
}

/* ── Responsividade ───────────────────────────────────────────────────────── */
@media (max-width:1180px){                      /* notebook pequeno: ilustrações menores */
  .lg-stage{grid-template-columns:minmax(0,.8fr) minmax(320px,420px) minmax(0,.8fr)}
  .lg-cal{width:min(100%,300px)} .lg-cal-grid b{aspect-ratio:1.5} .lg-shift{width:min(100%,270px)} .lg-stat,.lg-team{width:min(100%,250px)}
  .lg-badge{display:none} .lg-features li{font-size:13px} .lg-features .lg-icon{font-size:28px}
}
@media (max-width:980px){                       /* tablet: formulário no centro, ilustração só no fundo */
  .lg-stage{grid-template-columns:minmax(0,1fr); justify-items:center; padding-top:clamp(18px,5vw,44px)}
  .lg-side{display:none}
  .lg-card{max-width:480px}
  .lg-features{grid-template-columns:repeat(3,minmax(0,1fr)); row-gap:14px}
  .lg-features li:nth-child(4){border-left:0}
  .lg-hospital{width:70vw; opacity:.32}
}
@media (max-width:640px){                       /* smartphone: formulário primeiro, sem decoração invasiva */
  .lg-features{display:none}
  .lg-hospital{display:none}
  .lg-stage{align-items:start; padding:clamp(14px,5vw,28px) 14px 8px}
  .lg-card{border-radius:24px; padding:22px 18px 20px}
  .lg-mark{width:56px; height:56px}
  .lg-rule{margin:12px auto 14px}
  .lg-row{flex-direction:column; align-items:flex-start}
  .lg-footer{font-size:12px}
}
@media (max-height:560px) and (orientation:landscape){   /* celular deitado / teclado aberto */
  .lg-features,.lg-hospital,.lg-side{display:none}
  .lg-stage{grid-template-columns:minmax(0,1fr); justify-items:center; align-items:start; padding-top:12px}
  .lg-card{max-width:440px; padding:12px 20px 10px; border-radius:22px}
  .lg-brand{flex-direction:row; gap:12px; justify-content:center}
  .lg-mark{width:38px; height:38px} .lg-logo{max-width:210px; margin:0} .lg-title{font-size:22px; margin:0} .lg-sub,.lg-rule,.lg-hint{display:none}
  .lg-brand{margin-bottom:2px}
  .lg-label{margin:4px 0 3px; font-size:13px} .lg-label .lg-icon{font-size:15px}
  .lg-field{min-height:44px} .lg-field input{min-height:42px; padding-top:8px; padding-bottom:8px}
  .lg-row{margin:4px 2px 0} .lg-btn{min-height:46px; margin-top:6px; font-size:16px}
  .lg-err{min-height:14px; margin-top:4px; font-size:13px}
  .lg-footer{padding-top:6px; padding-bottom:8px; font-size:11px}
}
@media (min-width:1900px){.lg-stage{grid-template-columns:minmax(0,1fr) minmax(380px,480px) minmax(0,1fr)} .lg-title{font-size:42px} .lg-cal{width:460px} .lg-shift{width:380px} .lg-stat,.lg-team{width:340px}}
@media (forced-colors:active){.lg-field,.lg-btn,.lg-box{border:2px solid ButtonText}}
