/*
==============================================
CSS Custom Properties - Paleta de Cores da Logo
==============================================
*/
:root {
  --cor-primaria-escura: #3b4a8d;
  --cor-primaria-clara: #a1a8d4;
  --cor-fundo: #f7f8fc;
  --cor-texto: #1e2a3b;
  --cor-branca: #ffffff;
  --header-altura: 80px;
}

/*
==============================================
Estilos Globais e de Acessibilidade
==============================================
*/
body {
  font-family: "Inter", sans-serif;
  background-color: var(--cor-fundo);
  color: var(--cor-texto);
  animation: fadeInPage 1s ease-in-out;
}

/* Anula a regra 'flex: 1' do estilo global para o <main> nestas páginas */

/* Foco visível para navegação por teclado (WCAG 2.1) */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--cor-primaria-escura);
  outline-offset: 3px;
  border-radius: 4px;
}

/*
==============================================
Estilos do Header e Navbar
==============================================
*/
.navbar {
  height: var(--header-altura);
  transition: all 0.4s ease-out;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  height: 70px;
}

.navbar-brand img {
  max-height: 40px;
  transition: max-height 0.4s ease-out;
}

.navbar.scrolled .navbar-brand img {
  max-height: 40px;
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
}
/*
==============================================
Estilos dos Links de Navegação
==============================================
*/
.nav-link {
  color: var(--cor-texto);
  font-weight: 500;
  position: relative;
  padding: 8px 0;
  margin: 0 15px;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--cor-primaria-escura);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.nav-link:hover::after,
.nav-link:focus::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link.active {
  color: var(--cor-primaria-escura);
  font-weight: 600;
}

/*
==============================================
Estilos do Menu Mobile (Toggler)
==============================================
*/
.navbar-toggler {
  border: none;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-toggler-icon {
  background-image: none;
  position: relative;
  width: 24px;
  height: 24px;
}

.navbar-toggler-icon .bar {
  display: block;
  width: 24px;
  height: 3px;
  background-color: var(--cor-texto);
  border-radius: 2px;
  position: absolute;
  transition: transform 0.3s ease-in-out, top 0.3s ease-in-out,
    opacity 0.3s ease-in-out;
}

.navbar-toggler-icon .bar1 {
  top: 4px;
}
.navbar-toggler-icon .bar2 {
  top: 11px;
}
.navbar-toggler-icon .bar3 {
  top: 18px;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon .bar1 {
  transform: rotate(45deg);
  top: 11px;
}
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon .bar2 {
  opacity: 0;
}
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon .bar3 {
  transform: rotate(-45deg);
  top: 11px;
}

/* Ajuste do menu dropdown no mobile */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: var(--cor-branca);
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }
  .nav-link {
    margin: 10px 0;
  }
}

/*
==============================================
Conteúdo principal para demonstração
==============================================
*/
main {
  padding-top: var(--header-altura);
  min-height: calc(100vh - var(--header-altura));
}

/* Exceção: páginas de autenticação */
.body-auth main {
  padding-top: 0;
  min-height: auto;
  flex: none;
}
.hero-section {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - var(--header-altura));
  text-align: center;
}

.hero-section h1 {
  font-size: clamp(2.5rem, 5vw, 4rem); /* Fonte responsiva */
  font-weight: 700;
  color: var(--cor-primaria-escura);
}

.hero-section p {
  color: var(--cor-texto);
  font-size: 1.25rem;
  max-width: 600px;
  margin: 1rem auto 0;
}

