/* ================================
   IMPORTS
================================ */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;600;700;800&family=JetBrains+Mono:wght@300;400&display=swap');

/* ================================
   VARIABLES
================================ */
:root {
  --green-bright: #3dffb0;
  --green-mid:    #1cc97a;
  --green-deep:   #0e8f55;
  --green-dark:   #062e1c;
  --bg-darkest:   #020a05;
  --bg-dark:      #040f08;
  --bg-card:      rgba(8, 22, 14, 0.85);
  --border:       rgba(29, 185, 100, 0.25);
  --border-focus: rgba(61, 255, 176, 0.5);
  --text-primary: #e4f7ee;
  --text-muted:   #6aad8a;
  --error:        #ff6b6b;
  --glow:         rgba(61, 255, 176, 0.15);
}

/* ================================
   RESET
================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ================================
   BODY / PAGE
================================ */
body.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-darkest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Exo 2', sans-serif;
  color: var(--text-primary);
  overflow: hidden;
  position: relative;
}

/* ================================
   CANVAS BACKGROUND
================================ */
#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.7;
}

/* ================================
   GRID OVERLAY
================================ */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(29,185,100,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,185,100,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* ================================
   GLOW ORBS
================================ */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(14,143,85,0.18) 0%, transparent 70%);
  top: -150px; left: -150px;
  animation: orbFloat1 12s ease-in-out infinite;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(61,255,176,0.10) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation: orbFloat2 15s ease-in-out infinite;
}
.orb-3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(28,201,122,0.12) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: orbFloat3 9s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0,0); }
  50%       { transform: translate(60px, 40px); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0,0); }
  50%       { transform: translate(-50px, -30px); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(-50%,-50%) scale(1); opacity: 0.6; }
  50%       { transform: translate(-50%,-50%) scale(1.3); opacity: 1; }
}

/* ================================
   SCAN LINE
================================ */
.scanline {
  position: fixed;
  top: -100%;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(61,255,176,0.4), transparent);
  z-index: 2;
  animation: scan 8s linear infinite;
  pointer-events: none;
}
@keyframes scan {
  0%   { top: -2px; }
  100% { top: 100vh; }
}

/* ================================
   CONTAINER
================================ */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  animation: containerAppear 0.8s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes containerAppear {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ================================
   CARD
================================ */
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px 40px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(61,255,176,0.05),
    0 24px 64px rgba(0,0,0,0.7),
    0 0 80px rgba(14,143,85,0.08),
    inset 0 1px 0 rgba(61,255,176,0.06);
  position: relative;
  overflow: hidden;
}

/* Card top accent line */
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(61,255,176,0.5), transparent);
}

/* Card corner accents */
.login-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 60px; height: 60px;
  border-top: 1.5px solid rgba(61,255,176,0.3);
  border-left: 1.5px solid rgba(61,255,176,0.3);
  border-radius: 20px 0 0 0;
  pointer-events: none;
}

.corner-br {
  position: absolute;
  bottom: 0; right: 0;
  width: 60px; height: 60px;
  border-bottom: 1.5px solid rgba(61,255,176,0.3);
  border-right: 1.5px solid rgba(61,255,176,0.3);
  border-radius: 0 0 20px 0;
}

/* ================================
   LOGO AREA
================================ */
.logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

/* Imagem logo */
.logo-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
  filter:
    drop-shadow(0 0 8px rgba(61,255,176,0.45))
    drop-shadow(0 0 20px rgba(61,255,176,0.2));
}

/* Lockup completo (simbolo + AIOTI OPERATIONS PLATFORM + assinatura).
   So no login, unico lugar com espaco pra tagline ficar legivel — nos slots
   de 38-58px (sidebar, modais, favicon) entra so o simbolo recortado. */
.logo-img--full {
  width: min(230px, 78%);
  height: auto;
  filter:
    drop-shadow(0 0 10px rgba(61,255,176,0.28))
    drop-shadow(0 0 26px rgba(61,255,176,0.12));
}

.logo-area:has(.logo-img--full) {
  margin-bottom: 30px;
}

.logo-name {
  font-family: 'Exo 2', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  line-height: 1;
  position: relative;
}

.logo-name span.highlight {
  color: var(--green-bright);
  text-shadow: 0 0 20px rgba(61,255,176,0.4);
}

/* ================================
   SUBTITLE
================================ */
.login-subtitle {
  text-align: center;
  font-size: 11.5px;
  font-weight: 400;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 36px;
}

/* ================================
   DIVIDER
================================ */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin-bottom: 30px;
}

/* ================================
   FORM
================================ */
.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
  transition: color 0.2s;
}

.form-group input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(4, 18, 10, 0.8);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Exo 2', sans-serif;
  font-weight: 400;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  outline: none;
}

.form-group input::placeholder {
  color: rgba(106, 173, 138, 0.4);
  font-size: 13px;
}

.form-group input:focus {
  border-color: var(--border-focus);
  background: rgba(6, 24, 14, 0.95);
  box-shadow: 0 0 0 3px rgba(61,255,176,0.07), 0 0 20px rgba(61,255,176,0.05);
}

.form-group input:focus + .input-icon,
.form-group:focus-within .input-icon {
  color: var(--green-bright);
}

/* ================================
   BUTTON
================================ */
.login-btn {
  width: 100%;
  height: 50px;
  margin-top: 10px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--green-mid) 0%, var(--green-deep) 100%);
  color: #020a05;
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.25s;
  box-shadow: 0 4px 24px rgba(28,201,122,0.25);
}

.login-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(28,201,122,0.4);
}
.login-btn:hover::before { opacity: 1; }

.login-btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 12px rgba(28,201,122,0.2);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Shimmer on btn */
.login-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: skewX(-20deg);
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { left: -100%; }
  60%, 100% { left: 150%; }
}

/* ================================
   ERROR
================================ */
.login-error {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,107,107,0.25);
  background: rgba(255,107,107,0.07);
  text-align: center;
  font-size: 12.5px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--error);
  letter-spacing: 0.02em;
  animation: errorShake 0.4s cubic-bezier(0.36,0.07,0.19,0.97);
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* ================================
   FOOTER TAG
================================ */
.card-footer {
  margin-top: 28px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(106,173,138,0.35);
  letter-spacing: 0.15em;
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 480px) {
  .login-container {
    padding: 12px;
  }
  .login-card {
    padding: 36px 24px 32px;
  }
  .logo-name {
    font-size: 2rem;
  }
  .logo-svg {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 360px) {
  .login-card {
    padding: 28px 18px 26px;
  }
}