/* Importação da fonte moderna */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================
   VARIÁVEIS DE TEMA UNIFICADAS
   ========================================== */
:root {
  --primary-color: #0284c7;        /* Azul corporativo/saúde */
  --primary-hover: #0369a1;
  --bg-body: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --focus-ring: rgba(2, 132, 199, 0.25);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --header-height: 70px;
}

/* Reset Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Oculta divisores HTML antigos */
hr {
  display: none;
}

/* ==========================================
   HEADER & NAVEGAÇÃO
   ========================================== */
header {
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-block;
}

nav a:hover {
  color: var(--primary-color);
  background-color: #f1f5f9;
}

/* Menu Dropdown */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--bg-card);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 0;
  margin-top: 4px;
}

.dropdown-content a {
  display: block;
  padding: 10px 16px;
  color: var(--text-main);
  border-radius: 0;
}

.dropdown-content a:hover {
  background-color: #f1f5f9;
  color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
  display: block;
  animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   CONTAINER DE CONTEÚDO PRINCIPAL (#conteudo-principal)
   ========================================== */
#conteudo-principal {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  width: 100%;
}

/* Animação de entrada para módulos carregados via Fetch */
#conteudo-principal > * {
  animation: contentSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes contentSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Imagem da tela inicial */
#conteudo-principal > img {
  max-width: 500px;
  height: auto;
  opacity: 0.85;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
}

/* ==========================================
   ESTILOS DE MÓDULOS DE LOGIN & FORMULÁRIOS
   ========================================== */
#principal {
  margin-bottom: 24px;
  text-align: center;
}

#principal img {
  max-width: 500px;
  height: auto;
  object-fit: contain;
}

/* Card Container */
#login {
  background: var(--bg-card);
  width: 100%;
  max-width: 400px;
  padding: 36px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

#login form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#login h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 8px;
}

/* Inputs */
#login input[type="tel"],
#login input[type="text"],
#login input[type="password"] {
  width: 100% !important;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease-in-out;
}

#login input::placeholder {
  color: #94a3b8;
}

#login input:focus {
  background-color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

/* Botões */
#login button[type="submit"] {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background-color: var(--primary-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease;
  margin-top: 6px;
}

#login button[type="submit"]:hover {
  background-color: var(--primary-hover);
}

#login button[type="submit"]:active {
  transform: scale(0.98);
}

/* Links do Formulário */
#login a {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  text-align: center;
  transition: color 0.2s ease;
  line-height: 1.4;
}

#login a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* ==========================================
   RESPONSIVIDADE
   ========================================== */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 12px;
  }
  
  nav ul {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  #login {
    padding: 28px 20px;
  }
}