/*
==============================================
Animações
==============================================
*/
@keyframes fadeInPage {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*
==============================================
NOVO: Estilos do Dropdown de Login
==============================================
*/
.login-dropdown-menu {
  min-width: 280px; /* Define uma largura mínima para o formulário */
  border-radius: 0.5rem;
  border: 1px solid #ddd;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.login-dropdown-menu .form-label {
  font-weight: 500;
}

.login-dropdown-menu .btn-primary {
  background-color: var(--cor-primaria-escura);
  border-color: var(--cor-primaria-escura);
}

.login-dropdown-menu .btn-primary:hover {
  background-color: #2c386e; /* Um tom mais escuro da cor primária */
  border-color: #2c386e;
}

/*
==============================================
NOVO: Estilos do Footer
==============================================
*/
footer {
  background-color: var(--cor-primaria-escura);
  color: rgba(255, 255, 255, 0.9);
}

footer h5 {
  color: var(--cor-branca);
  font-weight: 600;
}

footer p {
  color: var(--cor-primaria-clara);
}

footer .list-unstyled a,
footer .list-unstyled li {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.3s ease;
}

footer .list-unstyled a:hover {
  color: var(--cor-branca);
  padding-left: 5px;
}

footer .social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--cor-branca);
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

footer .social-icon:hover {
  background-color: var(--cor-primaria-clara);
  color: var(--cor-primaria-escura);
  transform: translateY(-3px);
}

.map-responsive iframe {
  border-radius: 8px;
  filter: grayscale(80%) invert(90%) contrast(90%); /* Efeito moderno no mapa */
  transition: filter 0.3s ease;
}

.map-responsive iframe:hover {
  filter: grayscale(0%) invert(0%) contrast(100%);
}

.footer-bottom {
  background-color: rgba(0, 0, 0, 0.2);
}

.footer-bottom a {
  text-decoration: none;
  font-weight: 500;
}
/*
==============================================
NOVO: Estilos do Carrossel e Seções abaixo
==============================================
*/
#heroCarousel {
  height: calc(
    100vh - var(--header-altura)
  ); /* Ocupa a altura da tela menos o header */
  margin-top: var(
    --header-altura
  ); /* Empurra o carrossel para baixo do header */
}

#heroCarousel .carousel-inner {
  height: 100%;
}

#heroCarousel .carousel-item {
  height: 100%;
  position: relative;
}

#heroCarousel .carousel-item img {
  height: 100%;
  object-fit: cover; /* Garante que a imagem cubra todo o slide sem distorcer */
  filter: brightness(
    0.5
  ); /* Escurece a imagem para o texto ficar mais legível */
}

#heroCarousel .carousel-caption {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex; /* Garante que o conteúdo ocupe toda a altura */
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--cor-branca);
  background-color: rgba(
    0,
    0,
    0,
    0.3
  ); /* Overlay escuro para melhorar legibilidade */
  z-index: 1; /* Garante que a legenda esteja acima do overlay */
}

#heroCarousel .carousel-caption h2 {
  font-size: clamp(2.5rem, 5vw, 4rem); /* Fonte responsiva */
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

#heroCarousel .carousel-caption p {
  font-size: clamp(1rem, 2vw, 1.5rem);
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

#heroCarousel .carousel-control-prev-icon,
#heroCarousel .carousel-control-next-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgba(
    var(--bs-primary-rgb),
    0.6
  ); /* Cor base do Bootstrap, ajustada */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

#heroCarousel .carousel-control-prev-icon:hover,
#heroCarousel .carousel-control-next-icon:hover {
  background-color: var(--cor-primaria-escura);
}

#heroCarousel .carousel-indicators button {
  background-color: var(--cor-branca);
  opacity: 0.5;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

#heroCarousel .carousel-indicators button.active {
  background-color: var(--cor-primaria-escura);
  opacity: 1;
}

/* Estilos para o botão dentro do carrossel */
#heroCarousel .btn-primary {
  background-color: var(--cor-primaria-escura);
  border-color: var(--cor-primaria-escura);
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

#heroCarousel .btn-primary:hover {
  background-color: var(--cor-primaria-clara);
  border-color: var(--cor-primaria-clara);
  color: var(--cor-primaria-escura);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Seções de Conteúdo Abaixo do Carrossel */
.card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card .bi {
  color: var(--cor-primaria-escura); /* Ícones na cor principal */
}

.card h3 {
  color: var(--cor-primaria-escura);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--cor-texto);
  font-size: 0.95rem;
}

