* { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: linear-gradient(160deg, #f0f4f8 0%, #e8eef5 40%, #f5f0e8 100%);
  color: #2c3e50;
  min-height: 100vh;
}
h1 {
  text-align: center;
  color: #1a365d;
  font-size: 1.6rem;
  margin-bottom: 8px;
}
h2 {
  text-align: center;
  color: #4a5568;
  font-size: 1.1rem;
  font-weight: normal;
  margin: 5px 0 15px;
}
.info-box {
  background: #ffffff;
  border: 1px solid #cbd5e0;
  border-radius: 12px;
  padding: 15px 20px;
  max-width: 900px;
  margin: 0 auto 20px;
  text-align: center;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.info-box strong { color: #2b6cb0; }

/* Caixa de Inscrição de E-mail */
.email-subscription-box {
  background: #ffffff;
  border: 2px solid #3182ce;
  border-radius: 12px;
  padding: 20px;
  max-width: 700px;
  margin: 0 auto 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(49, 130, 206, 0.15);
}
.email-subscription-box h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #2b6cb0;
}
.email-form {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.email-input {
  padding: 10px 14px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.95rem;
  width: 65%;
  min-width: 240px;
}
.email-btn {
  padding: 10px 20px;
  background: #3182ce;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.email-btn:hover { background: #2b6cb0; }
.email-status {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: bold;
}

/* Alerta de Desparasitação */
.parasite-alert {
  display: none;
  background: #fff5f5;
  border: 2px solid #e53e3e;
  border-radius: 12px;
  padding: 15px 20px;
  max-width: 700px;
  margin: 0 auto 15px;
  text-align: center;
  color: #9b2c2c;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(229,62,62,0.2);
}

.today-info {
  background: #ebf8ff;
  border: 2px solid #3182ce;
  border-radius: 12px;
  padding: 12px 20px;
  max-width: 700px;
  margin: 0 auto 25px;
  text-align: center;
  font-size: 1.15rem;
  box-shadow: 0 2px 10px rgba(49,130,206,0.15);
}
.today-info .day-num { font-size: 1.8rem; color: #2b6cb0; font-weight: bold; }

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 15px auto 25px;
  max-width: 950px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid #cbd5e0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  color: #2d3748;
}
.legend-color {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2);
}

#calendar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
}

.month {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  width: 210px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
  overflow: visible;
}
.month:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  z-index: 10;
}
.month h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #2b6cb0;
  line-height: 1.3;
  min-height: 2.6em;
}
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  position: relative;
  overflow: visible;
}

.day {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
  transition: transform 0.15s;
}

.day:hover {
  transform: scale(1.2);
  z-index: 100;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.day.today {
  outline: 3px solid #3182ce !important;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px #90cdf4, 0 0 12px rgba(49,130,206,0.5);
  font-weight: 900;
  z-index: 101;
}
.day.day-zero {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  height: 40px;
  font-size: 1rem;
}

/* Tooltip flutuante corrigido */
.tooltip {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a202c;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 9999 !important;
  border: 1px solid #4a5568;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.days-grid .day:nth-child(7n) .tooltip {
  left: auto;
  right: 0;
  transform: none;
}
.days-grid .day:nth-child(7n-6) .tooltip {
  left: 0;
  transform: none;
}

.day:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

footer {
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #4a5568;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  border-top: 1px solid #cbd5e0;
}
footer b { color: #2b6cb0; }
.phase-emoji { font-size: 1.1em; margin-right: 2px; }