/**
 * Login Page - Modern Responsive Design
 * Sistema de Avaliação Docente - ÆVALIS
 * 
 * Design moderno, totalmente responsivo e acessível
 * Mantém a identidade visual com verde #00FD94 e gradientes
 */

/* ==================================================
   RESET E LAYOUT BASE
   ================================================== */

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

body {
  font-family: var(--font02, 'Inter', 'Segoe UI', system-ui, sans-serif);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: var(--cor04);
}

/* ==================================================
   BACKGROUND ANIMADO
   ================================================== */

.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(-45deg, var(--cor04), var(--cor03), var(--cor04), var(--cor06));
  background-size: 400% 400%;
  animation: gradientFlow 15s ease infinite;
  z-index: 0;
}

@keyframes gradientFlow {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* ==================================================
   CONTAINER PRINCIPAL
   ================================================== */

.login-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

/* ==================================================
   CARD DE LOGIN
   ================================================== */

.login-card {
  width: 100%;
  max-width: 480px;
  background: var(--cor03);
  border-radius: clamp(20px, 4vw, 30px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  animation: cardFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==================================================
   HEADER DO CARD
   ================================================== */

.login-header {
  text-align: center;
  padding: clamp(2rem, 6vw, 3rem) clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2rem);
  background: linear-gradient(135deg, rgba(0, 253, 148, 0.1), rgba(55, 111, 108, 0.1));
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.logo-wrapper {
  width: clamp(100px, 20vw, 140px);
  height: clamp(100px, 20vw, 140px);
  margin: 0 auto clamp(1rem, 3vw, 1.5rem);
  background: var(--cor07);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(15px, 3vw, 20px);
  box-shadow:
    0 10px 30px rgba(0, 253, 148, 0.2),
    0 0 0 3px rgba(255, 255, 255, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-wrapper:hover {
  transform: scale(1.05) rotate(5deg);
}

.login-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.login-title {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  color: var(--cor07);
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  color: var(--cor05);
  opacity: 0.9;
  font-weight: 400;
  line-height: 1.4;
}

/* ==================================================
   MENSAGENS
   ================================================== */

.messages-container {
  padding: 0 clamp(1.5rem, 4vw, 2.5rem);
  margin-top: 1rem;
}

.alert {
  padding: clamp(10px, 2vw, 14px) clamp(12px, 3vw, 18px);
  border-radius: 10px;
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: alertSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes alertSlide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-success {
  background: rgba(0, 253, 148, 0.15);
  color: var(--cor02);
  border-left: 4px solid var(--cor02);
}

.alert-error {
  background: rgba(255, 82, 82, 0.15);
  color: #ff5252;
  border-left: 4px solid #ff5252;
}

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

.login-form {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.login-mode {
  display: none;
  animation: modeTransition 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-mode.active {
  display: block;
}

@keyframes modeTransition {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mode-content {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 1.75rem);
}

/* ==================================================
   WELCOME TEXT
   ================================================== */

.welcome-text {
  text-align: center;
  padding: clamp(1rem, 2vw, 1.5rem) 0;
}

.welcome-text i {
  font-size: clamp(2rem, 5vw, 2.75rem);
  color: var(--cor02);
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
  display: block;
  opacity: 0.9;
}

.welcome-text h2 {
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  font-weight: 600;
  color: var(--cor07);
  margin-bottom: 0.5rem;
}

.welcome-text p {
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  color: var(--cor05);
  opacity: 0.85;
  line-height: 1.5;
}

/* ==================================================
   FORM GROUPS
   ================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-form-label {
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  font-weight: 500;
  color: var(--cor07) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.25rem;
}

.login-form-label i {
  color: var(--cor02);
  font-size: 0.875em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--cor01);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper:focus-within {
  box-shadow:
    0 4px 16px rgba(0, 253, 148, 0.25),
    0 0 0 3px rgba(0, 253, 148, 0.1);
  transform: translateY(-1px);
}

.input-icon {
  width: 20px;
  height: 20px;
  margin-left: 16px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
}

.input-wrapper:focus-within .input-icon {
  opacity: 1;
}

.form-input {
  width: 100%;
  padding: clamp(12px, 2.5vw, 14px) clamp(12px, 3vw, 16px);
  padding-left: 12px;
  border: none;
  outline: none;
  background: transparent;
  font-size: clamp(0.9375rem, 2vw, 1rem);
  color: var(--cor05);
  font-family: inherit;
  min-height: 44px;
  /* Touch-friendly */
}

.form-input::placeholder {
  color: var(--cor05);
  opacity: 0.5;
}

/* Toggle de Senha */
.toggle-password {
  background: none;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
  min-width: 44px;
  /* Touch-friendly */
  min-height: 44px;
}

.toggle-password:hover {
  opacity: 0.7;
}

.toggle-password .eye-icon {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

/* ==================================================
   BOTÕES
   ================================================== */

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn {
  font-family: inherit;
  font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
  font-weight: 600;
  padding: clamp(12px, 2.5vw, 14px) clamp(20px, 4vw, 28px);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
  text-align: center;
  min-height: 48px;
  /* Touch-friendly */
  position: relative;
  overflow: hidden;
}

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

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

.btn-primary {
  background: var(--cor02);
  color: var(--cor05);
  box-shadow:
    0 4px 14px rgba(0, 253, 148, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: #00e085;
  transform: translateY(-2px);
  box-shadow:
    0 6px 20px rgba(0, 253, 148, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 253, 148, 0.3);
}

.btn-link {
  background: transparent;
  color: var(--cor02);
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  font-weight: 500;
  padding: clamp(8px, 2vw, 10px) clamp(12px, 3vw, 16px);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 8px;
  min-height: 40px;
}

.btn-link:hover {
  background: rgba(0, 253, 148, 0.1);
  color: #00e085;
}

.btn-link i {
  font-size: 0.875em;
}

/* ==================================================
   DIVIDER
   ================================================== */

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: clamp(0.75rem, 2vw, 1rem) 0;
  color: var(--cor05);
  opacity: 0.5;
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
}

/* ==================================================
   FOOTER DO CARD
   ================================================== */

.login-footer {
  text-align: center;
  padding: clamp(1.5rem, 4vw, 2rem) clamp(1.5rem, 4vw, 2.5rem);
  background: rgba(0, 0, 0, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.login-footer p {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.footer-main {
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  font-weight: 600;
  color: var(--cor07);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.footer-main i {
  color: var(--cor02);
  font-size: 0.875em;
}

.footer-sub {
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
  color: var(--cor05);
  opacity: 0.85;
  font-weight: 500;
}

.footer-help {
  font-size: clamp(0.75rem, 1.8vw, 0.8125rem);
  color: var(--cor05);
  opacity: 0.7;
}

/* ==================================================
   LOGO INSTITUCIONAL RODAPÉ
   ================================================== */

.institutional-footer {
  text-align: center;
  padding: clamp(1rem, 2vw, 1.5rem);
  animation: logoFade 1s ease 0.3s both;
}

@keyframes logoFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.institutional-logo {
  height: clamp(40px, 8vw, 60px);
  width: auto;
  filter:
    drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3)) brightness(1.1);
  transition: transform 0.3s ease;
}

.institutional-logo:hover {
  transform: scale(1.05);
}

/* ==================================================
   RESPONSIVIDADE
   ================================================== */

/* Tablets */
@media (max-width: 768px) {
  .login-container {
    padding: clamp(1rem, 2vw, 1.5rem);
    gap: clamp(1rem, 2vw, 1.5rem);
  }

  .login-card {
    max-width: 100%;
  }

  .logo-wrapper {
    width: clamp(90px, 18vw, 120px);
    height: clamp(90px, 18vw, 120px);
  }
}

/* Smartphones */
@media (max-width: 480px) {
  .login-header {
    padding: 2rem 1.25rem 1.5rem;
  }

  .login-form {
    padding: 1.25rem;
  }

  .logo-wrapper {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
  }

  .login-title {
    font-size: 1.5rem;
  }

  .welcome-text i {
    font-size: 2rem;
  }

  /* Botões e inputs padronizados - touch targets 44px */
  .btn {
    min-width: 44px;
    min-height: 44px;
    padding: 14px 18px;
    font-size: 0.9rem;
  }

  .form-input {
    min-height: 44px;
  }

  .login-footer {
    padding: 1.25rem 1rem;
  }

  .institutional-footer {
    padding: 1rem 0.5rem;
  }
}

/* Telas muito pequenas */
@media (max-width: 360px) {
  .login-container {
    padding: 0.75rem;
  }

  .login-card {
    border-radius: 16px;
  }

  .logo-wrapper {
    width: 80px;
    height: 80px;
  }

  .login-form {
    padding: 1rem;
  }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .login-container {
    min-height: auto;
    padding: 1rem;
  }

  .login-header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .logo-wrapper {
    width: 80px;
    height: 80px;
    margin-bottom: 0.75rem;
  }

  .login-form {
    padding: 1.25rem;
  }

  .mode-content {
    gap: 1rem;
  }

  .welcome-text {
    padding: 0.75rem 0;
  }

  .welcome-text i {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }

  .login-footer {
    padding: 1rem 1.25rem;
  }

  .institutional-footer {
    display: none;
    /* Ocultar em landscape para economizar espaço */
  }
}