/* ==========================================================================
   ClassHub - Tema Onyx & Crimson (Foco no Preto Absoluto e Alto Contraste)
   ========================================================================== */

:root {
  /* Paleta Onyx & Crimson */
  --bg-dark: #121212;
  --bg-pure-black: #000000;
  --card-bg: #1E1E1E;
  --card-bg-elevated: #27272A;
  
  /* Carmesim / Ação */
  --crimson-primary: #E11D48;
  --crimson-hover: #D90429;
  --crimson-active: #BE123C;
  --crimson-glow: rgba(225, 29, 72, 0.35);
  
  /* Textos e Tipografia */
  --text-white: #FFFFFF;
  --text-light: #F3F4F6;
  --text-muted: #A1A1AA;
  --text-dim: #71717A;
  
  /* Bordas e Inputs */
  --border-subtle: #2E2E33;
  --input-bg: #27272A;
  --input-border: #3F3F46;
  --input-focus: #E11D48;
  
  /* Alertas Dark */
  --alert-danger-bg: rgba(225, 29, 72, 0.15);
  --alert-danger-text: #FECDD3;
  --alert-danger-border: rgba(225, 29, 72, 0.4);
  
  --alert-success-bg: rgba(16, 185, 129, 0.15);
  --alert-success-text: #A7F3D0;
  --alert-success-border: rgba(16, 185, 129, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-light);
  overflow-x: hidden;
}

/* Fundo Geral com Atmosfera Onyx & Detalhes Sutis em Carmesim */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  position: relative;
  background: radial-gradient(circle at 18% 22%, #1b0a10 0%, #121212 55%, var(--bg-pure-black) 100%);
  overflow: hidden;
}

/* Curvas decorativas de fundo em SVG */
.auth-wrapper::before {
  content: "";
  position: absolute;
  top: -20%;
  left: -10%;
  width: 70vw;
  height: 140vh;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.06) 0%, transparent 65%);
  pointer-events: none;
  z-index: 1;
}

.auth-wrapper::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: 20%;
  width: 50vw;
  height: 80vh;
  border: 2px solid rgba(225, 29, 72, 0.08);
  border-radius: 45%;
  pointer-events: none;
  z-index: 1;
  transform: rotate(-15deg);
}

/* Grid Principal em 2 Colunas */
.auth-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* Coluna da Esquerda (Identidade Institucional e Ilustração) */
.auth-brand-side {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3.5rem 4rem;
  color: var(--text-light);
  position: relative;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-text {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-white);
  line-height: 1;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.brand-logo-text:hover {
  opacity: 0.92;
  color: var(--text-white);
}

.brand-logo-text span {
  color: var(--crimson-primary);
  text-shadow: 0 0 16px rgba(225, 29, 72, 0.4);
}

.brand-divider {
  width: 2px;
  height: 42px;
  background: rgba(255, 255, 255, 0.18);
}

.brand-institution {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.institution-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-white);
  margin-bottom: 2px;
}

.institution-subtitle {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

.brand-hero {
  margin: auto 0;
  max-width: 540px;
}

.brand-slogan {
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--text-light);
  font-weight: 300;
  margin-bottom: 2rem;
}

.brand-illustration {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.75));
  transition: transform 0.4s ease;
}

.brand-illustration:hover {
  transform: translateY(-4px);
}

.brand-footer {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Coluna da Direita (Card Cinzento Escuro Onyx) */
.auth-form-side {
  flex: 0.9;
  background-color: var(--card-bg);
  border-top-left-radius: 40px;
  border-bottom-left-radius: 40px;
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.5);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem;
  position: relative;
  z-index: 5;
}

.auth-card-content {
  width: 100%;
  max-width: 440px;
}

/* Cabeçalho do Card */
.auth-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.auth-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.5px;
  margin: 0;
}

/* Mensagens de Alerta Estilo Dark */
.suap-alert {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.suap-alert.show {
  display: flex;
}

.suap-alert-danger {
  background-color: var(--alert-danger-bg);
  color: var(--alert-danger-text);
  border: 1px solid var(--alert-danger-border);
}

.suap-alert-success {
  background-color: var(--alert-success-bg);
  color: var(--alert-success-text);
  border: 1px solid var(--alert-success-border);
}

.suap-alert-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Campos de Formulário Onyx */
.form-group-suap {
  margin-bottom: 1.35rem;
  position: relative;
}

.form-label-suap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.45rem;
}

