/* 1. Importação da Fonte e Variáveis Globais */
@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400..900&display=swap");

:root {
  --bg-color: #0d0d0d;
  --card-bg: #1e1e1ee6;
  --input-bg: #d9d9d9;
  --accent-purple: #7b2ff7;
  --text-white: #ffffff;
  --text-label: #a0a0a0;
  --success-green: #28a745;
  --error-red: #ff4d4d;
}

/* 2. Reset e Configurações de Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Orbitron", sans-serif;
}

/* Acessibilidade de toque */
button,
input,
.login-link a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(123, 47, 247, 0.2);
}

@media (pointer: coarse) {
  input {
    min-height: 44px;
  }

  .btn-submit {
    min-height: 44px;
  }

  .password-field input {
    padding-right: 52px;
  }

  .password-field button {
    width: 40px;
    height: 40px;
    right: 6px;
    border-radius: 8px;
    justify-content: center;
  }

  .login-link a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
}

/* FUNDO GEOMÉTRICO — substitua o body::before e body::after antigos */

body {
  background: radial-gradient(
    ellipse at 80% 60%,
    #1e1230 0%,
    #111 55%,
    #0a0a0a 100%
  );
  color: var(--text-white);
  min-height: 100vh;
  padding: 24px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* --- FOLHA UNIFICADA E PADRONIZADA DE TOASTS (SUPERIOR DIREITO) --- */
#notification-container {
  position: fixed !important;
  top: 24px !important;
  right: 24px !important;
  bottom: auto !important;
  left: auto !important;
  display: flex !important;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  z-index: 9999;
}

.toast {
  background-color: #1e1e1e;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 10px;
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  
  /* Estado Inicial Oculto */
  opacity: 0;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.25), opacity 0.3s ease;
}

/* Transição de Entrada */
.toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* Configurações Temáticas de Cores Sólidas */
.toast.success {
  background-color: #1b5e20 !important; /* Fundo Verde Sólido */
  border-left: 4px solid #00ff66 !important; /* Linha Neon */
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.15);
}

.toast.error {
  background-color: #8b0000 !important; /* Fundo Vermelho Sólido */
  border-left: 4px solid #ff4d4d !important; /* Linha Neon */
  box-shadow: 0 0 15px rgba(255, 77, 77, 0.15);
}

.toast.info {
  background-color: #0056b3 !important; /* Fundo Azul Sólido */
  border-left: 4px solid #00a2ff !important; /* Linha Neon */
  box-shadow: 0 0 15px rgba(0, 162, 255, 0.15);
}

/* Responsividade Adaptativa */
@media (max-width: 480px) {
  #notification-container {
    top: 12px !important;
    right: 12px !important;
    left: 12px !important;
    width: calc(100% - 24px);
  }
  .toast {
    min-width: 0;
    width: 100%;
    transform: translateY(-20px);
  }
  .toast.show {
    transform: translateY(0);
  }
}

@keyframes glow {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.6) saturate(1.4);
  }
}

.bg-geo {
  position: fixed;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  transition: transform 0.12s ease-out;
}

.bg-geo .b {
  position: absolute;
  border-radius: 2px;
}
.b1 {
  left: 4%;
  top: 24%;
  width: 7%;
  height: 30%;
  background: #d946ef;
  animation: glow 3.5s ease-in-out infinite;
}
.b2 {
  left: 11%;
  top: 54%;
  width: 21%;
  height: 24%;
  background: #cc3de8;
  animation: glow 3.5s ease-in-out 0.5s infinite;
}
.b3 {
  left: 4%;
  top: 78%;
  width: 7%;
  height: 16%;
  background: #d946ef;
  animation: glow 3s ease-in-out 0.2s infinite;
}
.b4 {
  left: 4%;
  top: 91%;
  width: 55%;
  height: 9%;
  background: #d946ef;
  animation: glow 3s ease-in-out 0.1s infinite;
}
.b5 {
  left: 49%;
  top: 5%;
  width: 8%;
  height: 13%;
  background: #b026d3;
  animation: glow 2.8s ease-in-out 1s infinite;
}
.b6 {
  left: 36%;
  top: 17%;
  width: 21%;
  height: 14%;
  background: #b026d3;
  animation: glow 2.8s ease-in-out 1s infinite;
}
.b7 {
  left: 57%;
  top: 31%;
  width: 10%;
  height: 17%;
  background: #9333ea;
  animation: glow 3.8s ease-in-out 1.5s infinite;
}
.b8 {
  left: 67%;
  top: 14.05%;
  width: 29%;
  height: 17.1%;
  background: #8b2be2;
  animation: glow 3.5s ease-in-out 0.8s infinite;
}
.b9 {
  left: 90%;
  top: 31%;
  width: 10%;
  height: 66%;
  background: #7c22d4;
  animation: glow 4s ease-in-out 0.3s infinite;
}



/* 4. Estrutura do Card Principal */
.registration-card {
  display: flex;
  background-color: var(--card-bg);
  width: 100%;
  max-width: 1050px;
  padding: 60px;
  border-radius: 28px;
  gap: 50px;
  align-items: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  flex-wrap: wrap;
  align-items: center;
  backdrop-filter: blur(10px);
}

/* 5. Lado das Ilustrações */
.illustrations-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  min-width: 220px;
}

.img-character {
  width: 100%;
  max-width: 420px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(123, 47, 247, 0.4));
}

.img-bulb {
  width: 100%;
  max-width: 180px;
  height: auto;
  object-fit: contain;
}

/* 6. Lado do Formulário */
.form-side {
  flex: 1.4;
  min-width: 0;
}

h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 30px;
  text-align: left;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-grid > * {
  min-width: 0;
}

