/**
 * TrinFit App - Estilos da tela de login e animação de abertura
 */

/* ========== TELA DE ABERTURA – Animação "Foco" (TrinFit) ========== */
.tela-abertura {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

/* Linha de luz que atravessa a tela uma vez – assinatura da abertura */
.tela-abertura::before {
  content: '';
  position: absolute;
  left: 0;
  top: -3px;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 20%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.12) 80%, transparent 100%);
  box-shadow: 0 0 24px rgba(255,255,255,0.08);
  animation: sweepTrinFit 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
  z-index: 2;
  pointer-events: none;
}

@keyframes sweepTrinFit {
  to { top: 100%; }
}

.tela-abertura.saindo {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tela-abertura__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 35%, transparent 65%, rgba(255,255,255,0.01) 100%);
  pointer-events: none;
}

.tela-abertura__conteudo {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
}

/* Logo: emerge do fundo escuro da tela ganhando foco (blur → nítido) */
.tela-abertura__logo-wrap {
  margin-bottom: 0;
  padding: 2rem;
}

.tela-abertura__logo {
  width: 180px;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.88);
  filter: blur(20px) drop-shadow(0 0 20px rgba(255,255,255,0.1));
  animation: logoFoco 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

@keyframes logoFoco {
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0) drop-shadow(0 0 20px rgba(255,255,255,0.1));
  }
}

/* Loader: linha fina, ponta viva – sem círculos */
.tela-abertura__loader {
  width: 200px;
  height: 1px;
  margin: 2.25rem auto 0;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
  opacity: 0;
  animation: loaderAparece 0.4s ease 1.4s forwards;
}

.tela-abertura__loader-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.5), rgba(255,255,255,0.95));
  box-shadow: 0 0 10px rgba(255,255,255,0.3);
  animation: loaderBarra 1.6s cubic-bezier(0.22, 1, 0.36, 1) 1.6s forwards;
}

@keyframes loaderAparece {
  to { opacity: 1; }
}

@keyframes loaderBarra {
  0% { width: 0; }
  75% { width: 100%; }
  100% { width: 100%; }
}

/* ========== CONTEÚDO LOGIN (após abertura) ========== */
.conteudo-login {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.conteudo-login.visivel {
  opacity: 1;
  transform: translateY(0);
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: linear-gradient(180deg, rgba(26,26,26,0.95) 0%, rgba(18,18,18,0.98) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
  backdrop-filter: blur(12px);
}

.login-card__logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo {
  width: 80px;
  height: auto;
  margin: 0 auto;
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.1));
}

.login-titulo {
  font-size: 2rem;
  letter-spacing: 0.1em;
  color: #fff;
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-descricao {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* Formulário */
.form-login {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-grupo {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
}

.form-input {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.form-input:hover {
  border-color: rgba(255,255,255,0.15);
}

.form-input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}

.form-input.erro {
  border-color: rgba(220, 80, 80, 0.6);
}

.form-erro,
.mensagem-erro {
  font-size: 0.8rem;
  color: #dc5050;
  min-height: 1.2em;
}

.mensagem-erro {
  text-align: center;
  padding: 0.5rem 0;
}

.btn-login {
  margin-top: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #0d0d0d;
  background: linear-gradient(135deg, #fff 0%, #e8e8e8 100%);
  border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255,255,255,0.15);
}

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

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