/* =============================================== */
/* === 1. IMPORTS & VARIÁVEIS ROOT             === */
/* =============================================== */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap");


/* =============================================== */
/* === 2. ESTILOS GLOBAIS & RESETS             === */
/* =============================================== */
body {
  background: var(--fundo-pagina);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Poppins", sans-serif;
  height: 100vh;
  margin: 0;
}

/* =============================================== */
/* === 3. TIPOGRAFIA                           === */
/* =============================================== */
h1 {
  font-weight: 700;
  color: var(--azul-principal);
  margin-bottom: 8px;
}

p {
  font-size: 14px;
  font-weight: 300;
  line-height: 22px;
  letter-spacing: 0.5px;
  margin: 20px 0 30px;
}

a {
  color: var(--azul-principal);
  font-size: 14px;
  text-decoration: none;
  margin: 15px 0;
  transition: color 0.3s ease;
  font-weight: bold;
}

a:hover {
  text-decoration: underline;
}

span {
  font-size: 13px;
  color: var(--texto-secundario);
}

.form-header h1 {
  color: var(--preto-intenso);
}

.form-header .subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--texto-secundario);
  line-height: 1.4;
  margin-top: 0px;
  margin-bottom: 15px;
}

.overlay-panel h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0;
  color: var(--branco-puro);
}

.overlay-panel p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
  opacity: 0.9;
  margin-top: 0;
}

/* =============================================== */
/* === 4. LAYOUT PRINCIPAL & CONTÊINERES       === */
/* =============================================== */
.container-card {
  background-color: var(--branco-puro);
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 100%;
}

.form-container {
  position: absolute;
  top: 0;
  height: 100%;
  transition: all 0.6s ease-in-out;
  overflow-y: auto;
  background-color: var(--branco-puro);
}

.sign-in-container {
  left: 0;
  width: 50%;
  z-index: 2;
}

.sign-up-container {
  left: 0;
  width: 50%;
  opacity: 0;
  z-index: 1;
}

/* =============================================== */
/* === 5. COMPONENTES DE FORMULÁRIO            === */
/* =============================================== */

/* --- Estilos Gerais do Formulário --- */
form {
  background-color: var(--branco-puro);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  text-align: center;
  width: 80%;
  margin: auto;
  min-height: 100%;
}

form .form-footer p {
  margin-bottom: 0;
}

form .forgot-password {
  color: var(--azul-principal);
  font-weight: normal;
  font-size: 14px;
  text-align: right;
  width: 100%;
}

/* --- Inputs & Selects --- */
/* Estiliza o container do Select2 */
.select2-container .select2-selection--single {
  height: auto !important;
  border: 1.5px solid var(--cinza-borda-input) !important;
  border-radius: 12px !important;
  padding: 14px 18px !important;
  margin: 10px 0 !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  color: var(--texto-principal) !important;
  display: flex;
  align-items: center;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

/* Texto dentro do Select2 */
.select2-container .select2-selection__rendered {
  color: var(--texto-principal) !important;
  padding-left: 0 !important;
}

/* Ícone da seta */
.select2-container .select2-selection__arrow {
  top: 50% !important;
  right: 15px !important;
  transform: translateY(-50%);
}

/* Placeholder */
.select2-container .select2-selection__placeholder {
  color: #a0a8b3 !important;
}

/* Foco (igual ao input) */
.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--azul-principal) !important;
  box-shadow: 0 0 0 3px rgba(83, 141, 238, 0.15) !important;
  outline: none !important;
}


input,
.form-select {
  border: 1.5px solid var(--cinza-borda-input);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 10px 0;
  width: 100%;
  font-size: 15px;
  font-weight: 400;
  color: var(--texto-principal);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder {
  color: #a0a8b3;
}

input:focus {
  border-color: var(--azul-principal);
  box-shadow: 0 0 0 3px rgba(83, 141, 238, 0.15);
  outline: none;
}

/* --- Específicos de Senha --- */
.password-container {
  position: relative;
  width: 100%;
}

.password-container input {
  width: 100%;
  padding-right: 45px !important;
}

.password-container .toggle-password {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--texto-secundario);
}

.password-feedback-container {
  width: 100%;
  padding: 10px 15px;
  background-color: var(--branco-puro);
  border-radius: 8px;
  margin-top: 5px;
  margin-bottom: 10px;
  text-align: left;
  transition: all 0.3s ease;
}