/* 7. Estilização dos Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.full-width {
  grid-column: span 2;
}

label {
  font-size: 0.8rem;
  color: var(--text-label);
  font-weight: 600;
  text-transform: none;
}

input {
  width: 100%;
  min-width: 0;
  background-color: var(--input-bg);
  border: none;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 1rem;
  color: #1a1a1a; /* Texto dentro do input escuro para contraste */
  outline: none;
  transition: all 0.2s;
}

input:focus {
  background-color: #fff;
  transition: 0.2s;
  box-shadow: 0 0 0 4px rgba(123, 47, 247, 0.3);
}

.input-invalid {
  border: 1px solid var(--error-red) !important;
  box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.22) !important;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.password-field input {
  width: 100%;
  padding-right: 44px;
}

.password-field button {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #888;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.password-field button:hover {
  color: #333;
}

.regras-validacao {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-10px);
  transition:
    max-height 0.4s ease,
    opacity 0.4s ease,
    transform 0.4s ease;
  margin-top: 0;
}

.regras-validacao.show {
  margin-top: 20px;
  max-height: 200px;
  opacity: 1;
  transform: translateX(0);
}

input[type="password"] {
  font-family: "Orbitron", sans-serif;
}

/* 8. Botão e Links */
.btn-submit {
  width: 100%;
  background-color: var(--accent-purple);
  color: white;
  border: none;
  padding: 18px;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 25px;
  transition: 0.3s;
}

.btn-submit:hover {
  background-color: #6a24d4;
  transform: translateY(-2px);
}

.login-link {
  text-align: center;
  margin-top: 15px;
}

.login-link a {
  color: var(--text-label);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.login-link a:hover {
  color: var(--text-white);
  text-decoration: underline;
}

/* 9. Responsividade (Mobile) */
@media (max-width: 1100px) {
  body {
    align-items: flex-start;
  }

  .bg-geo {
    opacity: 0.85;
  }

  .registration-card {
    flex-direction: column;
    padding: 40px 24px;
    margin: 16px 0;
    gap: 32px;
  }

  .form-side {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: span 1;
  }

  h1 {
    font-size: 2.5rem;
    text-align: center;
  }
}

@media (max-width: 780px) {
  .registration-card {
    padding: 30px 18px;
    gap: 22px;
  }

  .img-character {
    max-width: 260px;
  }

  .btn-submit {
    margin-top: 18px;
  }
}

@media (max-width: 600px) {
  body {
    padding: 16px 12px 24px;
  }

  .registration-card {
    padding: 24px 16px;
    border-radius: 20px;
    gap: 24px;
  }

  .illustrations-side {
    min-width: 0;
    gap: 16px;
  }

  .img-character {
    max-width: 220px;
  }

  h1 {
    font-size: 2rem;
    margin-bottom: 20px;
  }

  label {
    font-size: 0.75rem;
  }

  input {
    padding: 13px 14px;
    font-size: 0.92rem;
  }

  .btn-submit {
    padding: 16px;
    font-size: 1rem;
  }

  .bg-geo {
    top: -18%;
    left: -16%;
    width: 132%;
    height: 132%;
    opacity: 0.72;
  }

  .b8,
  .b9 {
    opacity: 0.45;
  }
}

@media (max-width: 360px) {
  body {
    padding: 12px 8px 18px;
  }

  .registration-card {
    padding: 18px 10px;
    border-radius: 16px;
    gap: 16px;
  }

  .illustrations-side {
    gap: 10px;
  }

  .img-character {
    max-width: 170px;
  }

  h1 {
    font-size: 1.65rem;
    margin-bottom: 14px;
  }

  .form-grid {
    gap: 10px;
  }

  label {
    font-size: 0.72rem;
  }

  input {
    padding: 11px 12px;
    font-size: 0.85rem;
  }

  .btn-submit {
    padding: 13px;
    font-size: 0.95rem;
    margin-top: 14px;
  }

  .login-link {
    margin-top: 12px;
  }

  .login-link a {
    font-size: 0.8rem;
  }

  .password-checklist {
    font-size: 0.7rem;
  }

  .bg-geo {
    opacity: 0.62;
  }

  .b7,
  .b8,
  .b9 {
    opacity: 0.22;
  }
}

/* NOVA LÓGICA: Asterisco em campos obrigatórios */
.input-group label:has(+ input[required])::after,
.input-group label:has(+ .password-field input[required])::after {
  content: " *";
  color: #ff4d4d;
  font-weight: bold;
  margin-left: 4px;
}

/* Garante que o checklist de senha tenha estilo de lista */
.password-checklist {
  list-style: none;
  font-size: 0.75rem;
  padding-left: 5px;
}

.password-checklist li {
  color: var(--text-label);
  transition: color 0.3s;
}

@media (max-width: 320px) {
  body {
    padding: 10px 6px 14px;
  }

  .registration-card {
    padding: 14px 8px;
    border-radius: 14px;
    gap: 14px;
  }

  .illustrations-side {
    gap: 8px;
  }

  .img-character {
    max-width: 140px;
  }

  h1 {
    font-size: 1.45rem;
    margin-bottom: 10px;
  }

  .form-grid {
    gap: 8px;
  }

  .input-group {
    gap: 4px;
  }

  label {
    font-size: 0.68rem;
  }

  input {
    padding: 9px 10px;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .password-field button {
    right: 8px;
    font-size: 14px;
  }

  .btn-submit {
    padding: 11px;
    font-size: 0.9rem;
    margin-top: 12px;
  }

  .login-link {
    margin-top: 10px;
  }

  .login-link a {
    font-size: 0.75rem;
  }

  .password-checklist {
    font-size: 0.66rem;
    padding-left: 2px;
  }

  .bg-geo {
    opacity: 0.5;
  }

  .b7,
  .b8,
  .b9 {
    display: none;
  }
}
