/* ========================================
   MOBILE RESPONSIVE - AGENDA MAX
   Solução que funciona 100% sem quebrar
   ======================================== */

/* ========================================
   REGRAS GLOBAIS - GARANTIR VISIBILIDADE
   ======================================== */
.cabesalho .logo,
.cabesalho .logo img,
.cabesalho .botoes {
  display: flex !important;
}

.cabesalho .logo img {
  display: block !important;
}

/* Removido - hamburger menu não deve ser forçado a aparecer globalmente */

/* ========================================
   DESKTOP - Manter estilo original
   ======================================== */
@media (min-width: 769px) {
  /* Esconder elementos mobile em desktop */
  .hamburger-menu,
  .nav-overlay {
    display: none !important;
  }
  
  /* Garantir que logo e botões sejam visíveis em desktop */
  .cabesalho .logo,
  .cabesalho .botoes {
    display: flex !important;
  }
  
  /* Manter menu original em desktop */
  .nav-menu,
  .cabesalho .menu {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 20px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    z-index: auto !important;
  }
  
  .nav-menu a,
  .cabesalho .menu a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    text-decoration: none !important;
    color: #333 !important;
    background: transparent !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
  }
  
  .nav-menu a:hover,
  .cabesalho .menu a:hover {
    background: rgba(0, 123, 255, 0.1) !important;
    transform: none !important;
    box-shadow: none !important;
  }
  
  /* Desktop - Aplicar mesmo cabeçalho da tela bem-vindo nas telas de login e cadastro */
  .page-auth .cabesalho {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 60px !important;
    background: linear-gradient(
      to right,
      rgba(15,21,34,0.2) 0%,
      rgba(16,185,129,0.2) 50%,
      rgba(15,21,34,0.2) 100%
    ) !important;
    margin-top: -30px !important;
    min-height: 80px !important;
    box-sizing: border-box !important;
  }
  
  .page-auth .cabesalho .logo {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    order: 1 !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
  }
  
  .page-auth .cabesalho .logo img {
    width: 120px !important;
    height: 120px !important;
  }
  
  .page-auth .cabesalho .menu {
    display: flex !important;
    align-items: center !important;
    gap: 70px !important;
    order: 2 !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
  }
  
  .page-auth .cabesalho .botoes {
    display: flex !important;
    gap: 15px !important;
    order: 3 !important;
    position: static !important;
    right: auto !important;
    top: auto !important;
  }
}

/* ========================================
   MOBILE - Menu que funciona sempre
   ======================================== */
