/* =========================================
   1. CONFIGURAÇÕES GERAIS (O COMEÇO)
   ========================================= */
:root {
  --primary: #004aad;
  --primary-dark: #00347a;
  --accent: #38bdf8;
  --bg-gradient: linear-gradient(135deg, #f0f4ff 0%, #d9e6ff 100%);
  --white: #ffffff;
  --slate-50: #f8fafc;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-700: #334155;
  --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  display: flex;
  flex-direction: column;
}

/* =========================================
   2. ESTRUTURA (TOPBAR E FOOTER)
   ========================================= */
.topbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 1rem;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 74, 173, 0.1);
  position: fixed;
  width: 100%;
  z-index: 100;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

footer {
  padding: 1.5rem;
  text-align: center;
  color: var(--slate-400);
  font-size: 0.85rem;
  background: transparent;
  margin-top: auto;
}

footer b {
  color: var(--primary);
}

/* =========================================
   3. CARD PRINCIPAL (MODERNO)
   ========================================= */
main {
  margin: auto;
  width: 95%;
  max-width: 900px;
  background: var(--white);
  display: flex;
  border-radius: 24px;
  box-shadow: var(--shadow-premium);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Lado Visual (Azul) */
.side {
  flex: 1;
  background: var(--primary);
  background-image: radial-gradient(circle at 20% 30%, var(--accent) 0%, transparent 70%),
                    linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: white;
  text-align: center;
}

.side img {
  width: 100%;
  max-width: 180px;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.25));
  margin-bottom: 1.5rem;
}

/* Lado do Formulário (Branco) */
.form-container {
  flex: 1.2;
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Centraliza o login verticalmente */
}

h1 {
  color: var(--slate-700);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-align: center;
}

form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* =========================================
   4. INPUTS E BOTÃO
   ========================================= */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate-400);
  margin-left: 4px;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
}

.input-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  font-size: 1.1rem;
  transition: 0.3s;
}

input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border-radius: 14px;
  border: 2px solid var(--slate-200);
  font-size: 1rem;
  font-weight: 500;
  color: var(--slate-700);
  background: var(--slate-50);
  transition: all 0.3s ease;
}

input:focus {
  background: var(--white);
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 74, 173, 0.08);
}

/* Muda cor do ícone ao focar no input */
input:focus + i {
  color: var(--primary);
}

.btn {
  margin-top: 1rem;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 20px rgba(0, 74, 173, 0.2);
  transform: translateY(-2px);
}

#msgAdmin {
  margin-top: 1rem;
  text-align: center;
  font-weight: 600;
  min-height: 20px;
}

/* =========================================
   5. RESPONSIVIDADE
   ========================================= */
@media(max-width: 850px) {
  main {
    flex-direction: column;
    width: 90%;
    margin: 100px auto 40px;
  }
  .side {
    padding: 2.5rem;
  }
  .form-container {
    padding: 2.5rem 2rem;
  }
}

/* Ajuste no Body para dar espaço ao topo */
body {
  min-height: 100vh;
  background: var(--bg-gradient);
  display: flex;
  flex-direction: column;
  padding-top: 80px; /* Cria o espaço para a topbar não atropelar o card */
}

/* Ajuste no Main */
main {
  margin: auto; /* Mantém centralizado no espaço que sobrou */
  width: 95%;
  max-width: 900px;
  background: var(--white);
  display: flex;
  border-radius: 24px;
  box-shadow: var(--shadow-premium);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  
  /* Removemos margens fixas exageradas para não empurrar demais para baixo */
  position: relative; 
  z-index: 10;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. Definições de cores */
:root {
    --primary: #004aad;
    --primary-dark: #00347a;
    --accent: #38bdf8;
    --bg-gradient: linear-gradient(135deg, #f0f4ff 0%, #d9e6ff 100%);
    --white: #ffffff;
    --slate-50: #f8fafc;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-700: #334155;
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 2. Reset Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* 3. Ajuste do Body (AQUI ESTÁ O SEGREDO) */
body {
    min-height: 100vh;
    background: var(--bg-gradient);
    display: flex;
    flex-direction: column;
    /* O padding-top deve ser maior que a altura da topbar */
    padding-top: 100px; 
    align-items: center; /* Garante que o conteúdo fique no meio horizontal */
    justify-content: flex-start; /* Alinha o conteúdo logo abaixo do padding */
}

/* 4. Topbar Fixa */
.topbar {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px; /* Definimos uma altura fixa para a barra */
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 5. Ajuste do Main (O Quadrado) */
main {
    margin: 20px auto; /* Margem pequena em cima para desgrudar do topo */
    width: 95%;
    max-width: 900px;
    background: var(--white);
    display: flex;
    border-radius: 24px;
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    animation: slideUp 0.6s ease;
}