/* Importação do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ==========================================================================
   1. VARIÁVEIS E TEMAS
   ========================================================================== */
:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
  --green: #1ABC9C;
  --blue: #1B4F72;
  --white: #FFFFFF;
  --bg: #F8F9FA;
  --green-soft: rgba(26, 188, 156, 0.14);
  --blue-soft: rgba(27, 79, 114, 0.1);
  --text: #1B4F72;
  --muted: rgba(27, 79, 114, 0.72);
  --line: rgba(27, 79, 114, 0.14);
  --shadow-sm: 0 8px 24px rgba(27, 79, 114, 0.08);
  --shadow-md: 0 18px 42px rgba(27, 79, 114, 0.12);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 230px;
  --nav-height: 88px;
}

/* Modo Escuro */
body.dark-mode {
  color-scheme: dark;
  --bg: #121214;          
  --white: #1a1a1e;       
  --text: #f8f9fa;       
  --muted: #b3b3b3;       
  --line: rgba(255, 255, 255, 0.12); 
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.4);
  --blue-soft: rgba(26, 188, 156, 0.1); 
  
  background:
    radial-gradient(circle at top left, rgba(26, 188, 156, 0.08), transparent 32%),
    var(--bg);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode strong,
body.dark-mode .brand-name,
body.dark-mode .field span,
body.dark-mode .field-label,
body.dark-mode .summary-value,
body.dark-mode .text-btn,
body.dark-mode .popup-title,
body.dark-mode .custom-modal-card h3,
body.dark-mode .profile-form-content .field-label {
  color: #ffffff;
}

body.dark-mode p,
body.dark-mode .hero-copy,
body.dark-mode .auth-copy,
body.dark-mode .page-copy,
body.dark-mode .summary-label,
body.dark-mode .popup-address,
body.dark-mode .day-btn span,
body.dark-mode .field-help,
body.dark-mode .custom-modal-card p {
  color: var(--muted);
}

body.dark-mode .eyebrow {
  color: #1ddeb8;
}

body.dark-mode .auth-card,
body.dark-mode .summary-card,
body.dark-mode .card,
body.dark-mode .day-btn,
body.dark-mode .settings-card,
body.dark-mode .custom-modal-card {
  background: #1e1e24;
  border-color: var(--line);
}

body.dark-mode .btn-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

body.dark-mode .bottom-nav,
body.dark-mode .map-header-panel {
  background: rgba(26, 26, 30, 0.94);
  border-color: var(--line);
}

body.dark-mode .nav-btn {
  color: var(--muted);
}

body.dark-mode .nav-btn.active {
  background: rgba(26, 188, 156, 0.18);
  color: #1abc9c;
}