.password-criteria-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.password-criteria-list li,
#password-match-feedback p {
  color: var(--cor-erro);
  margin-bottom: 5px;
  transition: color 0.3s ease;
}

.password-criteria-list li:last-child {
  margin-bottom: 0;
}

#password-match-feedback p {
    margin-top: 0px;
    margin-bottom: 0;
}

.password-criteria-list li.valid,
#password-match-feedback p.valid {
  color: var(--cor-sucesso);
}

.password-criteria-list li i,
#password-match-feedback p i {
  margin-right: 8px;
  width: 15px;
  text-align: center;
}

/* --- Botões --- */
button[type="submit"] {
  background: var(--preto-intenso);
  border-radius: 8px;
  border: none;
  color: var(--branco-puro);
  font-size: 1rem;
  font-weight: 600;
  padding: 16px;
  width: 100%;
  cursor: pointer;
  transition: filter 0.2s;
  text-transform: none;
}

button[type="submit"]:hover {
  filter: brightness(1.1);
}

/* =============================================== */
/* === 6. ESTILOS DO OVERLAY & PAINÉIS         === */
/* =============================================== */
.overlay-container {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  transition: transform 0.6s ease-in-out;
  z-index: 100;
}

.overlay {
  background: linear-gradient(-45deg, #2d54a5, #1e3a70, #3f89f8, #0a2965);
  background-size: 400% 400%;
  animation: animateGradient 20s ease infinite;
  color: var(--branco-puro);
  position: relative;
  left: -100%;
  height: 100%;
  width: 200%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
  overflow: hidden;
}

.overlay-panel {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 40px;
  text-align: center;
  top: 0;
  height: 100%;
  width: 50%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
  z-index: 10;
}

.overlay-panel .text-content {
  text-align: left;
  max-width: 80%;
}

.divider {
  display: block;
  width: 70px;
  height: 4px;
  background-color: var(--branco-puro);
  border-radius: 2px;
  margin: 20px 0;
}

/* --- Lógica de Deslizamento dos Painéis --- */
.container-card.right-panel-active .sign-in-container {
  transform: translateX(100%);
}
.container-card.right-panel-active .sign-up-container {
  transform: translateX(100%);
  opacity: 1;
  z-index: 5;
  animation: show 0.6s;
}
.container-card.right-panel-active .overlay-container {
  transform: translateX(-100%);
}
.container-card.right-panel-active .overlay {
  transform: translateX(50%);
}
.overlay-left {
  transform: translateX(-20%);
}
.container-card.right-panel-active .overlay-left {
  transform: translateX(0);
}
.overlay-right {
  right: 0;
  transform: translateX(0);
}
.container-card.right-panel-active .overlay-right {
  transform: translateX(20%);
}

/* --- Toast --- */

.custom-toast {
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.custom-toast.success {
  background-color: #e6ffed !important;
  color: #155724 !important;
  border-left: 5px solid #28a745;
}

.custom-toast.error {
  background-color: #fdecea !important;
  color: #721c24 !important;
  border-left: 5px solid #dc3545;
}

.swal2-icon {
  margin-right: 10px;
}


/* =============================================== */
/* === 7. ANIMAÇÕES & KEYFRAMES                === */
/* =============================================== */
@keyframes animateGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes moveWave {
  0% { background-position-x: 0; }
  100% { background-position-x: -1440px; }
}

@keyframes show {
  0%, 49.99% {
    opacity: 0;
    z-index: 1;
  }
  50%, 100% {
    opacity: 1;
    z-index: 5;
  }
}

/* =============================================== */
/* === 8. DESIGN RESPONSIVO (MAX-WIDTH: 768px) === */
/* =============================================== */
@media (max-width: 768px) {
  .overlay-container {
    display: none;
  }

  .form-container {
    width: 100%;
    transform: none !important;
    opacity: 1 !important;
    animation: none !important;
    z-index: 1;
    left: 0;
  }

  .container-card {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .sign-up-container {
    display: none;
  }

  .sign-in-container {
    display: flex;
  }

  .container-card.right-panel-active .sign-in-container {
    display: none;
  }

  .container-card.right-panel-active .sign-up-container {
    display: flex;
  }

  form {
    width: 90%;
    padding: 30px 0;
  }

  .overlay-panel h1 {
    font-size: 1.8rem;
  }
}