.form-label-suap i {
  font-size: 0.95rem;
  color: var(--crimson-primary);
}

.form-control-suap {
  width: 100%;
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  padding: 0.78rem 1rem;
  font-size: 0.95rem;
  color: var(--text-light);
  background-color: var(--input-bg);
  transition: all 0.2s ease-in-out;
}

.form-control-suap::placeholder {
  color: var(--text-dim);
}

.form-control-suap:focus {
  border-color: var(--crimson-primary);
  background-color: #2e2e33;
  color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.25);
}

.form-control-suap.is-invalid {
  border-color: var(--crimson-primary);
  background-color: rgba(225, 29, 72, 0.08);
}

.form-control-suap.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.35);
}

.invalid-feedback-suap {
  display: none;
  color: #fda4af;
  font-size: 0.8rem;
  margin-top: 0.4rem;
  font-weight: 500;
}

.form-control-suap.is-invalid ~ .invalid-feedback-suap {
  display: block;
}

/* Campo com Botão de Revelar Senha */
.password-wrapper {
  position: relative;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: color 0.2s;
}

.password-toggle-btn:hover {
  color: var(--text-white);
}

/* Botão Principal Estilo Onyx & Crimson */
.btn-suap-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.88rem 1.5rem;
  background: linear-gradient(135deg, var(--crimson-primary) 0%, var(--crimson-hover) 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--crimson-glow);
  transition: all 0.25s ease;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
}

.btn-suap-primary:hover {
  background: linear-gradient(135deg, #f43f5e 0%, var(--crimson-primary) 100%);
  box-shadow: 0 8px 26px rgba(225, 29, 72, 0.55);
  transform: translateY(-1px);
}

.btn-suap-primary:active {
  transform: translateY(1px);
  box-shadow: 0 3px 12px rgba(225, 29, 72, 0.3);
}

.btn-suap-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Links Auxiliares */
.auth-aux-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.link-suap {
  color: #fb7185;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s, text-decoration 0.2s;
}

.link-suap:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Rodapé do Card */
.auth-card-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-card-footer a {
  display: block;
  margin-top: 0.35rem;
  font-weight: 600;
  color: var(--crimson-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.auth-card-footer a:hover {
  color: #fda4af;
  text-decoration: underline;
}

/* Animações e Loading */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spinner-border-sm {
  width: 1.1rem;
  height: 1.1rem;
  border-width: 0.18em;
}

/* ==========================================================================
   LAYOUT RESPONSIVO (Telas menores / Mobile e Tablets)
   - Oculta completamente a ilustração (celular e crianças) e detalhes institucionais
   - Mantém no topo apenas o nome "ClassHub"
   - Centraliza perfeitamente o card de Login / Cadastro / Recuperação no meio
   ========================================================================== */
@media (max-width: 992px) {
  .auth-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.25rem;
    min-height: 100vh;
  }

  /* Coluna da Marca no Mobile: Apenas o nome ClassHub centralizado no topo */
  .auth-brand-side {
    flex: 0 0 auto;
    width: 100%;
    max-width: 480px;
    padding: 0 0 1.5rem 0;
    align-items: center;
    text-align: center;
  }

  .brand-header {
    justify-content: center;
    width: 100%;
    margin: 0;
  }

  .brand-logo-text {
    font-size: 2.6rem;
  }

  /* Oculta a ilustração com celular e crianças, slogans e rodapé institucional */
  .brand-hero,
  .brand-illustration,
  .brand-slogan,
  .brand-divider,
  .brand-institution,
  .brand-footer {
    display: none !important;
  }

  /* Card de formulário centralizado no meio da tela no Mobile */
  .auth-form-side {
    flex: 0 0 auto;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-subtle);
    padding: 2.5rem 1.75rem;
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: 1.5rem 1rem;
  }

  .brand-logo-text {
    font-size: 2.25rem;
  }

  .auth-title {
    font-size: 1.8rem;
  }

  .auth-form-side {
    padding: 2rem 1.25rem;
    border-radius: 20px;
  }
}