@media (max-width: 768px) {
  
  /* ========================================
     HEADER MOBILE - LAYOUT CORRIGIDO
     ======================================== */
  .cabesalho {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 90px;
    padding: 20px 15px;
    box-sizing: border-box;
    position: relative;
    z-index: 1000;
    overflow: visible;
    flex-wrap: nowrap;
    background: linear-gradient(
      to right,
      rgba(15,21,34,0.2) 0%,
      rgba(16,185,129,0.2) 50%,
      rgba(15,21,34,0.2) 100%
    );
  }
  
  /* Logo no canto superior esquerdo - SEMPRE VISÍVEL */
  .cabesalho .logo {
    flex: 0 0 auto;
    display: flex !important;
    align-items: center;
    min-width: 80px;
    max-width: 120px;
    order: 1;
    z-index: 10001;
    position: absolute;
    left: 15px;
    top: 15px;
  }
  
  .cabesalho .logo img {
    max-width: 100px;
    height: auto;
    max-height: 80px;
    width: 100%;
    display: block !important;
  }
  
  /* ========================================
     MENU HAMBÚRGUER - CANTO SUPERIOR DIREITO
     ======================================== */
  .cabesalho .hamburger-menu {
    display: flex !important;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 9999;
    position: absolute;
    right: 15px;
    top: 15px;
    flex: 0 0 auto;
    margin: 0;
    order: 3;
  }
  
  .cabesalho .hamburger-menu span {
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
  }
  
  .cabesalho .hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  
  .cabesalho .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }
  
  .cabesalho .hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
  
  /* Garantir que o hambúrguer funcione igual em todas as telas */
  .cabesalho .hamburger-menu:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
  }
  
  /* Estilos específicos para login e cadastro */
  .page-auth .cabesalho .hamburger-menu {
    display: flex !important;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 9999;
    position: absolute;
    right: 15px;
    top: 15px;
    flex: 0 0 auto;
    margin: 0;
    order: 3;
  }
  
  .page-auth .cabesalho .hamburger-menu span {
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
  }
  
  .page-auth .cabesalho .hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  
  .page-auth .cabesalho .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }
  
  .page-auth .cabesalho .hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
  
  /* Menu modal para login e cadastro */
  .page-auth .cabesalho .menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
  }
  
  .page-auth .cabesalho .menu.active {
    opacity: 1;
    visibility: visible;
  }
  
  .page-auth .cabesalho .menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 30px;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid rgba(0, 123, 255, 0.1);
    margin: 10px 0;
    min-width: 200px;
    justify-content: center;
  }
  
  .page-auth .cabesalho .menu a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
    background: rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.3);
  }
  
  /* Garantir que o menu seja visível quando ativo */
  .page-auth .cabesalho .menu {
    display: flex !important;
  }
  
  .page-auth .cabesalho .menu.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  /* Debug: Garantir que o menu seja visível */
  .page-auth .cabesalho .menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9998 !important;
  }
  
  /* Logo maior para telas de login e cadastro */
  .page-auth .cabesalho .logo img {
    max-width: 110px !important;
    max-height: 90px !important;
    width: auto !important;
    height: auto !important;
  }
  
  /* Botões para telas de login e cadastro */
  .page-auth .cabesalho .botoes {
    display: flex;
    flex-direction: row;
    gap: 8px;
    z-index: 10000;
    position: absolute;
    right: 50px;
    top: 15px;
    align-items: center;
    flex: 0 0 auto;
    min-width: 160px;
    max-width: 200px;
    order: 2;
  }
  
  /* Mobile pequeno - logo ainda maior */
  @media (max-width: 480px) {
    .page-auth .cabesalho .logo img {
      max-width: 100px !important;
      max-height: 80px !important;
    }
  }
  
  /* ========================================
     MENU MODAL - SOLUÇÃO QUE FUNCIONA
     ======================================== */
  .cabesalho .menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
  }
  
  .cabesalho .menu.active {
    opacity: 1;
    visibility: visible;
  }
  
  .cabesalho .menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 30px;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid rgba(0, 123, 255, 0.1);
    margin: 10px 0;
    min-width: 200px;
    justify-content: center;
  }
  
  .cabesalho .menu a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
    background: rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 123, 255, 0.3);
  }
  
  /* ========================================
     BOTÕES DE AÇÃO - AO LADO ESQUERDO DO HAMBÚRGUER
     ======================================== */
  .cabesalho .botoes {
    display: flex;
    flex-direction: row;
    gap: 8px;
    z-index: 10000;
    position: absolute;
    right: 50px;
    top: 15px;
    align-items: center;
    flex: 0 0 auto;
    min-width: 160px;
    max-width: 200px;
    order: 2;
  }
  
  .cabesalho .botoes a {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    flex: 1;
    max-width: 90px;
  }
  
  .cabesalho .botoes .btn-cadastrar {
    background: #007bff;
    color: white;
    border: 2px solid #007bff;
  }
  
  .cabesalho .botoes .btn-cadastrar:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  }
  
  .cabesalho .botoes .btn-login {
    background: transparent;
    color: #007bff;
    border: 2px solid #007bff;
  }
  
  .cabesalho .botoes .btn-login:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  }
  
  /* ========================================
     CONTEÚDO PRINCIPAL - SEM CORTE
     ======================================== */
  .meio {
    padding: 20px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  
  .cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
  }
  
  .card {
    width: 100%;
    margin-bottom: 20px;
  }
  
  /* ========================================
     PÁGINA BEM-VINDO - SEM CORTE
     ======================================== */
  .video-background {
    height: 60vh;
    min-height: 400px;
  }
  
  .meio-text {
    padding: 20px 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .meio-text h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 15px;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }
  
  .meio-text p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }
  
  /* ========================================
     FOOTER - RESPONSIVO
     ======================================== */
  .rodape {
    margin-top: auto;
    padding: 20px;
    text-align: center;
  }
  
  /* ========================================
     LAYOUT GERAL - RESPONSIVO
     ======================================== */
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
}

/* ========================================
   TELAS MUITO PEQUENAS - SEM CORTE
   ======================================== */
@media (max-width: 480px) {
  .cabesalho {
    padding: 18px 15px;
    min-height: 85px;
    flex-wrap: nowrap;
  }
  
  .cabesalho .logo {
    min-width: 80px;
    max-width: 120px;
  }
  
  .cabesalho .logo img {
    max-width: 90px;
    max-height: 70px;
  }
  
  .cabesalho .botoes {
    min-width: 140px;
    max-width: 180px;
    gap: 6px;
    order: 2;
    right: 45px;
    top: 12px;
  }
  
  .cabesalho .botoes a {
    padding: 6px 10px;
    font-size: 11px;
    min-height: 32px;
    max-width: 80px;
  }
  
  .cabesalho .hamburger-menu {
    width: 28px;
    height: 28px;
    margin: 0 5px;
  }
  
  .meio {
    padding: 15px 10px;
  }
  
  .meio-text h1 {
    font-size: 1.8rem;
    line-height: 1.1;
    padding: 0 10px;
  }
  
  .meio-text p {
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 0 10px;
  }
  
  .meio-text {
    padding: 15px 10px;
  }
}