/* ═══════════════════════════════════════════════════════════════════════
   TELA DE LOGIN — Empresa Capixaba
   Mesma linguagem visual do menu lateral e do header: superfícies limpas,
   tipografia contida e o vermelho da marca como único acento.

   A arte de capa fica em admin/images/auth/login-cover.jpg. Se o arquivo
   ainda não existir, o degradê com a faixa diagonal desta folha entra no
   lugar — a tela nunca aparece quebrada.
   ═══════════════════════════════════════════════════════════════════════ */

.ec-auth {
  --ec-red:        #e11d22;
  --ec-red-dark:   #b8151a;
  --ec-ink:        #0f172a;
  --ec-text:       #475569;
  --ec-muted:      #7c8aa0;
  --ec-border:     #e2e8f0;
  --ec-field-bg:   #f8fafc;
  --ec-radius:     11px;
}

.ec-auth {
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ec-ink);
  -webkit-font-smoothing: antialiased;
}

/* ── Coluna do formulário ───────────────────────────────────────────── */
.ec-auth__form-pane {
  display: flex;
  flex: 1 1 50%;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 24px;
  min-width: 0;
}

.ec-auth__card {
  width: 100%;
  max-width: 384px;
}

.ec-auth__logo {
  display: block;
  height: 52px;
  width: auto;
  margin-bottom: 34px;
}

.ec-auth__title {
  margin: 0 0 6px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ec-ink);
}

.ec-auth__subtitle {
  margin: 0 0 28px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ec-muted);
}

/* ── Campos ─────────────────────────────────────────────────────────── */
.ec-auth__field {
  margin-bottom: 18px;
}

.ec-auth__label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ec-text);
}

.ec-auth__control {
  position: relative;
  display: flex;
  align-items: center;
}

.ec-auth__control > .mdi {
  position: absolute;
  left: 14px;
  font-size: 19px;
  line-height: 1;
  color: #9aa5b8;
  pointer-events: none;
  transition: color .15s ease;
}

.ec-auth__input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  border: 1.5px solid var(--ec-border);
  border-radius: var(--ec-radius);
  background: var(--ec-field-bg);
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ec-ink);
  outline: none;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.ec-auth__input::placeholder {
  color: #a3aec0;
}

.ec-auth__input:focus {
  border-color: var(--ec-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(225, 29, 34, .12);
}

.ec-auth__control:focus-within > .mdi {
  color: var(--ec-red);
}

/* Botão de exibir/ocultar a senha */
.ec-auth__toggle {
  position: absolute;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #9aa5b8;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.ec-auth__toggle:hover {
  background: #eef2f7;
  color: var(--ec-ink);
}

.ec-auth__toggle:focus-visible {
  outline: 2px solid var(--ec-red);
  outline-offset: -2px;
}

.ec-auth__input--password {
  padding-right: 48px;
}

/* ── Botão principal ────────────────────────────────────────────────── */
.ec-auth__submit {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  border: none;
  border-radius: var(--ec-radius);
  background: var(--ec-red);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background-color .15s ease;
}

.ec-auth__submit:hover {
  background: var(--ec-red-dark);
}

.ec-auth__submit:focus-visible {
  outline: 2px solid var(--ec-red);
  outline-offset: 2px;
}

/* ── Alertas de erro ────────────────────────────────────────────────── */
.ec-auth__alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  font-size: 13.5px;
  line-height: 1.45;
  color: #b91c1c;
}

.ec-auth__alert .mdi {
  flex-shrink: 0;
  font-size: 17px;
  line-height: 1.3;
}

/* ── Rodapé ─────────────────────────────────────────────────────────── */
.ec-auth__footer {
  margin-top: 30px;
  font-size: 12.5px;
  color: var(--ec-muted);
}

/* ── Coluna da capa ─────────────────────────────────────────────────── */
.ec-auth__cover {
  position: relative;
  flex: 1 1 50%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 28px;
  overflow: hidden;
  /* Reserva: aparece se a arte não estiver no servidor. Reproduz o traço
     da marca — logo ao centro e faixas diagonais. */
  background:
    url("../images/logo.png") center center / 172px auto no-repeat,
    linear-gradient(118deg, transparent 60%, rgba(225, 29, 34, .90) 60%, rgba(225, 29, 34, .90) 64.2%, transparent 64.2%),
    linear-gradient(118deg, transparent 67%, rgba(225, 29, 34, .28) 67%, rgba(225, 29, 34, .28) 69.4%, transparent 69.4%),
    linear-gradient(160deg, #ffffff 0%, #f3f6fa 58%, #e4e9f0 100%);
}

.ec-auth__copyright {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
}

/* ── Responsivo ─────────────────────────────────────────────────────── */

/* Abaixo de 992px a capa sai de cena: numa tela estreita ela roubaria o
   espaço do formulário, que é o que importa aqui. */
@media (max-width: 991.98px) {
  .ec-auth__cover {
    display: none;
  }

  .ec-auth__form-pane {
    flex: 1 1 100%;
    padding: 32px 20px;
  }
}

@media (min-width: 992px) {
  /* O rodapé do formulário só aparece quando não há capa para exibi-lo */
  .ec-auth__footer {
    display: none;
  }

  /* A foto entra como camada de fundo apenas onde a capa é exibida.
     Declarar aqui (e não numa <img> no HTML) evita que o celular baixe
     uma imagem que nunca vai ver. Se o arquivo faltar, o navegador
     simplesmente mostra as camadas de baixo — logo e faixas da marca. */
  .ec-auth__cover {
    background:
      url("../images/auth/login-cover.jpg") center center / cover no-repeat,
      url("../images/logo.png") center center / 172px auto no-repeat,
      linear-gradient(118deg, transparent 60%, rgba(225, 29, 34, .90) 60%, rgba(225, 29, 34, .90) 64.2%, transparent 64.2%),
      linear-gradient(118deg, transparent 67%, rgba(225, 29, 34, .28) 67%, rgba(225, 29, 34, .28) 69.4%, transparent 69.4%),
      linear-gradient(160deg, #ffffff 0%, #f3f6fa 58%, #e4e9f0 100%);
  }
}

@media (max-width: 400px) {
  .ec-auth__card {
    max-width: 100%;
  }
  .ec-auth__logo {
    height: 44px;
    margin-bottom: 26px;
  }
  .ec-auth__title {
    font-size: 22px;
  }
  .ec-auth__input,
  .ec-auth__submit {
    height: 46px;
  }
}

/* Telas baixas (celular deitado): reduz respiros verticais */
@media (max-height: 560px) and (min-width: 992px) {
  .ec-auth__logo {
    height: 42px;
    margin-bottom: 22px;
  }
  .ec-auth__subtitle {
    margin-bottom: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ec-auth__input,
  .ec-auth__submit,
  .ec-auth__toggle,
  .ec-auth__control > .mdi {
    transition: none;
  }
}
