/* ==========================================================================
   auth.css
   Estilo unificado para telas de autenticação (login, acesso negado, etc.)
   Bootstrap 5.3.8 | Tema escuro | Responsivo
   ========================================================================== */

:root {
  --auth-bg: #0f1120;
  --auth-bg-alt: #131626;
  --auth-card-bg: #171a2e;
  --auth-accent: #b9cc01;
  --auth-accent-dark: #97a601;
  --auth-blue: #007cc3;
  --auth-blue-light: #2fa6e8;
  --auth-danger: #e74c3c;
  --auth-text: #eef0f7;
  --auth-text-muted: #9096b0;
  --auth-border: rgba(255, 255, 255, 0.08);
  --auth-radius: 1rem;
  --auth-radius-sm: 0.6rem;
  --auth-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.55), 0 8px 16px -8px rgba(0, 0, 0, 0.4);
  --auth-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);
  --auth-font: 'Clan Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  font-family: var(--auth-font);
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 124, 195, 0.16), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(185, 204, 1, 0.12), transparent 45%),
    var(--auth-bg);
  color: var(--auth-text);
}

.auth-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, var(--auth-card-bg) 0%, var(--auth-bg-alt) 100%);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  padding: 4.5rem 2rem 2rem;
  margin-top: 4rem;
  text-align: center;
}

.auth-card--wide {
  max-width: 440px;
}

/* Badge / logo circular, sobreposto ao topo do card */
.auth-badge {
  position: absolute;
  top: -4rem;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(6.5rem, 18vw, 8.5rem);
  height: clamp(6.5rem, 18vw, 8.5rem);
  border-radius: 50%;
  background: var(--auth-bg-alt);
  border: 3px solid var(--auth-card-bg);
  box-shadow: var(--auth-shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Badge de status (usado na tela de acesso negado) */
.auth-status-icon {
  width: clamp(6.5rem, 18vw, 8.5rem);
  height: clamp(6.5rem, 18vw, 8.5rem);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(231, 76, 60, 0.12);
  color: var(--auth-danger);
  border: 3px solid var(--auth-card-bg);
  box-shadow: var(--auth-shadow-soft);
  margin: 0 auto 1.5rem;
}

/* Ícones de fonte (Font Awesome, etc.) têm uma caixa de glifo com
   padding assimétrico embutido no próprio caractere — mesmo dentro
   de um flex container centralizado, isso faz o desenho "flutuar"
   fora do centro visual. Forçar line-height: 1 e um bloco quadrado
   do tamanho exato da fonte resolve isso de forma global. */
.auth-status-icon i,
.auth-badge i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  font-size: clamp(2.5rem, 6vw, 3.25rem);
}

/* --------------------------------------------------------------------------
   Tipografia
   -------------------------------------------------------------------------- */
.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
  color: var(--auth-text);
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--auth-text-muted);
  margin-bottom: 1.75rem;
}

.auth-brand {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--auth-text);
}

.auth-brand-desc {
  font-size: 0.8rem;
  color: var(--auth-text-muted);
}

.auth-version {
  font-size: 0.72rem;
  color: var(--auth-text-muted);
  letter-spacing: 0.03em;
  margin-top: 0.75rem;
}

/* --------------------------------------------------------------------------
   Formulário
   -------------------------------------------------------------------------- */
.auth-form {
  width: 100%;
  text-align: left;
}

.auth-input-group {
  margin-bottom: 1rem;
}

.auth-input-group .input-group-text {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--auth-border);
  border-right: none;
  color: var(--auth-blue-light);
  border-radius: var(--auth-radius-sm) 0 0 var(--auth-radius-sm);
  min-width: 3rem;
  justify-content: center;
}

.auth-input-group .form-control {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--auth-border);
  border-left: none;
  color: var(--auth-text);
  border-radius: 0 var(--auth-radius-sm) var(--auth-radius-sm) 0;
  padding: 0.65rem 0.9rem;
}

.auth-input-group .form-control::placeholder {
  color: var(--auth-text-muted);
}

.auth-input-group .form-control:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--auth-blue-light);
  box-shadow: 0 0 0 0.2rem rgba(47, 166, 232, 0.25);
  color: var(--auth-text);
}

.auth-input-group:focus-within .input-group-text {
  border-color: var(--auth-blue-light);
}

/* Botão principal */
.auth-btn {
  width: 100%;
  border: none;
  border-radius: var(--auth-radius-sm);
  padding: 0.7rem 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-blue) 0%, var(--auth-blue-light) 100%);
  box-shadow: 0 8px 20px -6px rgba(0, 124, 195, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-btn:hover,
.auth-btn:focus {
  color: #fff;
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -6px rgba(0, 124, 195, 0.65);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(47, 166, 232, 0.45);
}

/* Botão secundário / link de ação (ex.: acesso negado) */
.auth-btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--auth-blue-light);
  font-weight: 600;
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(47, 166, 232, 0.35);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.auth-btn-link:hover,
.auth-btn-link:focus {
  background: rgba(47, 166, 232, 0.12);
  border-color: var(--auth-blue-light);
  color: var(--auth-blue-light);
}

/* --------------------------------------------------------------------------
   Mensagens / flash messages
   -------------------------------------------------------------------------- */
.auth-msg {
  font-size: 0.85rem;
  color: var(--auth-text-muted);
}

.auth-msg.text-danger,
.auth-msg .text-danger {
  color: #ff8a80 !important;
}

.auth-divider {
  border-color: var(--auth-border);
  margin: 1.25rem 0;
}

/* --------------------------------------------------------------------------
   Responsividade
   -------------------------------------------------------------------------- */
@media (max-width: 420px) {
  .auth-card {
    padding: 4rem 1.25rem 1.75rem;
    margin-top: 3.5rem;
    border-radius: 0.85rem;
  }

  .auth-badge,
  .auth-status-icon {
    top: -3.5rem;
  }

  .auth-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 340px) {
  .auth-card {
    max-width: 100%;
  }
}