/* Media Query para responsividade do carrossel em telas pequenas */
@media (max-width: 767.98px) {
  #heroCarousel .carousel-caption h2 {
    font-size: 2rem;
  }
  #heroCarousel .carousel-caption p {
    font-size: 1rem;
  }
  #heroCarousel .btn-primary {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
}
/*
==============================================
NOVO: Estilo para Título Centralizado (CORRIGIDO)
==============================================
*/
.navbar-title {
  /* Faz o container do título crescer e ocupar o espaço vazio */
  flex-grow: 1;
  /* Centraliza o texto dentro do container expandido */
  text-align: start;
  color: var(--cor-primaria-escura);
}

/*
=========================================================
NOVO: Estilos da Página de Almoxarifado
=========================================================
*/
.main-page {
  padding-top: calc(
    var(--header-altura) + 2rem
  ); /* Espaçamento abaixo do header fixo */
  padding-left: 2rem;
  padding-right: 2rem;
  background-color: #f8f9fa; /* Um fundo levemente diferente para a área de conteúdo */
  min-height: 100vh;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-weight: 700;
  color: var(--cor-primaria-escura);
}

.page-actions .btn {
  font-weight: 500;
}

/* Estilo das Abas */
.nav-tabs .nav-link {
  color: var(--cor-texto);
  font-weight: 600;
}

.nav-tabs .nav-link.active {
  color: var(--cor-primaria-escura);
  background-color: var(--cor-branca);
  border-color: #dee2e6 #dee2e6 var(--cor-branca);
}

.tab-content.card {
  border-top-left-radius: 0;
  border: 1px solid #dee2e6;
}

/* Estilo da Tabela */
.table th {
  font-weight: 600;
  color: var(--cor-texto);
}

.table .btn-sm {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table .badge {
  font-size: 0.8rem;
  padding: 0.5em 0.75em;
}

/*
=========================================================
NOVO: Estilos da Página de Pacientes
=========================================================
*/

/* Badges de Prioridade para a Fila de Atendimento */
.badge-prioridade {
  display: inline-flex;
  align-items: center;
  padding: 0.5em 0.9em;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 50rem; /* pill shape */
}

.badge-prioridade .bi {
  margin-right: 0.5em;
  font-size: 1em;
}

.badge-prioridade.alta {
  color: #842029;
  background-color: #f8d7da;
}

.badge-prioridade.media {
  color: #664d03;
  background-color: #fff3cd;
}

.badge-prioridade.baixa {
  color: #055160;
  background-color: #cff4fc;
}

/*
=========================================================
NOVO: Estilos das Páginas de Login e Cadastro
=========================================================
*/
/* === Layout para telas de autenticação (login/cadastro) === */
/* Centralização e layout das páginas de autenticação */
.body-auth {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--cor-fundo, #f8f9fa);
  margin: 0;
  padding: 0;
}

/* O main dentro das páginas de login/cadastro */
.body-auth main {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  padding: 1rem;
}

/* Card principal do login/cadastro */
.body-auth .auth-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 1100px; /* 💪 largo como o original */
  overflow: hidden;
}

/* Coluna da logo */
.body-auth .auth-card-branding {
  background-color: #f2f2f2;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
  text-align: center;
  padding: 2rem;
}

/* Coluna do formulário */
.body-auth .card-body {
  background: #fff;
  border-top-right-radius: 20px;
  border-bottom-right-radius: 20px;
}

@media (max-width: 992px) {
  .body-auth .auth-card {
    max-width: 95%;
    border-radius: 15px;
  }

  .body-auth .auth-card-branding {
    border-radius: 15px 15px 0 0;
  }

  .body-auth .card-body {
    border-radius: 0 0 15px 15px;
  }
}

.auth-logo {
  max-width: 100px;
  opacity: 0.9;
}

.auth-card .form-control {
  padding: 1rem;
  border-radius: 0.5rem;
}

.auth-card .form-floating label {
  padding: 1rem;
}

.auth-card .btn-primary {
  padding: 0.8rem;
  font-weight: 600;
  background-color: var(--cor-primaria-escura);
  border-color: var(--cor-primaria-escura);
}

.auth-card .btn-primary:hover {
  background-color: #2c386e;
  border-color: #2c386e;
}

.auth-card a {
  color: var(--cor-primaria-escura);
}
