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

:root {
  --primary-color: #020f26;
  --secondary-color: #9dd5d4;
  --accent-color: #7bc8c6;
  --text-dark: #2c3e50;
  --text-light: #ffffff;
  --background: #9dd5d4;
  --error-color: #e74c3c;
  --warning-color: #f39c12;
  --success-color: #27ae60;
  --shadow: 0 10px 30px rgba(157, 213, 212, 0.1);
  --shadow-hover: 0 15px 40px rgba(157, 213, 212, 0.15);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--background);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.background-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(2, 15, 38, 0.1);
  animation: float 6s ease-in-out infinite;
}

.circle-1 {
  width: 300px;
  height: 300px;
  top: -150px;
  right: -150px;
  animation-delay: 0s;
}

.circle-2 {
  width: 200px;
  height: 200px;
  bottom: -100px;
  left: -100px;
  animation-delay: 2s;
}

.circle-3 {
  width: 150px;
  height: 150px;
  top: 50%;
  left: -75px;
  animation-delay: 4s;
}

.circle-4 {
  width: 120px;
  height: 120px;
  top: 20%;
  right: 20%;
  animation-delay: 1s;
}

.circle-5 {
  width: 80px;
  height: 80px;
  bottom: 30%;
  right: -40px;
  animation-delay: 3s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 450px;
  padding: 20px;
}

.login-card {
  background: var(--text-light);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(157, 213, 212, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 15;
}

.login-card:hover {
  box-shadow: 0 25px 80px rgba(157, 213, 212, 0.3);
  transform: translateY(-5px);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.logo {
  width: 160px;
  height: auto;
  margin-bottom: 1px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.login-header h1 {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-header h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-header p {
  color: #6c757d;
  font-size: 0.95rem;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--error-color);
}

.alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fed7aa;
  color: var(--warning-color);
}

.alert-success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--success-color);
}

.alert-info {
  background-color: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

/* ESTILOS CORRIGIDOS PARA INPUT-GROUP - BORDAS SEMPRE VISÍVEIS */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  background-color: #ffffff;
  border: 2px solid #cbd5e0 !important;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.input-group:focus-within {
  border: 2px solid var(--secondary-color) !important;
  background: white;
  box-shadow: 0 0 0 3px rgba(157, 213, 212, 0.1);
}

.input-group:hover:not(:focus-within) {
  border: 2px solid #a0aec0 !important;
}

.input-group:active {
  border: 2px solid var(--secondary-color) !important;
}

.input-group i {
  margin-right: 12px;
  color: #6c757d;
  font-size: 1rem;
  min-width: 16px;
  flex-shrink: 0;
  transition: color 0.3s ease;
}

.input-group:focus-within i {
  color: var(--secondary-color);
}

.input-group input {
  flex-grow: 1;
  border: none !important;
  background: transparent;
  padding: 0;
  font-size: 1rem;
  outline: none !important;
  color: #333;
  box-shadow: none !important;
}

.input-group input:focus,
.input-group input:active,
.input-group input:hover {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.input-group input::placeholder {
  color: #6c757d;
}

/* ESTILOS ESPECÍFICOS PARA SENHA */
.password-group {
  position: relative;
}

.password-group input {
  padding-right: 40px !important;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #6c757d;
  font-size: 1rem;
  padding: 4px;
  z-index: 10;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.password-toggle:hover {
  color: #495057;
  background-color: #f8f9fa;
}

.password-toggle:focus {
  outline: none;
  color: var(--secondary-color);
  background-color: #f8f9fa;
}

/* Caps Lock Warning */
.caps-warning {
  position: absolute;
  bottom: -28px;
  left: 15px;
  font-size: 0.8em;
  color: var(--warning-color);
  display: none;
  align-items: center;
  gap: 5px;
  z-index: 11;
  font-weight: 500;
}

.caps-warning.show {
  display: flex;
  animation: slideIn 0.3s ease-out;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 0.9rem;
}

.remember-me {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-dark);
  user-select: none;
  transition: color 0.3s ease;
}

.remember-me:hover {
  color: var(--secondary-color);
}

.remember-me input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 4px;
  margin-right: 8px;
  position: relative;
  transition: all 0.3s ease;
  background: #ffffff;
}

.remember-me input:checked + .checkmark {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
}

.remember-me input:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.forgot-link {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}

.forgot-link:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.login-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-color), #0a1a3a);
  color: var(--text-light);
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.login-btn:hover::before {
  left: 100%;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(2, 15, 38, 0.3);
}

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

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.login-footer p {
  color: #6c757d;
  font-size: 0.85rem;
  margin-bottom: 5px;
}

/* Loading animation */
.login-btn.loading {
  pointer-events: none;
}

.login-btn.loading .btn-text {
  opacity: 0;
}

.login-btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsividade */
@media (max-width: 480px) {
  .login-container {
    padding: 15px;
  }

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

  .login-header h1 {
    font-size: 1.7rem;
  }

  .login-header h3 {
    font-size: 1.3rem;
  }

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

/* Validação em tempo real */
.input-validation {
  font-size: 0.8rem;
  margin-top: 5px;
  color: var(--error-color);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.input-validation.show {
  opacity: 1;
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

/* CORREÇÃO FINAL PARA GARANTIR BORDAS SEMPRE VISÍVEIS */
.input-group,
.input-group:focus,
.input-group:focus-within,
.input-group:hover,
.input-group:active {
  border-width: 2px !important;
  border-style: solid !important;
}

.input-group {
  border-color: #cbd5e0 !important;
}

.input-group:focus-within {
  border-color: var(--secondary-color) !important;
}

.input-group:hover:not(:focus-within) {
  border-color: #a0aec0 !important;
}
