/**
 * Login Page Styles - 7Rural
 * Sistema de Gestão Rural
 */

:root {
  --bg1: #001e1a;
  --bg2: #00372a;
  --card: #05281f;
  --card-2: #083228;
  --text: #eaf7f3;
  --muted: #b8d1ca;
  --primary: #00ff88;
  --primary-dark: #00cc6a;
  --primary-darker: #009b66;
  --danger: #ff3b30;
  --warning: #ffcc00;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --radius: 20px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 50%, var(--bg1) 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* ========================================
 ANIMATED BACKGROUND
======================================== */

.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: float-random 20s infinite ease-in-out;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #00ff88, transparent);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #00cc6a, transparent);
  bottom: -250px;
  right: -250px;
  animation-delay: 5s;
}

.shape-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #009b66, transparent);
  top: 50%;
  left: 50%;
  animation-delay: 10s;
}

@keyframes float-random {
  0%, 100% {
      transform: translate(0, 0) scale(1);
  }
  25% {
      transform: translate(100px, -100px) scale(1.1);
  }
  50% {
      transform: translate(-50px, 100px) scale(0.9);
  }
  75% {
      transform: translate(150px, 50px) scale(1.05);
  }
}

.grid-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
      linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
  0% {
      transform: translate(0, 0);
  }
  100% {
      transform: translate(50px, 50px);
  }
}

/* ========================================
 LOGIN CONTAINER
======================================== */

.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  animation: slideUp 0.6s ease;
}

@keyframes slideUp {
  from {
      opacity: 0;
      transform: translateY(30px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

.login-card {
  background: linear-gradient(160deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: var(--radius);
  padding: 50px 40px;
  box-shadow: var(--shadow), 
              0 0 0 1px rgba(0, 255, 136, 0.05),
              0 0 60px rgba(0, 255, 136, 0.1);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-darker), var(--primary), var(--primary-dark));
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.login-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(0, 255, 136, 0.03), transparent);
  animation: scanLine 3s linear infinite;
}

@keyframes scanLine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* ========================================
 LOGO E HEADER
======================================== */

.login-header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

.logo-wrapper {
  margin: 0 auto 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.logo-glow {
  position: absolute;
  width: 280px;
  height: 120px;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.2), transparent);
  filter: blur(40px);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
      opacity: 0.5;
      transform: scale(1);
  }
  50% {
      opacity: 0.8;
      transform: scale(1.1);
  }
}

.logo-image {
  width: 240px;
  height: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 20px rgba(0, 255, 136, 0.3));
  animation: float-logo 3s ease-in-out infinite;
}

@keyframes float-logo {
  0%, 100% {
      transform: translateY(0px);
  }
  50% {
      transform: translateY(-10px);
  }
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.login-subtitle {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

/* ========================================
 ALERTAS
======================================== */

.alert {
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.alert-danger {
  background: rgba(255, 59, 48, 0.15);
  border: 1px solid rgba(255, 59, 48, 0.3);
  color: var(--danger);
}

.alert-warning {
  background: rgba(255, 204, 0, 0.15);
  border: 1px solid rgba(255, 204, 0, 0.3);
  color: var(--warning);
}

.alert-icon {
  font-size: 20px;
}

/* ========================================
 FORMULÁRIO
======================================== */

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

.form-group {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  margin-bottom: 10px;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 18px;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 15px 20px 15px 50px;
  background: rgba(0, 255, 136, 0.03);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 12px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 255, 136, 0.05);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1), 0 0 20px rgba(0, 255, 136, 0.2);
}

.form-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.password-toggle {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 18px;
  padding: 5px;
  transition: all 0.3s ease;
}

.password-toggle:hover {
  color: var(--primary-dark);
  transform: translateY(-50%) scale(1.1);
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.remember-me label {
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.forgot-password {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.forgot-password:hover {
  color: var(--primary-dark);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* ========================================
 BOTÃO LOGIN
======================================== */

.btn-login {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-darker), var(--primary));
  border: none;
  border-radius: 12px;
  color: var(--bg1);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
  width: 300px;
  height: 300px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 255, 136, 0.5);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login span {
  position: relative;
  z-index: 1;
}

/* ========================================
 FOOTER
======================================== */

.login-footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid rgba(0, 255, 136, 0.15);
  position: relative;
  z-index: 1;
}

.footer-text {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.footer-brand {
  font-weight: 800;
  color: var(--primary);
  font-size: 16px;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* ========================================
 RESPONSIVE
======================================== */

@media (max-width: 768px) {
  .login-card {
      padding: 40px 30px;
  }

  .login-title {
      font-size: 24px;
  }

  .logo-image {
      width: 200px;
  }

  .form-footer {
      flex-direction: column;
      gap: 15px;
      align-items: flex-start;
  }
}

@media (max-width: 480px) {
  body {
      padding: 15px;
  }

  .login-card {
      padding: 30px 20px;
  }

  .login-title {
      font-size: 22px;
  }

  .login-subtitle {
      font-size: 14px;
  }

  .logo-image {
      width: 180px;
  }
}