/**
 * Login BSA DIGITAL — alinhado ao tema do painel (app.css)
 */

:root {
  --auth-bg: #070708;
  --auth-card: rgba(16, 16, 20, 0.96);
  --auth-input: #121218;
  --auth-border: rgba(255, 255, 255, 0.08);
  --auth-accent: #8b5cf6;
  --auth-accent-glow: rgba(139, 92, 246, 0.35);
  --auth-muted: #a1a1aa;
  --auth-font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --bsa-radius-lg: 22px;
  /* Card de login: largura confortável, nunca colada nas bordas (rem = escala com fonte do usuário) */
  --auth-shell-max: min(28rem, calc(100vw - 2rem));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/*
 * NÃO use display:flex em html + body ao mesmo tempo: o body vira item-flex do html
 * e encolhe à largura do conteúdo — o login fica “fino” para sempre.
 */
html.auth-page {
  width: 100%;
  min-height: 100%;
  margin: 0;
  -webkit-text-size-adjust: 100%;
}

body.auth-page {
  font-family: var(--auth-font);
  background-color: var(--auth-bg);
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -25%, rgba(91, 33, 182, 0.25), transparent),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(15, 23, 42, 0.5), transparent);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: clamp(16px, 4vw, 24px);
  color: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Largura do bloco de login (index.php: main.auth-shell) */
.auth-shell {
  width: 100%;
  max-width: var(--auth-shell-max);
  flex: 0 1 auto;
  margin-inline: auto;
  min-width: 0;
  box-sizing: border-box;
}

.auth-login-card {
  width: 100%;
  max-width: none;
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: clamp(18px, 2.2vw, var(--bsa-radius-lg));
  padding: clamp(1.5rem, 4vw, 2.15rem) clamp(1.2rem, 3.2vw, 1.65rem);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.06) inset;
  animation: auth-slide-up 0.55s ease-out;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes auth-slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-logo-wrap {
  text-align: center;
  margin-bottom: clamp(1rem, 2.5vw, 1.35rem);
}

.auth-logo-wrap img {
  height: clamp(40px, 7vw, 48px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(139, 92, 246, 0.28));
}

.auth-login-head {
  text-align: center;
  margin-bottom: clamp(1.25rem, 3vw, 1.6rem);
}

.auth-login-head h1 {
  font-size: clamp(1.1rem, 2.6vw, 1.3rem);
  font-weight: 800;
  margin: 0 0 0.4rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.auth-login-head p {
  color: var(--auth-muted);
  font-size: clamp(0.85rem, 2vw, 0.92rem);
  margin: 0;
  line-height: 1.45;
}

.auth-form-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #71717a;
  margin-bottom: 8px;
  display: block;
}

/* Vence estilos do Bootstrap no formulário do login */
.auth-login-card .auth-form-control,
.auth-login-card input.auth-form-control {
  display: block;
  width: 100%;
  background: var(--auth-input) !important;
  border: 1px solid var(--auth-border) !important;
  border-radius: 12px !important;
  color: #fff !important;
  padding: 14px 16px !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.auth-login-card .auth-form-control::placeholder {
  color: #52525b;
}

.auth-login-card .auth-form-control:focus {
  outline: none !important;
  border-color: rgba(139, 92, 246, 0.55) !important;
  background: #16161d !important;
  box-shadow: 0 0 0 3px var(--auth-accent-glow) !important;
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .auth-form-control {
  padding-right: 48px !important;
}

.auth-toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #52525b;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.auth-toggle-pw:hover {
  color: var(--auth-muted);
  background: rgba(255, 255, 255, 0.05);
}

.auth-btn-submit {
  background: linear-gradient(135deg, var(--auth-accent), #6366f1);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: clamp(0.85rem, 2.2vw, 0.95rem) 1rem;
  width: 100%;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.2vw, 1rem);
  margin-top: clamp(1.1rem, 2.5vw, 1.35rem);
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}

.auth-btn-submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.35);
}

.auth-btn-submit:active {
  transform: translateY(0);
}

.auth-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 1.25rem;
  text-align: center;
}

.auth-alert--success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.auth-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 1.25rem;
  font-size: 13px;
  flex-wrap: wrap;
}

.auth-footer-row a {
  color: var(--auth-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.auth-footer-row a:hover {
  color: var(--auth-accent);
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-muted);
  cursor: pointer;
}

.auth-check input {
  accent-color: var(--auth-accent);
}

.auth-login-card .mb-4 {
  margin-bottom: 1.15rem !important;
}

.auth-login-card .mb-3 {
  margin-bottom: 0 !important;
}

@media (max-width: 380px) {
  :root {
    --auth-shell-max: calc(100vw - 1.25rem);
  }

  .auth-footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
