/* PROTEGIDO · DEV The Fiber — login do aplicativo de campo (luzes suaves).
   Não substituir por cópia do notebook nem por versão antiga. .cursor/rules/melhorias-protegidas.mdc
   Login mobile TheFiber — Conexão Viva. A marca e a autenticação vêm da API. */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; min-height: 100dvh; font-family: "IBM Plex Sans", sans-serif; }
html[data-theme="dark"], html:not([data-theme]) {
  --accent: #9853e8 !important;
  --login-bg: #101426;
  --login-surface: #1b2137;
  --login-edge: #363d5b;
  --login-fg: #f7f5ff;
  --login-muted: #b5bdd3;
  --login-panel: #252047;
  --login-panel-edge: #56427b;
  --login-chip: #3e305f;
  --login-orb: #543290;
  --login-button: #9853e8;
  --login-foot: #25243e;
  --theme-meta: #101426 !important;
  color-scheme: dark;
}
html[data-theme="light"] {
  --accent: #7835c5 !important;
  --login-bg: #f8f7fc;
  --login-surface: #fff;
  --login-edge: #e2ddec;
  --login-fg: #211c36;
  --login-muted: #6e6a80;
  --login-panel: #f3edff;
  --login-panel-edge: #d9c8f2;
  --login-chip: #e6d9fa;
  --login-orb: #d9c4fa;
  --login-button: #7835c5;
  --login-foot: #f0ebf9;
  --theme-meta: #f8f7fc !important;
  color-scheme: light;
}
body [hidden] { display: none !important; }
html body, html body.branded {
  background: var(--login-bg) !important;
  background-image: none !important;
  color: var(--login-fg);
  padding: max(1rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
}
.login-glow {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.login-glow span {
  position: absolute;
  border-radius: 50%;
  filter: blur(52px);
  will-change: transform;
}
.login-glow span:nth-child(1) {
  width: min(46vw, 280px);
  height: min(46vw, 280px);
  left: -12%;
  top: 6%;
  background: color-mix(in srgb, var(--accent) 62%, transparent);
  opacity: .55;
  animation: loginDrift 18s ease-in-out infinite;
}
.login-glow span:nth-child(2) {
  width: min(38vw, 220px);
  height: min(38vw, 220px);
  right: -14%;
  bottom: 4%;
  background: color-mix(in srgb, #49c2ed 50%, transparent);
  opacity: .42;
  animation: loginDrift 22s ease-in-out infinite reverse;
}
.login-glow span:nth-child(3) {
  width: min(28vw, 160px);
  height: min(28vw, 160px);
  left: 42%;
  top: 38%;
  background: color-mix(in srgb, var(--accent) 40%, #49c2ed);
  opacity: .22;
  animation: loginDrift 26s ease-in-out infinite;
  animation-delay: -8s;
}
html[data-theme="light"] .login-glow span:nth-child(1) { opacity: .28; }
html[data-theme="light"] .login-glow span:nth-child(2) { opacity: .22; }
html[data-theme="light"] .login-glow span:nth-child(3) { opacity: .14; }
@keyframes loginDrift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(22px, -28px, 0) scale(1.08); }
}
@keyframes loginRise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes loginSheen {
  0%, 62% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}
@keyframes loginBtnGlow {
  0%, 100% { box-shadow: 0 8px 22px color-mix(in srgb, var(--login-button) 22%, transparent); }
  50% { box-shadow: 0 14px 34px color-mix(in srgb, var(--login-button) 40%, transparent); }
}
@keyframes loginPulse {
  0% { transform: scale(.86); opacity: .5; }
  70%, 100% { transform: scale(1.35); opacity: 0; }
}
body .wrap {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  min-height: 0;
  margin: 0 auto;
}
body .logo-chip { display: inline-flex; align-items: center; }
body .logo-chip img { display: block; object-fit: contain; }
body .brand-row { position: relative; }
body .theme-toggle { display: grid; place-items: center; cursor: pointer; }
body .theme-toggle svg { width: 20px; height: 20px; }
body .theme-toggle .ico-sun { display: none; }
html[data-theme="light"] body .theme-toggle .ico-sun { display: block; }
html[data-theme="light"] body .theme-toggle .ico-moon { display: none; }
body .stage { padding-top: 4px; }
body .login-top { margin: 0 0 28px; animation: loginRise .7s ease both; }
body .login-head { animation: loginRise .75s .1s ease both; }
body .brand-row {
  max-width: none; min-height: 0; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 0;
}
body .brand-lock { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
body .logo-chip {
  padding: 0; border: 0; background: transparent; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
body .logo-chip img { width: 132px; max-width: 100%; max-height: 36px; }
body .nome-fallback { color: var(--login-fg); font: 700 1.05rem/1 Manrope, sans-serif; letter-spacing: -.02em; }
body .theme-toggle {
  position: static; z-index: 1; flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--login-surface); border: 1px solid var(--login-edge);
  color: var(--login-muted); box-shadow: none;
}
body .theme-toggle:hover { color: var(--login-fg); border-color: color-mix(in srgb, var(--accent) 35%, var(--login-edge)); }
body .theme-toggle:focus-visible, body .eye:focus-visible, body .enter:focus-visible,
body .choose button:focus-visible { outline: 3px solid #53bde9; outline-offset: 3px; }
.hero-mobile {
  height: 226px; border-radius: 29px; position: relative; isolation: isolate;
  overflow: hidden; background: var(--login-panel); border: 1px solid var(--login-panel-edge);
}
.hero-mobile::before {
  content: ""; position: absolute; width: 164px; height: 164px;
  right: -2px; top: 33px; border-radius: 50%;
  background: var(--login-orb); opacity: .62;
}
.hero-copy { position: relative; z-index: 2; padding: 20px 19px; max-width: 65%; }
.hero-kicker {
  display: block; margin: 0; padding: 0; border-radius: 0; background: transparent;
  color: var(--login-muted); font: 600 11px/1 "IBM Plex Sans", sans-serif;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
body .login-head h1 {
  margin: 0 0 6px; color: var(--login-fg);
  font: 700 1.7rem/1.15 Manrope, sans-serif; letter-spacing: -.03em; text-align: left;
}
body .hero-copy h1 { margin: 18px 0 13px; font: 800 1.75rem/1.16 Manrope, sans-serif; letter-spacing: -.035em; text-align: left; }
.hero-copy p { margin: 0; color: var(--login-muted); font-size: .88rem; line-height: 1.55; }
.hero-fibers { position: absolute; z-index: 1; width: 53%; right: -4px; bottom: 3px; overflow: visible; }
.hero-fibers path { fill: none; stroke: #a16aeb; stroke-width: 1.6; opacity: .76; }
.hero-fibers .fiber-blue { stroke: #49c2ed; stroke-width: 2; }
.hero-fibers circle { fill: #4ac4ec; }
.hero-fibers circle:last-child { fill: #a975e9; }
body .hero-mobile .mascot {
  position: absolute; z-index: 3; pointer-events: none;
  width: 133px; height: 211px; object-fit: contain; right: 10px; top: 13px;
  filter: none;
}
html body .stage .card, html body .stage .card.default, html body.branded .stage .card {
  margin: 0; padding: 24px 3px 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: loginRise .8s .18s ease both;
}
body .card h2 { margin: 0 0 5px; font: 800 1.4rem/1.2 Manrope, sans-serif; letter-spacing: -.025em; }
body .lead, body.branded .lead { margin: 0 0 22px; color: var(--login-muted); font-size: .88rem; text-align: left; }
body .card label { display: flex; flex-direction: column; text-transform: uppercase; gap: 8px; margin-bottom: 18px; color: var(--login-muted); letter-spacing: .09em; font-size: .69rem; font-weight: 700; }
body .field {
  display: flex; align-items: center;
  min-height: 57px; padding: 0 14px; gap: 13px; border-radius: 15px;
  border: 1px solid var(--login-edge); background: var(--login-surface);
  transition: border-color .15s, box-shadow .15s;
}
body .field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
body .field .ic { opacity: 1; color: var(--login-muted); width: 22px; height: 22px; flex: none; transition: color .25s ease; }
body .field:focus-within .ic { color: var(--accent); }
body .field .ic svg, body .eye svg { width: 22px; height: 22px; display: block; }
body .field input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--login-fg); min-width: 0; min-height: 55px; padding: 0; font: 16px "IBM Plex Sans", sans-serif; }
body .field input::placeholder { color: var(--login-muted); opacity: 1; }
body .eye { border: 0; background: transparent; cursor: pointer; color: var(--login-muted); min-width: 44px; min-height: 44px; display: grid; place-items: center; }
body button.enter {
  position: relative; overflow: hidden;
  width: 100%; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  margin-top: 5px; min-height: 58px; border-radius: 17px;
  background: var(--login-button); color: #fff;
  gap: 12px;
  animation: loginBtnGlow 4.8s ease-in-out infinite;
  transition: transform .2s ease, filter .2s ease;
}
body button.enter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255,255,255,.28) 48%, transparent 64%);
  transform: translateX(-130%);
  animation: loginSheen 7.5s ease-in-out infinite;
  pointer-events: none;
}
body button.enter:hover { filter: brightness(1.06); }
body button.enter:active { transform: scale(.985); }
body button.enter span { font-size: 1.35rem; line-height: 0; transition: transform .25s ease; }
body button.enter:hover span { transform: translateX(4px); }
body button.enter:disabled { opacity: .55; cursor: wait; }
body #msg { color: #bc563f; font-size: .85rem; min-height: 0; margin: 0; }
body #msg:not(:empty) { margin: 12px 0; }
body .choose { display: none; flex-direction: column; gap: 8px; margin: 14px 0 0; }
body .choose.open { display: flex; }
body .choose button { cursor: pointer; border: 1px solid var(--login-edge); border-radius: 12px; padding: 12px; background: var(--login-surface); color: var(--login-fg); min-height: 48px; font: 600 .88rem "IBM Plex Sans", sans-serif; }
.login-foot {
  margin: 28px 0 0; padding: 16px 0 0; border-top: 1px solid var(--login-edge);
  display: flex; align-items: center; gap: 12px;
  animation: loginRise .7s .32s ease both;
}
.foot-mark {
  position: relative;
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, var(--login-surface));
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--login-edge));
}
.foot-mark::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  animation: loginPulse 3.8s ease-out infinite;
  pointer-events: none;
}
.login-foot svg { width: 16px; height: 16px; display: block; }
.foot-copy { min-width: 0; }
.login-foot strong {
  display: block; color: var(--login-fg);
  font: 600 .84rem/1.2 "IBM Plex Sans", sans-serif; letter-spacing: 0;
}
.login-foot small { display: block; margin-top: 2px; color: var(--login-muted); font-size: .75rem; line-height: 1.3; }
body .blocked h1 { color: var(--login-fg); }
body .blocked p { color: var(--login-muted); }
body .blocked { position: relative; z-index: 1; max-width: 420px; margin: 20vh auto 0; text-align: center; padding: 1.25rem; }
@media (prefers-reduced-motion: reduce) {
  .login-glow span,
  body .login-top,
  body .login-head,
  html body .stage .card,
  body .login-foot,
  body button.enter,
  body button.enter::after,
  .foot-mark::after { animation: none; }
  body button.enter { box-shadow: none; }
}
@media (max-width: 380px) {
  body .hero-mobile .mascot { width: 118px; height: 190px; right: 2px; top: 27px; }
  .hero-copy { padding-left: 16px; }
  body .hero-copy h1 { font-size: 1.58rem; }
  .hero-copy p { font-size: .82rem; }
}
