/* ============================================
   ZONA DE CONFORTO - AUTH MODERN CSS
   Design inspirado em Codepen/Glassmorphism
   ============================================ */

/* ===== ANIMAÇÕES KEYFRAMES ===== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.8), 0 0 60px rgba(168, 85, 247, 0.4); }
}

@keyframes borderRotate {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}

/* ===== FUNDO ANIMADO ===== */
#auth-screen {
  background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #1a1a2e, #16213e);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Elementos flutuantes decorativos */
#auth-screen::before,
#auth-screen::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}

#auth-screen::before {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

#auth-screen::after {
  bottom: 10%;
  right: 10%;
  width: 200px;
  height: 200px;
  animation-delay: -3s;
}

/* ===== CARD PRINCIPAL - GLASSMORPHISM ===== */
.auth-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: slideInUp 0.6s ease-out;
  position: relative;
  z-index: 10;
}

/* Borda gradiente animada */
.auth-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  padding: 2px;
  background: linear-gradient(45deg, #6366f1, #a855f7, #ec4899, #6366f1);
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
}

/* ===== LOGO E TÍTULO ===== */
.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(99, 102, 241, 0.5));
  animation: pulse 3s ease-in-out infinite;
  margin-bottom: 16px;
}

.auth-logo h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #c7c7ff 50%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.auth-logo p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ===== ABAS (TABS) ===== */
.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.auth-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  opacity: 0;
  transition: opacity 0.3s;
}

.auth-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}

.auth-tab:hover::before {
  opacity: 1;
}

.auth-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3));
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.auth-tab.active::before {
  opacity: 1;
}

/* ===== FORMULÁRIOS ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form.hidden {
  display: none;
}

/* Grupos de input */
.auth-form .form-group {
  position: relative;
}

.auth-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 6px;
  transition: color 0.3s;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.auth-form input:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.auth-form input:focus + label {
  color: #6366f1;
}

/* Ícones nos inputs (opcional) */
.auth-form .input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

/* ===== BOTÕES ===== */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
  animation: glow 2s ease-in-out infinite;
}

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

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  animation: none;
}

/* Botão secundário */
.btn-secondary {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ===== MENSAGEM DE ERRO ===== */
.auth-error {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  text-align: center;
  font-weight: 500;
  animation: slideInUp 0.3s ease, shake 0.5s ease;
  backdrop-filter: blur(10px);
}

.auth-error:not(.hidden) {
  display: block;
}

.auth-error.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-error.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.auth-error.hidden {
  display: none;
}

/* ===== LINKS ===== */
.auth-links {
  text-align: center;
  margin-top: 20px;
}

.auth-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
}

.auth-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  transition: width 0.3s;
}

.auth-links a:hover {
  color: #fff;
}

.auth-links a:hover::after {
  width: 100%;
}

/* ===== DIVISOR "OU" ===== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* ===== RESPONSIVIDADE MOBILE ===== */
@media (max-width: 480px) {
  #auth-screen {
    padding: 16px;
    align-items: flex-start;
    padding-top: 40px;
  }
  
  .auth-card {
    padding: 24px;
    border-radius: 20px;
    max-width: 100%;
  }
  
  .auth-card::before {
    border-radius: 22px;
  }
  
  .auth-logo img {
    width: 60px;
    height: 60px;
  }
  
  .auth-logo h1 {
    font-size: 24px;
  }
  
  .auth-tabs {
    gap: 2px;
  }
  
  .auth-tab {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .auth-form input {
    padding: 12px 14px;
    font-size: 16px; /* Evita zoom no iOS */
  }
  
  .btn-primary {
    padding: 14px 20px;
    font-size: 16px;
  }
}

/* Ajuste para telas muito pequenas */
@media (max-width: 360px) {
  .auth-card {
    padding: 20px;
  }
  
  .auth-logo h1 {
    font-size: 20px;
  }
  
  .auth-tab {
    font-size: 12px;
    padding: 8px 10px;
  }
}

/* Ajuste para telas grandes */
@media (min-width: 1200px) {
  .auth-card {
    max-width: 480px;
    padding: 48px;
  }
  
  .auth-logo img {
    width: 100px;
    height: 100px;
  }
  
  .auth-logo h1 {
    font-size: 32px;
  }
}

/* ===== MODO ESCURO ESPECÍFICO ===== */
@media (prefers-color-scheme: dark) {
  .auth-form input {
    background: rgba(0, 0, 0, 0.2);
  }
  
  .auth-form input:focus {
    background: rgba(0, 0, 0, 0.3);
  }
}

/* ===== ANIMAÇÃO DE CARREGAMENTO (PONTOS PISCANDO) ===== */
.dots-loader {
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.dots-loader span {
  width: 8px; height: 8px; background: #fff; border-radius: 50%;
  animation: dotsBlink 1.4s ease-in-out infinite both;
}
.dots-loader span:nth-child(1) { animation-delay: -0.32s; }
.dots-loader span:nth-child(2) { animation-delay: -0.16s; }
.dots-loader span:nth-child(3) { animation-delay: 0s; }
@keyframes dotsBlink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.5); }
  40% { opacity: 1; transform: scale(1); }
}
.btn-primary .dots-loader {
  display: inline-flex;
  margin-right: 8px;
  vertical-align: middle;
}
.btn-primary .dots-loader span {
  width: 6px; height: 6px;
}
