/* ============================================================
   Login — layout glass centralizado com borda LED animada
   (espelha o React /src/routes/index.tsx + LoginShell)
   ============================================================ */

:root {
  --accent: #ff4600;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.auth-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

.login-preview {
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #0b0a14;
}

/* Wrapper com a borda LED animada */
.login-led {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 100%;
  margin-inline: auto;
  padding: 2px;
  border-radius: 22px;
  isolation: isolate;
  display: flex;
}

.login-led::before,
.login-led::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--led-angle, 0deg),
    transparent 0deg,
    var(--accent, #ff7a18) 60deg,
    var(--secondary, #4a5cff) 180deg,
    var(--accent, #ff7a18) 300deg,
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: led-spin 4s linear infinite;
  pointer-events: none;
}

.login-led::after {
  filter: blur(22px);
  opacity: 1;
  z-index: -1;
}

@property --led-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes led-spin { to { --led-angle: 360deg; } }

@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .login-led::before,
  .login-led::after { display: none; }
}

/* Card glass — translúcido estilo vidro */
.login-glass {
  position: relative;
  width: 100%;
  max-height: 100%;
  padding: clamp(24px, 4vw, 38px) clamp(20px, 3.5vw, 34px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 30px 90px rgba(0,0,0,.6),
    inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
}
.login-glass::-webkit-scrollbar { width:0; height:0; display:none; }

.login-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,.05), transparent 55%),
    radial-gradient(120% 80% at 100% 100%, rgba(255,122,24,.07), transparent 55%);
}

.login-logo,
.login-form { position: relative; z-index: 1; }

.login-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  margin-bottom: 24px;
}

.login-logo img {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,.55));
}

.login-form { display: grid; gap: 14px; }

.login-field {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 14px;
  isolation: isolate;
}

.login-field::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(120deg, var(--accent, #ff7a18), var(--secondary, #4a5cff), var(--accent, #ff7a18));
  background-size: 300% 100%;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .25s ease;
  animation: field-shine 4s linear infinite;
  pointer-events: none;
}
.login-field:focus-within::before { opacity: 1; }

@keyframes field-shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.login-field svg {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  color: rgba(255,255,255,.85);
  pointer-events: none;
  transition: color .25s ease, transform .25s ease;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}
.login-field:focus-within svg {
  color: var(--accent);
  transform: scale(1.06);
}

.login-form input {
  width: 100%;
  height: 52px;
  padding: 0 18px 0 52px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  outline: none;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  color: #fff;
  font: 500 14.5px/1 system-ui, sans-serif;
  letter-spacing: 0.01em;
  transition: border-color .25s ease, background .25s ease;
  position: relative;
  z-index: 1;
}
.login-form input::placeholder { color: rgba(255,255,255,.5); }
.login-form input:focus { background: rgba(255,255,255,.1); }

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.6);
  margin: -2px 2px 0;
}
.login-remember input {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.login-remember label { cursor: pointer; }

.login-form button[type=submit] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 56px;
  padding: 0 22px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  color: #fff;
  font: 800 15.5px/1 system-ui, sans-serif;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent, #ff7a18) 0%, var(--secondary, #4a5cff) 100%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  box-shadow:
    0 18px 40px -12px var(--accent-glow, rgba(255,70,0,.6)),
    0 0 0 1px rgba(255,255,255,.08) inset,
    inset 0 1px 0 rgba(255,255,255,.25);
  transition: background-position .5s ease, transform .2s ease, box-shadow .2s ease;
  margin-top: 6px;
  overflow: hidden;
}
.login-form button[type=submit]::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 80%; height: 100%;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transition: left .7s ease;
}
.login-form button[type=submit]:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--secondary, #4a5cff) 0%, var(--accent, #ff7a18) 100%);
  box-shadow:
    0 22px 50px -12px rgba(var(--secondary-rgb, 74,92,255), .55),
    0 0 0 1px rgba(255,255,255,.12) inset,
    inset 0 1px 0 rgba(255,255,255,.3);
}
.login-form button[type=submit]:hover::before { left: 120%; }
.login-form button[type=submit]:active { transform: translateY(0); }
.login-form button[type=submit]:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}
.login-form button[type=submit] span,
.login-form button[type=submit] svg {
  position: relative;
  z-index: 1;
}
.login-form button[type=submit] svg {
  width: 20px;
  height: 20px;
  transition: transform .25s ease;
}
.login-form button[type=submit]:hover svg {
  transform: translateX(4px);
}

.login-alert {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  position: relative;
  z-index: 1;
}
.login-alert--err {
  background: rgba(229,9,20,.12);
  border: 1px solid rgba(229,9,20,.3);
  color: #ff8a8a;
}
.login-alert--warn {
  background: rgba(255,193,7,.10);
  border: 1px solid rgba(255,193,7,.28);
  color: #ffd76a;
}

.login-links {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 13px;
}
.login-links a {
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: color .2s ease;
}
.login-links a:hover { color: #fff; }

/* Autofill — preserva 100% o visual glass do campo */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  box-shadow: 0 0 0 1000px transparent inset !important;
  transition: background-color 600000s 0s, color 600000s 0s, -webkit-text-fill-color 600000s 0s !important;
  animation: none !important;
}
input:autofill {
  background: transparent !important;
  color: #fff !important;
  box-shadow: 0 0 0 1000px transparent inset !important;
}

@media (max-width: 480px) {
  .login-logo { min-height: 80px; margin-bottom: 14px; }
  .login-logo img { max-height: 90px; }
}

/* Telas baixas — encolhe logo para caber sem rolagem */
@media (max-height: 720px) {
  .login-logo { min-height: 80px; margin-bottom: 12px; }
  .login-logo img { max-height: 84px; }
  .login-form { gap: 10px; }
  .login-form input { height: 46px; }
  .login-form button[type=submit] { height: 50px; }
}
@media (max-height: 600px) {
  .login-logo { min-height: 60px; margin-bottom: 8px; }
  .login-logo img { max-height: 64px; }
  .login-form input { height: 42px; }
}

/* ============================================================
   Oculta scrollbar globalmente (rolagem continua funcionando)
   ============================================================ */
html, body { scrollbar-width: none !important; -ms-overflow-style: none !important; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; background: transparent !important; }
