/**
 * ========================================
 * BASE PUBLIC CSS - ESTILOS COMPARTILHADOS
 * ========================================
 *
 * Estilos base para páginas públicas (raiz do site).
 * Carregado via cab/header.php em todas as telas públicas.
 *
 * - Reset + tipografia base (Poppins)
 * - Modal messageModal / confirmModal
 * - Utilitários mobile (overflow, container padding)
 * - Form .is-invalid
 */

/* ==================== */
/* ACESSIBILIDADE       */
/* ==================== */

.skip-to-content {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
}

*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

button:focus-visible,
a:focus-visible,
.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.3);
}

/* ==================== */
/* RESET BÁSICO         */
/* ==================== */

html,
body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) #f5f5f5;
}

html::-webkit-scrollbar {
  width: 8px;
}

html::-webkit-scrollbar-track {
  background: #f5f5f5;
}

html::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}

body {
  font-family: var(--font-family-primary, "Poppins", sans-serif);
  color: var(--color-text, #333);
}

/* ==================== */
/* MODAIS PÚBLICOS      */
/* ==================== */

#messageModal .modal-content,
#confirmModal .modal-content {
  border-radius: var(--border-radius, 10px);
  box-shadow: var(--shadow-lg, 0 8px 16px rgba(0, 0, 0, 0.2));
  border: none;
}

#messageModal .modal-header.bg-primary,
#confirmModal .modal-header.bg-primary {
  background-color: var(--color-primary) !important;
}

#messageModal .btn-close-white,
#confirmModal .btn-close-white {
  filter: brightness(0) invert(1);
}

/* ==================== */
/* FORM VALIDATION      */
/* ==================== */

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ==================== */
/* RESPONSIVIDADE GERAL */
/* ==================== */

/* Tablet */
@media (max-width: 767px) {
  .container {
    padding-left: var(--container-padding-tablet, 15px);
    padding-right: var(--container-padding-tablet, 15px);
  }

  h1 {
    font-size: var(--font-size-h1-tablet, 1.8rem);
  }

  h2 {
    font-size: var(--font-size-h2-tablet, 1.6rem);
  }

  h3 {
    font-size: var(--font-size-h3-tablet, 1.3rem);
  }
}

/* Mobile */
@media (max-width: 575px) {
  .container {
    padding-left: var(--container-padding-mobile, 12px);
    padding-right: var(--container-padding-mobile, 12px);
  }

  h1 {
    font-size: var(--font-size-h1-mobile, 1.5rem);
  }

  h2 {
    font-size: var(--font-size-h2-mobile, 1.4rem);
  }

  h3 {
    font-size: var(--font-size-h3-mobile, 1.1rem);
  }

  .btn {
    min-height: var(--button-min-height, 44px);
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-body {
    padding: var(--modal-padding-mobile, 15px);
  }
}

/* Prevent image overflow on all screens */
img {
  max-width: 100%;
  height: auto;
}

/* Touch-friendly links/buttons on mobile */
@media (pointer: coarse) {
  .nav-link,
  .btn {
    min-height: 44px;
  }
}
