/* ================= BASE ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  min-height: 100vh;
  color: #fff;
  background: radial-gradient(circle at center, #0a1929 0%, #020508 100%);
  background-repeat: no-repeat;
  background-size: 185% 185%;
  animation: respirar 7s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ================= ANIMAÇÃO FUNDO ================= */
@keyframes respirar {
  0%   { background-size: 185% 185%; background-position: 48% 52%; }
  50%  { background-size: 215% 215%; background-position: 52% 48%; }
  100% { background-size: 185% 185%; background-position: 48% 52%; }
}

/* ================= HEADER ================= */
.header {
  height: 100px;
  width: 100%;
  position: fixed;
  top: 0;
  background-image: url('../CSS/imagens/Suntech-Sunlab.png');
  background-size: 38%;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1000;
}

.link-clicavel {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 100px;
}

/* ================= WRAPPER CENTRAL ================= */
.page-wrapper {
  margin-top: 130px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* ================= FRAME FUTURISTA (ESTADO INICIAL) ================= */
.login-shell {
  position: relative;
  width: 120px;
  height: 120px;
  transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ================= 4 CANTOS DO FRAME ================= */
.frame-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid #00d9ff;
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
  transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Canto Superior Esquerdo */
.corner-tl {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}

/* Canto Superior Direito */
.corner-tr {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
}

/* Canto Inferior Esquerdo */
.corner-bl {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
}

/* Canto Inferior Direito */
.corner-br {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}

/* ================= CONTAINER DE LOGIN (OCULTO) ================= */
.login-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
  transition: opacity 0.6s ease 0.5s;
}

/* ================= ESTADO EXPANDIDO ================= */
.login-shell.expanded {
  width: 90%;
  max-width: 450px;
  height: auto;
  min-height: 500px;
  background: rgba(10, 25, 41, 0.75);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  box-shadow: 
    0 8px 32px rgba(0, 217, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(0, 217, 255, 0.3);
}

/* Cantos expandidos (quase invisíveis) */
.login-shell.expanded .frame-corner {
  width: 20px;
  height: 20px;
  opacity: 0.3;
  border-color: rgba(0, 217, 255, 0.4);
  box-shadow: none;
}

/* Container visível após expansão */
.login-shell.expanded .login-container {
  opacity: 1;
  pointer-events: all;
  padding: 40px 30px;
  position: static;
}

/* ================= CONTEÚDO DO LOGIN ================= */
.login-container h2 {
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #00d9ff;
  text-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
  animation: fadeInDown 0.6s ease 0.8s both;
}

/* ================= MENSAGEM DE ERRO ================= */
.error-message {
  background: rgba(255, 68, 68, 0.2);
  border: 1px solid #ff4444;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
  color: #ffcccc;
  font-size: 14px;
  animation: fadeInDown 0.6s ease 0.9s both;
}

/* ================= GRUPOS DE INPUT ================= */
.input-group {
  margin-bottom: 25px;
  animation: fadeInUp 0.6s ease both;
  width: 100%;
}

.input-group:nth-child(1) {
  animation-delay: 1s;
}

.input-group:nth-child(2) {
  animation-delay: 1.2s;
}

.login-container label {
  display: block;
  margin-bottom: 8px;
  text-align: left;
  font-weight: 500;
  font-size: 14px;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-container input[type="text"],
.login-container input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(0, 217, 255, 0.3);
  border-radius: 10px;
  background: rgba(15, 35, 55, 0.6);
  color: #fff;
  font-size: 16px;
  transition: all 0.3s ease;
  outline: none;
}

.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
  border-color: #00d9ff;
  background: rgba(15, 35, 55, 0.8);
  box-shadow: 
    0 0 20px rgba(0, 217, 255, 0.3),
    inset 0 0 10px rgba(0, 217, 255, 0.1);
}

/* ================= BOTÃO LOGIN ================= */
.btn-login {
  width: 100%;
  background: linear-gradient(135deg, #0066ff 0%, #00d9ff 100%);
  border: none;
  border-radius: 10px;
  padding: 14px;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease 1.4s both;
  box-shadow: 0 4px 15px rgba(0, 102, 255, 0.4);
}

.btn-login::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 ease;
}

.btn-login:hover {
  box-shadow: 0 6px 25px rgba(0, 217, 255, 0.6);
  transform: translateY(-2px);
}

.btn-login:hover::before {
  left: 100%;
}

/* ================= SPINNER DO BOTÃO ================= */
.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 10px;
}

.btn-login.loading .btn-text {
  opacity: 0.5;
}

.btn-login.loading .btn-spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================= LINKS DE REGISTRO ================= */
.register-link {
  display: block;
  margin-top: 15px;
  color: #7dd3fc;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease both;
}

.register-link:first-of-type {
  animation-delay: 1.6s;
}

.register-link:last-of-type {
  animation-delay: 1.7s;
}

.register-link:hover {
  color: #00d9ff;
  text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

/* ================= RODAPÉ ================= */
footer {
  margin-top: auto;
  text-align: center;
  padding: 15px 0;
  background: rgba(15, 25, 35, 0.8);
  border-top: 1px solid rgba(0, 217, 255, 0.2);
  font-size: 13px;
  color: #7dd3fc;
}

/* ================= ANIMAÇÕES ================= */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= RESPONSIVO ================= */
@media (max-width: 500px) {
  .login-shell.expanded {
    max-width: 95%;
    padding: 20px;
  }
  
  .login-container h2 {
    font-size: 24px;
  }
  
  .header {
    background-size: 60%;
  }
}
