/* =========================================================================
   PORTA CERTA — Tela de Login — login.css
   Identidade visual alinhada ao painel administrativo (navy + dourado).
   ========================================================================= */

/* =========================== TOKENS =========================== */
:root {
  --navy-950: #0a1628;
  --navy-900: #0e1f3d;
  --navy-850: #122549;
  --navy-800: #173064;
  --navy-700: #20407e;

  --gold-100: #fbf3dd;
  --gold-300: #e6c878;
  --gold-500: #c9a227;
  --gold-600: #ad8720;
  --gold-700: #8c6c18;

  --bg: #f6f7fa;
  --ink-900: #111726;
  --ink-700: #333a4d;
  --ink-600: #5b6072;
  --ink-400: #9297a8;
  --line: #e8eaf0;
  --line-soft: #f0f1f5;

  --danger: #d8433b;
  --danger-bg: #fbeae9;
  --success: #1e9d63;

  --font-display: "Fraunces", serif;
  --font-body: "Inter", sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --shadow-sm:
    0 1px 2px rgba(14, 31, 61, 0.05), 0 1px 3px rgba(14, 31, 61, 0.06);
  --shadow-md:
    0 6px 20px -4px rgba(14, 31, 61, 0.1), 0 2px 6px rgba(14, 31, 61, 0.06);
  --shadow-lg: 0 20px 45px -12px rgba(10, 22, 40, 0.22);
  --shadow-gold: 0 10px 24px -8px rgba(201, 162, 39, 0.45);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================== RESET =========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}
a {
  text-decoration: none;
  color: inherit;
}
button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
}
input {
  font-family: inherit;
}

/* =========================== LAYOUT GERAL =========================== */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

/* =========================== PAINEL DE MARCA =========================== */
.brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 64px;
  background: linear-gradient(
    160deg,
    var(--navy-950) 0%,
    var(--navy-900) 55%,
    var(--navy-850) 100%
  );
  color: #fff;
}
.brand-panel-glow {
  position: absolute;
  top: -180px;
  right: -160px;
  width: 480px;
  height: 480px;
  background: radial-gradient(
    circle,
    rgba(201, 162, 39, 0.28) 0%,
    rgba(201, 162, 39, 0) 70%
  );
  pointer-events: none;
}
.brand-panel-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 40px;
  animation: fadeUp 0.6s var(--ease);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-300);
  flex-shrink: 0;
}
.brand-logo-icon {
  width: 34px;
  height: 34px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}
.brand-text strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.brand-text span {
  font-size: 11px;
  color: var(--gold-300);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-message {
  max-width: 420px;
}
.brand-message h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 18px;
}
.brand-message p {
  font-size: 14.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
}

.brand-footer {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
}

/* =========================== PAINEL DE LOGIN =========================== */
.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  animation: fadeUp 0.5s var(--ease);
}

.login-card-logo {
  display: none;
  justify-content: center;
  margin-bottom: 22px;
}
.brand-mark-sm {
  width: 52px;
  height: 52px;
}
.brand-mark-sm .brand-logo-icon {
  width: 52px;
  height: 52px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  color: var(--navy-950);
  text-align: center;
  margin-bottom: 8px;
}
.login-subtitle {
  font-size: 13.5px;
  color: var(--ink-600);
  text-align: center;
  margin-bottom: 32px;
}

/* =========================== CAMPOS =========================== */
.campo {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}
.campo label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
}
.campo-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fcfcfd;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.campo-input i:first-child {
  font-size: 14px;
  color: var(--ink-400);
  flex-shrink: 0;
}
.campo-input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  padding: 12px 0;
  font-size: 13.5px;
  color: var(--ink-900);
}
.campo-input input::placeholder {
  color: var(--ink-400);
}
.campo-input:focus-within {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.14);
}
.campo-input.campo-invalido {
  border-color: var(--danger);
}
.campo-input.campo-invalido:focus-within {
  box-shadow: 0 0 0 3px rgba(216, 67, 59, 0.14);
}

.btn-alternar-senha {
  flex-shrink: 0;
  color: var(--ink-400);
  font-size: 14px;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s var(--ease);
}
.btn-alternar-senha:hover {
  color: var(--ink-700);
}

.campo-erro {
  min-height: 15px;
  font-size: 12px;
  color: var(--danger);
  display: block;
}

/* =========================== LINHA CHECKBOX / LINK =========================== */
.campo-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-700);
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.checkbox-mark {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1.5px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.checkbox-mark::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 9px;
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity 0.15s var(--ease),
    transform 0.15s var(--ease);
}
.checkbox input:checked + .checkbox-mark {
  background: var(--navy-900);
  border-color: var(--navy-900);
}
.checkbox input:checked + .checkbox-mark::after {
  opacity: 1;
  transform: scale(1);
}
.checkbox input:focus-visible + .checkbox-mark {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

.link-esqueci {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy-800);
  transition: color 0.2s var(--ease);
}
.link-esqueci:hover {
  color: var(--gold-600);
}

/* =========================== BOTÃO ENTRAR =========================== */
.btn-entrar {
  position: relative;
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  background: var(--navy-900);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    transform 0.15s var(--ease);
}
.btn-entrar:hover {
  background: var(--navy-800);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-entrar:active {
  transform: scale(0.98);
}
.btn-entrar:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

.btn-entrar-loading {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
}
.btn-entrar.carregando .btn-entrar-texto {
  visibility: hidden;
}
.btn-entrar.carregando .btn-entrar-loading {
  display: block;
}

/* =========================== ALERTA GERAL =========================== */
.alerta-formulario {
  margin-top: 18px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  border-radius: 10px;
  font-size: 12.5px;
  text-align: center;
  color: var(--danger);
  background: var(--danger-bg);
  transition:
    max-height 0.25s var(--ease),
    padding 0.25s var(--ease);
}
.alerta-formulario.visivel {
  padding: 11px 14px;
  max-height: 220px;
}
.alerta-formulario.visivel-sucesso {
  color: var(--success);
  background: #e7f7ef;
}

/* =========================== RODAPÉ =========================== */
.login-rodape {
  margin-top: 26px;
  font-size: 12px;
  color: var(--ink-400);
  text-align: center;
}

/* =========================== ANIMAÇÕES =========================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }
  40%,
  60% {
    transform: translateX(4px);
  }
}
.campo-input.campo-invalido {
  animation: shake 0.4s var(--ease);
}

/* =========================== RESPONSIVO =========================== */
@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .brand-panel {
    display: none;
  }
  .login-card-logo {
    display: flex;
  }
  .login-panel {
    padding: 32px 20px;
    min-height: 100vh;
  }
}
@media (max-width: 420px) {
  .login-card {
    padding: 32px 22px;
  }
  .campo-linha {
    flex-wrap: wrap;
    gap: 12px;
  }
}