body.dark-mode .filter-btn:not(.active),
body.dark-mode .nav-btn:not(.active) {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .filter-btn.active,
body.dark-mode .day-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

body.dark-mode .day-btn.active span {
  color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .counter {
  color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .profile-form-content .styled-input {
  background-color: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

body.dark-mode .profile-form-content .styled-input:focus {
  border-color: #10b981;
}

body.dark-mode .settings-actions {
  border-top-color: #334155;
}

body.dark-mode .settings-actions .btn-outline-danger {
  color: #fca5a5;
}

body.dark-mode .input-icon,
body.dark-mode .input-wrap .input-icon {
  color: #94a3b8;
}

body.dark-mode .input-wrap:focus-within .input-icon,
body.dark-mode .field-group:focus-within .input-icon {
  color: #10b981;
}

body.dark-mode .brand-title-nav {
  color: var(--text, #F8F9FA);
}

body.dark-mode .brand-title-nav .brand-highlight {
  color: var(--green, #1ABC9C);
}

body.dark-mode .btn-secondary {
  background-color: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

body.dark-mode .btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body.dark-mode .btn-danger {
  background-color: #e63946;
  color: #ffffff;
}

body.dark-mode .btn-danger:hover {
  background-color: #d62839;
}


/* ==========================================================================
   2. ESTILOS DO LEAFLET (MAPA EM DARK MODE)
   ========================================================================== */
body.dark-mode .leaflet-container {
  background: #121214 !important;
}

body.dark-mode .leaflet-popup-content-wrapper,
body.dark-mode .leaflet-popup-tip {
  background: #1e1e24 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

body.dark-mode .leaflet-popup-content,
body.dark-mode .leaflet-popup-content .popup-title {
  color: #ffffff !important; 
}

body.dark-mode .leaflet-popup-content .popup-address {
  color: #b3b3b3 !important;
}

body.dark-mode .leaflet-popup-content .tag {
  color: #ffffff !important; 
}

body.dark-mode .leaflet-control-zoom-in,
body.dark-mode .leaflet-control-zoom-out {
  background-color: #1e1e24 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}


/* ==========================================================================
   3. TIPOGRAFIA & TAMANHOS GLOBAIS
   ========================================================================== */
html.font-small { font-size: 14px; }
html.font-medium { font-size: 16px; }
html.font-large { font-size: 18px; }


/* ==========================================================================
   4. REGRAS BASE, RESET & SCROLLBAR
   ========================================================================== */
* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body, #app {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(26, 188, 156, 0.12), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 17px;
  line-height: 1.5;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(26, 188, 156, 0.36);
  outline-offset: 3px;
}

h1, h2, h3, p {
  margin-top: 0;
}

svg, .icon {
  max-width: 100%;
  height: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}


/* ==========================================================================
   5. ESTRUTURA DE ECRÃS, PÁGINAS & SHELL
   ========================================================================== */
.screen, .page {
  min-height: 100vh;
  padding: var(--space-6) var(--space-5);
}

.mobile-shell,
.page-inner,
.map-header-inner {
  width: min(100%, 440px);
  margin: 0 auto;
}

.page {
  padding-bottom: calc(var(--nav-height) + var(--space-7));
}

.page-header {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.auth h1,
.page h1 {
  margin-bottom: var(--space-2);
  color: var(--text);
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -0.02em;
}


/* ==========================================================================
   6. BOAS-VINDAS (WELCOME), BRANDING & AUTH
   ========================================================================== */
.welcome {
  display: flex;
  min-height: calc(100vh - 48px);
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-7);
}

.welcome-modern {
  position: relative;
  z-index: 1;
}

.welcome-bg-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, var(--green, #2ecc71) 0%, rgba(46, 204, 113, 0) 70%);
  opacity: 0.15;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

.welcome-bg-lines {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: -1 !important;
  background-image: repeating-linear-gradient(
    -35deg,
    transparent,
    transparent 28px,
    var(--line, rgba(0, 0, 0, 0.03)) 28px,
    var(--line, rgba(0, 0, 0, 0.03)) 29px
  ) !important;
  mask-image: radial-gradient(circle at center, black 50%, transparent 95%);
  -webkit-mask-image: radial-gradient(circle at center, black 50%, transparent 95%);
}

.hero-panel {
  display: grid;
  gap: var(--space-6);
  padding-top: var(--space-4);
}

.hero-panel-modern {
  position: relative;
  z-index: 1;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 !important;
  text-align: center;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 320px;
}

.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 20px;
  transition: transform 0.3s ease;
}

.brand-badge .brand-mark {
  color: var(--green, #2ecc71);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-badge .brand-mark svg {
  width: 32px;
  height: 32px;
}

.brand-mark,
.icon-tile {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--green);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.brand-mark {
  width: 62px;
  height: 62px;
  border-radius: 22px;
}

.brand-name {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.brand-title {
  font-size: 2.75rem !important;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text, #0f172a);
  margin: 0;
  line-height: 1;
}

.brand-highlight {
  color: var(--green, #2ecc71);
}

.brand-place {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.brand-location {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted, #64748b);
  margin: 10px 0 24px 0;
}

.brand-slogan {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--muted, #475569);
  margin: 0;
  font-weight: 400;
}

.hero-illustration {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(26, 188, 156, 0.18), rgba(255, 255, 255, 0.98)),
    var(--white);
  box-shadow: var(--shadow-md);
}

.hero-illustration::before {
  content: "";
  position: absolute;
  inset: auto -30px -54px -30px;
  height: 116px;
  border-radius: 50% 50% 0 0;
  background: rgba(26, 188, 156, 0.2);
}

.hero-illustration svg {
  position: absolute;
  right: 22px;
  bottom: 24px;
  width: 204px;
  max-width: 70%;
  color: var(--blue);
}

.hero-title {
  margin-bottom: var(--space-4);
  color: var(--blue);
  font-size: clamp(38px, 13vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero-copy,
.auth-copy,
.page-copy,
.summary-copy {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.actions {
  display: grid;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
}

.actions-modern {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth {
  display: flex;
  min-height: calc(100vh - 48px);
  flex-direction: column;
  justify-content: center;
}

.auth-card,
.summary-card,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.auth-card {
  margin-top: var(--space-5);
  padding: var(--space-6);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px 0;
}

.login-header p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.switch-auth {
  margin-top: var(--space-4);
}

.body-welcome .theme-toggle-btn,
.body-auth .theme-toggle-btn {
  display: none;
}

.brand-title-nav {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue, #1B4F72);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
}

.brand-title-nav .brand-highlight {
  color: var(--green, #1ABC9C);
}


/* ==========================================================================
   7. FORMULÁRIOS, CAMPOS DE ENTRADA & INPUTS
   ========================================================================== */
.form,
.profile-form-content,
.settings-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.profile-form-content {
  gap: 16px !important;
  padding: 16px 4px 8px;
}

.field,
.field-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.4rem !important;
  width: 100% !important;
}

.field span,
.field-label,
.profile-form-content .field-label {
  display: block !important;
  color: var(--text) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  margin-left: 2px !important;
}

.field-help,
.profile-form-content .field-help {
  font-size: 0.75rem !important;
  color: var(--muted) !important;
  margin-top: 2px !important;
  margin-left: 2px !important;
}

/* Envolvente do Input */
.input-wrap,
.profile-form-content .input-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  height: 52px !important;
  min-height: 52px !important;
  border: 2px solid var(--line) !important;
  border-radius: 14px !important;
  background: var(--white) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.input-wrap:focus-within,
.profile-form-content .input-wrapper:focus-within {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 4px rgba(26, 188, 156, 0.12) !important;
}

/* Ícone Interno */
.input-icon,
.input-wrap .input-icon,
.profile-form-content .input-wrapper svg,
.profile-form-content .input-wrapper .input-icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  background: transparent !important;
  color: #64748b !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

.input-icon svg,
.input-wrap .input-icon svg {
  width: 20px !important;
  height: 20px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.6 !important;
}

.input-wrap:focus-within .input-icon,
.field-group:focus-within .input-icon {
  color: #10b981 !important;
}

/* Campo de Digitação Interno */
.input-wrap input,
.profile-form-content .styled-input {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  color: var(--text) !important;
  font-size: 16px !important;
  padding-left: 46px !important;
  padding-right: 14px !important;
  box-sizing: border-box !important;
}

.input-wrap input[type="password"],
.input-wrap input[type="text"] {
  padding-right: 42px !important;
}

.input-wrap input::placeholder {
  color: var(--muted) !important;
  opacity: 0.7 !important;
}

/* Botão Alternar Senha */
.toggle-password-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 4px;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #888);
  transition: color 0.2s ease;
  z-index: 2;
}

.toggle-password-btn:hover {
  color: var(--green, #2ecc71);
}

.toggle-password-btn .eye-icon {
  width: 18px;
  height: 18px;
  pointer-events: none;
}


/* ==========================================================================
   8. BOTÕES (BUTTONS & ACTIONS)
   ========================================================================== */
.btn,
.text-btn,
.filter-btn,
.btn-remover-fav,
.day-btn,
.accordion-header,
.settings-card {
  -webkit-tap-highlight-color: transparent;
}

/* Torna transparente qualquer retângulo ou destaque de toque/foco em todos os botões */
button, 
button:active, 
button:focus, 
button:focus-visible {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}

/* Aplicação específica para o botão de confirmar treino (ajusta a classe/ID se necessário) */
#complete-today-btn, 
.btn-concluir {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm, 14px);
  gap: var(--space-2);
  font-size: 18px;
  font-weight: 600;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, all 0.2s ease;
  cursor: pointer;
}

.btn:active,
.filter-btn:active,
.nav-btn:active,
.day-btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  border: 1px solid #ced4da;
  background-color: #e9ecef;
  color: #495057;
}

.btn-secondary:hover {
  background-color: #dee2e6;
  color: #212529;
}

.btn-danger {
  background-color: #dc3545;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #bb2d3b;
}

.text-btn {
  min-height: 44px;
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.settings-actions {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin-top: 12px !important;
  padding-top: 16px !important;
  border-top: 1px solid var(--line) !important;
  box-sizing: border-box !important;
}

.settings-actions .btn-danger-subtle {
  margin-top: 4px !important;
}

.settings-actions .btn {
  width: 100% !important;
  padding: 12px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  border: none !important;
  cursor: pointer !important;
}

.btn-outline-danger,
.btn-danger-subtle {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  text-align: center !important;
  transition: all 0.2s ease !important;
}

.btn-outline-danger {
  padding: 12px 16px !important;
  min-height: 48px !important;
  background: rgba(220, 38, 38, 0.08) !important;
  color: #dc2626 !important;
  border: 1.5px solid rgba(220, 38, 38, 0.28) !important;
}

.btn-outline-danger:hover {
  background: rgba(220, 38, 38, 0.14) !important;
}

.btn-danger-subtle {
  width: auto !important;
  min-height: auto !important;
  padding: 4px !important;
  background-color: transparent !important;
  color: #dc2626 !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
  opacity: 0.65 !important;
  border: none !important;
}

.btn-danger-subtle:hover {
  opacity: 1 !important;
}


/* ==========================================================================
   9. PAINEL DO MAPA, FILTROS & MARCADORES
   ========================================================================== */
.map-screen {
  min-height: 100vh;
  padding: var(--space-4) var(--space-4) calc(var(--nav-height) + var(--space-4));
}

.map-header {
  position: relative;
  z-index: 500;
  margin-bottom: var(--space-4);
}

.map-header-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}

.map-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.map-title-row h1 {
  margin: var(--space-1) 0 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 42px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: auto;
}

.filter-container {
  display: flex;
  gap: 8px;
  width: 100%;
}

.filter-btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 0.875rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.filter-btn.active {
  background: var(--green);
  color: var(--white);
}

.map-card {
  overflow: hidden;
  width: min(100%, 440px);
  height: calc(100vh - 260px);
  min-height: 430px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

#map {
  height: 100%;
  width: 100%;
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-control-zoom a {
  color: var(--blue) !important;
}

.marker-pin {
  display: block;
  width: 26px;
  height: 26px;
  border: 4px solid var(--white);
  border-radius: 999px 999px 999px 0;
  box-shadow: 0 10px 22px rgba(27, 79, 114, 0.24);
  transform: rotate(-45deg);
}

.marker-regular { background: var(--green); }
.marker-pcd { background: var(--blue); }

.popup-title {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--blue);
  font-size: 16px;
  line-height: 1.35;
}

.popup-address {
  margin-bottom: var(--space-3);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.tag-regular {
  background: var(--green-soft);
  color: var(--blue);
}

.tag-pcd {
  background: var(--blue-soft);
  color: var(--blue);
}

.leaflet-bottom.leaflet-right,
.leaflet-bottom.leaflet-left {
  bottom: 70px !important; 
}

.leaflet-control-container .leaflet-bottom {
  z-index: 999;
}


/* ==========================================================================
   10. CARDS, RESUMOS & APARELHOS
   ========================================================================== */
.summary-grid {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card {
  padding: var(--space-4);
}

.summary-label {
  margin-bottom: var(--space-1);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.summary-value {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 900;
}

.equipment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
}

.card-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.icon-tile {
  width: 50px;
  height: 50px;
  border-radius: 18px;
}

.card h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.25;
}

.card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.equipment-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
}

.equipment-media {
  width: 100%;
  height: 200px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.equipment-img {
  width: 110%;
  height: 110%;
  object-fit: contain;
  object-position: center;
  padding: 12px;
  box-sizing: border-box;
}

.equipment-content {
  padding: 16px;
}


/* ==========================================================================
   11. TELA DE FREQUÊNCIA (MODERNA E EFICIENTE)
   ========================================================================== */

.freq-section {
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
}

.freq-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.freq-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}



/* Enfileiramento Linear dos Dias (Mobile First) */
/* Container dos dias */
.week-grid-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0; /* Um pouco mais de espaço em cima para o ponto flutuante */
}



/* Garante o reset de botões e o formato de bolinha minimalista */
button.day-pill {
  position: relative !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  background-color: var(--card-bg, #1a1a1a) !important;
  background-image: none !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
}

/* Texto do dia padrão */
button.day-pill .day-name {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: var(--muted, #888) !important;
  line-height: 1 !important;
}


/* Estado padrão (não marcado) adaptável ao tema claro e escuro */
.freq-section .week-grid-modern button.day-pill {
  background-color: var(--pill-bg, rgba(0, 0, 0, 0.05)) !important;
  border: 1.5px solid var(--pill-border, rgba(0, 0, 0, 0.1)) !important;
}

.freq-section .week-grid-modern button.day-pill .day-name {
  color: var(--pill-text, #555) !important;
}

/* Se o teu projeto usar uma classe ou atributo para o modo escuro (ex: body.dark ou [data-theme="dark"]) */
/* Podes ajustar aqui para manter escuro no modo dark: */
body.dark-mode .freq-section .week-grid-modern button.day-pill,
[data-theme="dark"] .freq-section .week-grid-modern button.day-pill {
  background-color: var(--card-bg, #1a1a1a) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .freq-section .week-grid-modern button.day-pill .day-name,
[data-theme="dark"] .freq-section .week-grid-modern button.day-pill .day-name {
  color: var(--muted, #888) !important;
}

/* Oculta ícone antigo */
button.day-pill .day-status-icon {
  display: none !important;
}

/* Preenchimento Verde Sólido para Dias Confirmados */
button.day-pill.marcado {
  background-color: var(--green) !important;
  background: var(--green) !important;
  border-color: var(--green) !important;
  box-shadow: none !important;
}

/* Garante que o texto fique com cor escura para contrastar perfeitamente com o fundo verde */
button.day-pill.marcado .day-name {
  color: #0b1a12 !important;
  font-weight: 800 !important;
}

/* Indicador do dia atual (flutuando acima) */
button.day-pill .today-dot {
  position: absolute !important;
  top: -10px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 5px !important;
  height: 5px !important;
  border-radius: 50% !important;
  background-color: var(--green) !important;
}

/* Se o dia atual estiver marcado, o ponto flutuante fica branco */
button.day-pill.marcado .today-dot {
  background-color: #ffffff !important;
}

/* Estado Futuro */
button.day-pill.futuro {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
}

/* Card de Progresso Unificado */
.freq-card-progress {
  background: var(--white) !important;
  border: 1px solid var(--line) !important;
  border-radius: 20px !important;
  padding: 18px 20px !important;
  box-shadow: var(--shadow-sm) !important;
  margin-bottom: var(--space-5) !important;
}

/* Dia Confirmado: Totalmente preenchido de verde sólido (fundo, borda e brilho) */
.freq-section .week-grid-modern button.day-pill.marcado {
  background-color: #10b981 !important; /* Verde sólido totalmente preenchido */
  background: #10b981 !important;
  border-color: #10b981 !important;
  
  /* Brilho neon espalhado */
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4), 
              0 0 20px rgba(16, 185, 129, 0.3) !important;
}

/* Estado do dia selecionado/atual (substitui o fundo escuro/preto por verde) */
.freq-section .week-grid-modern button.day-pill.selected,
.freq-section .week-grid-modern button.day-pill.active,
.freq-section .week-grid-modern button.day-pill[aria-selected="true"] {
  background-color: #10b981 !important;
  background: #10b981 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4), 
              0 0 20px rgba(16, 185, 129, 0.3) !important;
}

/* Garante o contraste do texto para o dia selecionado */
.freq-section .week-grid-modern button.day-pill.selected .day-name,
.freq-section .week-grid-modern button.day-pill.active .day-name,
.freq-section .week-grid-modern button.day-pill[aria-selected="true"] .day-name {
  color: #0b1a12 !important;
  font-weight: 800 !important;
}



/* Força o texto dentro do botão verificado a ficar escuro para leitura perfeita */
.freq-section .week-grid-modern button.day-pill.marcado .day-name {
  color: #0b1a12 !important;
  font-weight: 800 !important;
}

.freq-progress-info {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 12px !important;
}

.freq-progress-label {
  display: block !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: var(--muted) !important;
  text-transform: uppercase !important;
}

.freq-progress-value {
  display: block !important;
  font-size: 1.4rem !important;
  font-weight: 800 !important;
  color: var(--text) !important;
}

.freq-percentage-badge {
  display: none !important;
}

.freq-progress-track {
  width: 100% !important;
  height: 8px !important;
  background: var(--line) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

.freq-progress-bar {
  height: 100% !important;
  background: var(--green) !important;
  border-radius: 10px !important;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Botão Principal Destacado (CTA) */
.btn-confirmar-modern {
  width: 100% !important;
  min-height: 56px !important;
  border-radius: 18px !important;
  border: none !important;
  background: linear-gradient(135deg, #1abc9c, #16a085) !important;
  color: #ffffff !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  box-shadow: 0 10px 20px -5px rgba(26, 188, 156, 0.4) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-confirmar-modern:active {
  transform: scale(0.98) !important;
}

.btn-confirmar-modern.concluido {
  background: var(--blue) !important;
  box-shadow: 0 10px 20px -5px rgba(27, 79, 114, 0.3) !important;
}

/* Dark Mode Suporte para Tela de Frequência */
body.dark-mode .day-pill {
  background: #1e1e24 !important;
  border-color: var(--line) !important;
}

body.dark-mode .day-pill .day-name {
  color: #ffffff !important;
}

body.dark-mode .freq-card-progress {
  background: #1e1e24 !important;
  border-color: var(--line) !important;
}

body.dark-mode .freq-progress-value {
  color: #ffffff !important;
}

/* 11.3 Botão Principal de Confirmação Posicionado Abaixo */
.frequencia-main-action {
  margin-top: var(--space-4) !important;
  margin-bottom: var(--space-5) !important;
  width: 100% !important;
}

.btn-confirmar-treino {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  background-color: var(--green, #1ABC9C);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-confirmar-treino:active {
  transform: scale(0.98);
}

.btn-confirmar-treino.concluido {
  background-color: var(--blue, #1B4F72);
}

/* ==========================================================================
   BADGE DO FOGUINHO NO TÍTULO (ESTÁTICO)
   ========================================================================== */

   

.header-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 107, 0, 0.12);
  border: 1.5px solid rgba(255, 107, 0, 0.35);
  color: #ff6b00;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 800;
  vertical-align: middle;
  /* Animação suave apenas no surgimento do elemento */
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.flame-icon {
  font-size: 1.1rem;
  display: inline-block;
  line-height: 1;
}

.streak-num {
  font-weight: 800;
  color: #ff6b00;
  font-size: 1rem;
}

/* Badge do Foguinho (Aparece apenas a partir de 2 dias) */
.freq-percentage-badge.flame-badge {
  background: rgba(255, 107, 0, 0.15) !important;
  color: #ff6b00 !important;
  border: 1px solid rgba(255, 107, 0, 0.4) !important;
  padding: 4px 12px !important;
  border-radius: 20px !important;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Suporte para Dark Mode */
body.dark-mode .freq-percentage-badge.flame-badge {
  background: rgba(255, 107, 0, 0.2) !important;
  border-color: rgba(255, 107, 0, 0.45) !important;
  color: #ff8c38 !important;
}


/* ==========================================================================
   12. CONFIGURAÇÕES & ACCORDIONS
   ========================================================================== */
.settings-list,
#settings-screen .settings-list,
.settings-list form {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  width: 100% !important;
  margin-top: 16px !important;
}

.settings-card,
.settings-list .settings-card,
.settings-list > div,
.settings-list form > div {
  display: block !important;
  position: relative !important;
  background-color: var(--white) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  margin: 0 !important;
  box-shadow: none !important;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  user-select: none;
  cursor: pointer;
}

.accordion-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion-title svg,
.settings-card svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.chevron-icon {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-card.open .chevron-icon {
  transform: rotate(180deg);
}

.settings-group {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  box-sizing: border-box;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  transition: 
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
    opacity 0.25s ease, 
    margin-top 0.35s ease, 
    padding-top 0.35s ease,
    border-color 0.35s ease;
}

.settings-card.open .settings-group {
  max-height: 800px; 
  opacity: 1; 
  margin-top: 16px;
  padding-top: 16px;
  border-top-color: var(--line);
  cursor: default;
}

.theme-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.theme-switch-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px; 
  padding: 4px 0;
}

.theme-label {
  font-size: 16px;
  font-weight: 600; 
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--line);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider.round {
  border-radius: 34px;
}

.slider.round::before {
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--green);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.setting-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.setting-toggle input[type="checkbox"],
.setting-toggle input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}


/* ==========================================================================
   13. BOTTOM NAV, MODAIS, TOASTS & PAINEL ADMIN
   ========================================================================== */
.bottom-nav {
  position: fixed;
  z-index: 1000;
  right: 0;
  bottom: 0;
  left: 0;
  padding: var(--space-2) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(27, 79, 114, 0.08);
  backdrop-filter: blur(14px);
}

.bottom-nav-inner {
  display: grid;
  width: min(100%, 440px);
  margin: 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.nav-btn {
  display: grid;
  min-height: 64px;
  place-items: center;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.nav-btn.active {
  background: var(--green-soft);
  color: var(--blue);
}

.nav-icon,
.btn-icon,
.card-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  margin-bottom: 2px;
  color: currentColor;
}

.custom-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 280px;
  max-width: 90%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.custom-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-sucesso {
  background-color: #059669;
  border: 1px solid #10b981;
}

.toast-erro {
  background-color: #dc2626;
  border: 1px solid #ef4444;
}

.custom-toast button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.custom-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.custom-modal-backdrop.show {
  opacity: 1;
}

.custom-modal-card {
  background-color: var(--white);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
  text-align: left;
}

.custom-modal-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  color: var(--text);
}

.custom-modal-card p {
  margin: 0 0 20px 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Painel Admin */
.btn-admin-tab {
  padding: 12px;
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-admin-tab.active {
  background: #00ff88 !important;
  color: #000 !important;
  border: 1px solid #00ff88 !important;
}


/* ==========================================================================
   14. RESPONSIVIDADE & MEDIA QUERIES
   ========================================================================== */

/* Mobile P (Até 360px) */
@media (max-width: 360px) {
  body {
    font-size: 16px;
  }

  .screen, .page {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
  }

  .filters, .bottom-nav-inner {
    gap: 6px;
  }

  .filter-btn {
    font-size: 0.75rem;
    padding: 8px 4px;
  }
}

/* Modo Tablet e Laptop (Telas a partir de 768px): Retângulos maiores e mais próximos */
@media (min-width: 768px) {
  /* Aproxima os blocos diminuindo o espaço do container */
  .freq-section .week-grid-modern {
    gap: 4px !important; /* Reduz o espaço entre os retângulos */
  }

  /* Aumenta o tamanho dos botões retangulares */
  .freq-section .week-grid-modern button.day-pill {
    border-radius: 14px !important; /* Cantos arredondados */
    width: 75px !important;          /* Aumenta a largura consideravelmente */
    height: 52px !important;         /* Aumenta a altura para proporção maior */
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .map-screen {
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    box-sizing: border-box;
  }

  /* Faz o card do mapa expandir horizontalmente para ocupar a largura da tela */
  .map-card {
    width: 100% !important;
    max-width: 100% !important;
    height: 55vh; /* Ajuste a altura vertical do mapa conforme preferir */
  }

  #map {
    width: 100% !important;
    height: 100% !important;
  }

  /* Opcional: ajusta o painel de cima para não ficar esticado demais */
  .map-header-panel {
    width: 100%;
    margin-bottom: var(--space-4);
  }
}

/* Telas Mobile e Tablet Pequeno (Até 1023px) */
@media (max-width: 1023px) {
  .bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 68px !important;
    background: var(--white) !important;
    border-top: 1px solid var(--line) !important;
    backdrop-filter: blur(14px) !important;
    z-index: 1000 !important;
    padding: 6px 8px !important;
    box-sizing: border-box !important;
  }

  .bottom-nav-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    width: 100% !important;
    height: 100% !important;
  }

  .nav-brand,
  .bottom-nav-inner .nav-brand {
    display: none !important;
  }

  .nav-buttons,
  .bottom-nav-inner .nav-buttons {
    display: flex !important;
    width: 100% !important;
    justify-content: space-around !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .nav-buttons .nav-btn {
    flex: 1 !important;
    min-width: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    gap: 4px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--muted) !important;
  }

  .nav-buttons .nav-btn.active {
    background: transparent !important;
    color: var(--green) !important;
  }

  .nav-buttons .nav-btn .nav-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 52px !important;
    height: 28px !important;
    border-radius: 16px !important;
    background-color: transparent !important;
    transition: background-color 0.2s ease !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  .nav-buttons .nav-btn.active .nav-icon {
    background-color: var(--green-soft) !important;
  }

  .nav-buttons .nav-btn svg,
  .nav-buttons .nav-btn .nav-icon svg {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    display: block !important;
    stroke: currentColor !important;
    fill: none !important;
  }

  .nav-buttons .nav-btn span {
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    color: currentColor !important;
  }
}

/* Tablet (Acima de 720px) */
@media (min-width: 720px) {
  .screen {
    display: grid;
    place-items: center;
  }

  .mobile-shell {
    position: relative;
    z-index: 1;
  }

  .map-card {
    height: 620px;
  }
}

/* Desktop e Tablet Expandido (Acima de 768px) */
@media (min-width: 768px) {
  .mobile-shell,
  .page-inner,
  .map-header-inner {
    width: min(100%, 720px);
  }

  .week-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .day-btn {
    min-height: 100px !important;
    padding: 8px 2px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  .day-btn strong {
    font-size: 14px !important;
  }

  .day-btn span {
    font-size: 10px !important;
    line-height: 1.1 !important;
    margin-top: 4px !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: center !important;
  }

  .page,
  .page-inner,
  .mobile-shell {
    max-width: 100% !important;
    width: 680px !important;
    margin: 0 auto !important;
  }

  .bottom-nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
  }

  .brand-title-nav {
    order: 1;
  }

  .nav-buttons {
    order: 2;
  }
}

/* Monitores e Telas Grandes (Acima de 1024px) */
@media (min-width: 1024px) {
  .map-screen {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--space-6);
    padding: var(--space-6);
    /* Força uma altura fixa para o grid com base na tela */
    height: calc(100vh - 100px); 
    box-sizing: border-box;
  }

  .map-header {
    margin-bottom: 0;
    height: 100%;
    display: flex;
  }

  .map-header-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Mantém os elementos espalhados de cima a baixo */
    box-sizing: border-box;
  }

  .map-card {
    height: 100%;
    width: 100%;
  }

  #map {
    height: 100%;
    width: 100%;
  }


  .equipment-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
  }

  .page, .map-screen {
    padding-top: calc(var(--nav-height) + var(--space-4));
    padding-bottom: var(--space-6);
  }

  .bottom-nav {
    top: 0 !important;
    bottom: auto !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    box-shadow: 0 10px 30px rgba(27, 79, 114, 0.04) !important;
    padding: 0 24px !important;
    height: 64px !important;
  }

  .bottom-nav-inner {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 1400px !important;
    height: 100% !important;
    margin: 0 auto !important;
  }

  .nav-brand,
  .bottom-nav-inner .nav-brand {
    grid-column: 1 !important;
    justify-self: start !important;
    order: 1 !important;
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .nav-buttons,
  .bottom-nav-inner .nav-buttons {
    grid-column: 2 !important;
    justify-self: center !important;
    order: 2 !important;
    position: static !important;
    transform: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 !important;
  }

  .nav-buttons .nav-btn {
    min-width: 110px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 16px !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  .nav-buttons .nav-btn .nav-icon {
    margin: 0 !important;
  }
}
/* Aceite obrigatório no cadastro */
.terms-consent { display: flex; align-items: flex-start; gap: 12px; color: var(--text); }
.terms-consent input[type="checkbox"] { width: 22px; height: 22px; flex: 0 0 22px; margin: 2px 0 0; accent-color: var(--green); cursor: pointer; }
.terms-link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; line-height: 1.5; border: 0; background: none; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.terms-help { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.terms-link:focus-visible, .terms-consent input:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
#auth-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.forgot-password { display: block; margin: 16px auto 0; text-decoration: underline; text-underline-offset: 3px; }
.form .forgot-password { display: block; width: fit-content; max-width: 100%; margin: -6px 0 0; padding: 0; justify-self: start; align-self: flex-start; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
#recovery-submit:disabled { opacity: 0.55; cursor: not-allowed; }

.terms-dialog { width: min(760px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: 85vh; max-height: 85dvh; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--white); color: var(--text); box-shadow: var(--shadow-md); overflow: hidden; }
.terms-dialog[open] { display: flex; flex-direction: column; }
.terms-dialog::backdrop { background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(4px); }
.terms-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.terms-dialog-header h2 { margin: 0; font-size: 1.25rem; }
.terms-close { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font-size: 1.2rem; cursor: pointer; }
.terms-close:focus-visible, .terms-dialog-content:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.terms-dialog-content { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 22px; line-height: 1.7; }
.terms-dialog-content h1 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 16px; }
.terms-dialog-content h2 { font-size: 1.15rem; line-height: 1.4; margin: 26px 0 12px; }
.terms-dialog-content p { margin: 0 0 16px; color: var(--text); }
.terms-dialog-content a { color: var(--text); text-decoration: underline; }
.terms-dialog-content aside { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }