:root {
  --primary: #F9B000;
  --primary-dark: #d99300;
  --dark: #2b1510;
  --light: #ffffff;
  --gray: #f5f5f5;
  --text: #222222;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  min-height: 100vh;
  background-color: #ffffff;
  color: var(--text);
}

/* ==== HEADER ==== */
.header {
  width: 100%;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.logo {
  cursor: pointer;
}

.logo img {
  height: 130px;
  width: auto;
  display: block;
}

/* ==== MAIN ==== */
.login-main {
  min-height: calc(100vh - 130px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1rem;
}

/* ==== CONTAINER DE LOGIN ==== */
.registro-container {
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
  padding: 2.6rem 2.2rem 2.1rem;
  border-radius: 22px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.18);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: floatUp 0.6s ease-out;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.registro-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.22);
}

/* Badge + Ícone */
.icon-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
}

.icon-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffe9a8, #f9b000);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4d1818;
  font-size: 1.6rem;
  box-shadow: 0 16px 35px rgba(249, 176, 0, 0.6);
  animation: pulseSoft 2.6s ease-in-out infinite;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(249, 176, 0, 0.12);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge::before {
  content: "★";
  font-size: 0.85rem;
}

/* ==== TÍTULO E SUBTÍTULO ==== */
.registro-container h2 {
  font-size: 1.9rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1.8rem;
  line-height: 1.5;
}

/* ==== FORMULÁRIO ==== */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

/* email + 2FA */
.form-group input {
  width: 100%;
  padding: 14px 44px 14px 16px;
  border: 1.9px solid #e0e0e0;
  border-radius: 999px;
  outline: none;
  font-size: 0.98rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    transform 0.08s ease;
  background-color: #ffffff;
}

.form-group input:focus {
  border-color: var(--primary);
  background: #fffdf6;
  box-shadow:
    0 0 0 1px rgba(249, 176, 0, 0.4),
    0 10px 26px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* Label flutuante padrão */
.form-group label {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  background-color: var(--light);
  padding: 0 6px;
  color: #999;
  font-size: 0.86rem;
  pointer-events: none;
  transition: all 0.23s ease;
  z-index: 1;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 0.74rem;
  color: var(--primary);
}

/* Ícone dentro do input (email / 2FA) */
.input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #c2c2c2;
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.form-group input:focus ~ .input-icon {
  color: var(--primary);
  transform: translateY(-50%) scale(1.05);
}

/* ==== SENHA ==== */
.senha-group {
  margin-bottom: 1.4rem;
}

.senha-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.senha-wrapper input {
  flex: 1;
  padding: 14px 44px 14px 16px;
  border: 1.9px solid #e0e0e0;
  border-radius: 999px;
  outline: none;
  font-size: 0.98rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    transform 0.08s ease;
  background-color: #ffffff;
}

.senha-wrapper input:focus {
  border-color: var(--primary);
  background: #fffdf6;
  box-shadow:
    0 0 0 1px rgba(249, 176, 0, 0.4),
    0 10px 26px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* Label flutuante dentro do wrapper da senha */
.senha-wrapper label {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  background-color: var(--light);
  padding: 0 6px;
  color: #999;
  font-size: 0.86rem;
  pointer-events: none;
  transition: all 0.23s ease;
  z-index: 1;
}

.senha-wrapper input:focus + label,
.senha-wrapper input:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 0.74rem;
  color: var(--primary);
}

/* Ícone de olho */
.senha-wrapper img.toggle-senha {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 2;
}

.senha-wrapper img.toggle-senha.animar {
  transform: scale(1.2);
  opacity: 0.7;
}

/* ==== BOTÃO ==== */
button {
  margin-top: 0.3rem;
  padding: 0.95rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 32px rgba(249, 176, 0, 0.55);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

button span {
  position: relative;
  z-index: 1;
}

button i {
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.22) 40%,
    transparent 80%
  );
  transform: translateX(-140%);
  opacity: 0;
  pointer-events: none;
}

button:hover {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.03);
  box-shadow: 0 18px 40px rgba(249, 176, 0, 0.65);
}

button:hover::after {
  animation: buttonShine 0.7s ease-out forwards;
  opacity: 1;
}

button:hover i {
  animation: arrowMove 0.7s ease-in-out infinite;
}

button:active {
  transform: translateY(0);
  box-shadow: 0 9px 20px rgba(249, 176, 0, 0.45);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}

/* ==== LINKS ==== */
.login-link {
  margin-top: 1.6rem;
  font-size: 0.92rem;
  color: #555;
  line-height: 1.5;
}

.login-link a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
  position: relative;
}

.login-link a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 0.25s ease;
}

.login-link a:hover::after {
  width: 100%;
}

/* ==== CAIXA DE ERRO DO JS ==== */
#caixaErro {
  background-color: #fdecea;
  color: #b71c1c;
  border: 1px solid #f5c6cb;
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ==== OVERLAY LOADING ==== */
#loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid var(--gray);
  border-top: 6px solid var(--primary);
  border-radius: 50%;
  animation: girar 1s linear infinite;
}

/* ==== ANIMAÇÕES ==== */
@keyframes girar {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseSoft {
  0% {
    transform: scale(1);
    box-shadow: 0 14px 30px rgba(249, 176, 0, 0.48);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 20px 45px rgba(249, 176, 0, 0.72);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 14px 30px rgba(249, 176, 0, 0.48);
  }
}

@keyframes arrowMove {
  0% { transform: translateX(0); }
  50% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

@keyframes buttonShine {
  0% { transform: translateX(-140%); }
  100% { transform: translateX(140%); }
}

/* ==== RESPONSIVIDADE ==== */
@media (max-width: 600px) {
  .logo img {
    height: 90px;
  }

  .login-main {
    padding: 2.5rem 1rem;
  }

  .registro-container {
    padding: 2.2rem 1.6rem 1.7rem;
    border-radius: 20px;
  }

  .registro-container h2 {
    font-size: 1.7rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }
}
