:root {
  --brand: #3d5b57;        /* teal da marca (tom mais claro) */
  --brand-2: #2b4441;      /* teal mais escuro (gradiente/hero) */
  --panel: #243d3a;        /* fundo da pagina / coluna do formulario */
  --accent: #83c7bb;       /* teal claro: destaques, particulas, foco */
  --btn: #3d5b57;
  --btn-hover: #4b6f6a;
  --btn-active: #324d4a;
  --input-bg: #2e4b47;
  --input-border: #496761;
  --text-muted: #c2cecb;
}

* { box-sizing: border-box; }
html, body {
  height: 100%; margin: 0; overflow: hidden;
  font-family: "Nunito", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--panel); color: #fff;
}

.login-page { background: var(--panel); color: #fff; }

.login-shell { display: flex; height: 100vh; }

/* ---- Esquerda / hero ---- */
.login-hero {
  position: relative; flex: 0 0 42%; max-width: 42%;
  background-image: linear-gradient(45deg, var(--brand) 10%, var(--brand-2) 100%);
  overflow: hidden;
}
#particles-web { position: absolute; inset: 0; z-index: 1; }
.hero-unit {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.hero-logo { width: 100%; max-width: 250px; height: auto; }
.hero-product { margin-top: 20px; font-size: 15px; letter-spacing: 6px; color: var(--accent); font-weight: 700; }

/* ---- Direita / formulario ---- */
.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-form { width: 340px; max-width: 100%; }
.login-form h3 { text-align: center; font-weight: 700; margin: 0 0 28px; font-size: 22px; color: #fff; }
.login-form h3 .accent { color: var(--accent); }

/* Logo exibido acima do titulo APENAS quando o hero da esquerda esta oculto
   (telas pequenas / celular) — ver media query no fim do arquivo. */
.form-brand { display: none; text-align: center; margin-bottom: 22px; }
.form-brand img { width: 100%; max-width: 190px; height: auto; }
.form-brand .hero-product { margin-top: 10px; font-size: 13px; letter-spacing: 5px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; margin-bottom: 7px; color: var(--text-muted); }
.form-control {
  width: 100%; height: 44px; padding: 8px 14px; border-radius: 6px;
  border: 1px solid var(--input-border); background: var(--input-bg); color: #fff; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: #7f8f8c; font-size: 14px; }
.form-control:focus { background: #fff; color: var(--brand); border-color: var(--accent); border-width: 2px; box-shadow: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 46px; margin-top: 14px; border: 1px solid transparent;
  border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.btn-primary { background: var(--btn) !important; border-color: var(--btn) !important; color: #fff !important; }
.btn-primary:hover { background: var(--btn-hover) !important; border-color: var(--btn-hover) !important; }
.btn-primary:active,
.btn-primary.active { background: var(--btn-active) !important; border-color: var(--btn-active) !important; }
.btn-primary:focus,
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 0.2rem rgba(111, 179, 168, 0.4); }
.btn[disabled] { opacity: .6; cursor: default; }

/* Alertas do servidor (Bootstrap) mantidos dentro da coluna do formulario. */
.login-form .alert { margin-top: 16px; text-align: left; }

/* Modal generico de mensagens (texto escuro sobre fundo claro do Bootstrap). */
.modal-header { color: #555555; }
.modal-body { color: #555555; }

/* Overlay de carregamento. */
#loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 22, 21, 0.8);
}
.spinner {
  width: 50px; height: 50px;
  border: 5px solid #33403e; border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .login-hero { display: none; }
  /* Sem o hero, o logo passa a aparecer acima do titulo do formulario. */
  .form-brand { display: block; }
  /* A pagina deixa de ser "tela cheia travada": em telas baixas o teclado do
     celular reduz a viewport e o formulario precisa poder rolar. */
  html, body { overflow: auto; }
  .login-shell { height: auto; min-height: 100vh; }
  .login-main { padding: 32px 24px; }
}
