/**
 * Login — alinhado a cartrack-login.jsx
 * Escopo: body.login-page
 */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Space+Mono:wght@400;700&display=swap");

body.login-page {
  margin: 0;
  font-family: "DM Sans", -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #08080c;
  position: relative;
  overflow: hidden;
  padding: 24px;
  color: #e0e0e8;
}

body.login-page *,
body.login-page *::before,
body.login-page *::after {
  box-sizing: border-box;
}

/* Fundo */
body.login-page .lp-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

body.login-page .lp-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.08;
}

body.login-page .lp-bg-orb.a {
  width: 500px;
  height: 500px;
  background: #e8503e;
  top: -180px;
  right: -120px;
  animation: lp-drift 20s ease-in-out infinite;
}

body.login-page .lp-bg-orb.b {
  width: 400px;
  height: 400px;
  background: #c42b1c;
  bottom: -150px;
  left: -100px;
  animation: lp-drift 25s ease-in-out infinite reverse;
}

@keyframes lp-drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(30px, 20px);
  }
}

body.login-page .lp-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
}

/* Cartão */
body.login-page .lp-card {
  position: relative;
  width: 420px;
  max-width: 100%;
  background: rgba(22, 22, 29, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  overflow: hidden;
  animation: lp-in 0.5s ease;
}

@keyframes lp-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.login-page .lp-accent {
  height: 3px;
  background: linear-gradient(90deg, #c42b1c, #e8503e, #c42b1c);
  background-size: 200% 100%;
  animation: lp-shimmer 3s ease infinite;
}

@keyframes lp-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

body.login-page .lp-body {
  padding: 36px 32px 32px;
}

/* Cabeçalho */
body.login-page .lp-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

body.login-page .lp-brand {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 20px;
  font-weight: 700;
  color: #f0f0f3;
  letter-spacing: -0.3px;
}

body.login-page .lp-brand span {
  color: #e8503e;
}

body.login-page .lp-tagline {
  font-size: 12.5px;
  color: #4a4a5e;
  margin-top: 2px;
}

/* Formulário */
body.login-page .lp-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 6px;
}

body.login-page .lp-fg {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.login-page .lp-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #55556a;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

body.login-page .lp-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  transition: all 0.2s;
}

body.login-page .lp-input-wrap:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

body.login-page .lp-input-wrap.focus {
  border-color: rgba(232, 80, 62, 0.45);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(232, 80, 62, 0.06);
}

body.login-page .lp-input-wrap.err {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.02);
}

body.login-page .lp-input-ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: #3a3a4a;
  transition: color 0.2s;
}

body.login-page .lp-input-wrap.focus .lp-input-ic {
  color: #e8503e;
}

body.login-page .lp-fi {
  flex: 1;
  padding: 12px 14px 12px 0;
  border: none;
  background: none;
  outline: none;
  color: #e0e0e8;
  font-size: 15px;
  font-family: inherit;
  min-width: 0;
}

body.login-page .lp-fi::placeholder {
  color: #2a2a3a;
}

body.login-page .lp-fi:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px rgb(22, 22, 29) inset !important;
  -webkit-text-fill-color: #e0e0e8 !important;
}

body.login-page .lp-eye {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #3a3a4a;
  transition: all 0.12s;
  margin-right: 4px;
  flex-shrink: 0;
  padding: 0;
}

body.login-page .lp-eye:hover {
  color: #6b6b80;
  background: rgba(255, 255, 255, 0.04);
}

body.login-page .lp-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  margin-top: 2px;
}

body.login-page .lp-forgot {
  font-size: 12.5px;
  font-weight: 500;
  color: #6b6b80;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
  border: none;
  background: none;
  font-family: inherit;
  padding: 4px 0;
}

body.login-page .lp-forgot:hover {
  color: #e8503e;
}

body.login-page .lp-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.12);
  font-size: 12.5px;
  color: #f87171;
  font-weight: 500;
  margin-bottom: 18px;
  animation: lp-shake 0.4s ease;
}

/* display:flex acima ganha à regra UA de [hidden]; sem isto a caixa fica sempre visível */
body.login-page .lp-error[hidden] {
  display: none !important;
  margin-bottom: 0;
  animation: none;
}

body.login-page .lp-flash {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 18px;
}

body.login-page .lp-flash--ok {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: #34d399;
}

body.login-page .lp-flash--info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

@keyframes lp-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

body.login-page .lp-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #c42b1c 0%, #e8503e 100%);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(196, 43, 28, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

body.login-page .lp-submit:hover:not(:disabled) {
  box-shadow: 0 6px 28px rgba(196, 43, 28, 0.4);
  transform: translateY(-1px);
}

body.login-page .lp-submit:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(196, 43, 28, 0.2);
}

body.login-page .lp-submit:disabled {
  opacity: 0.7;
  cursor: default;
}

body.login-page a.lp-submit {
  color: #fff;
  text-decoration: none;
  box-sizing: border-box;
}

body.login-page a.lp-submit:hover {
  box-shadow: 0 6px 28px rgba(196, 43, 28, 0.4);
  transform: translateY(-1px);
}

body.login-page .lp-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: lp-spin 0.6s linear infinite;
}

@keyframes lp-spin {
  to {
    transform: rotate(360deg);
  }
}

body.login-page .lp-footer {
  padding: 16px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

body.login-page .lp-footer-t {
  font-size: 11.5px;
  color: #2a2a3a;
  font-family: "Space Mono", ui-monospace, monospace;
}

body.login-page .lp-footer-v {
  font-size: 10px;
  color: #1e1e28;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Overlay sucesso */
body.login-page .lp-success {
  position: absolute;
  inset: 0;
  background: rgba(22, 22, 29, 0.95);
  display: grid;
  place-items: center;
  z-index: 10;
  animation: lp-fade 0.3s ease;
  border-radius: 24px;
}

@keyframes lp-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.login-page .lp-success-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: lp-pop 0.35s ease;
}

@keyframes lp-pop {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

body.login-page .lp-success-ic {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.1);
  display: grid;
  place-items: center;
  color: #34d399;
}

body.login-page .lp-success-t {
  font-size: 17px;
  font-weight: 700;
  color: #f0f0f3;
}

body.login-page .lp-success-sub {
  font-size: 13px;
  color: #55556a;
}

@media (max-width: 480px) {
  body.login-page {
    padding: 0;
    align-items: stretch;
  }

  body.login-page .lp-card {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  body.login-page .lp-body {
    padding: 32px 24px 28px;
  }

  body.login-page .lp-footer {
    padding: 16px 24px;
  }

  body.login-page .lp-accent {
    border-radius: 0;
  }

  body.login-page .lp-success {
    border-radius: 0;
  }
}
