/* =============================================
   TELA INICIAL — TOTEM PSA / HSANP
   Paleta teal/azul-petróleo (baseado no Totem CDI)
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1f5c7e;
}

body {
  background: linear-gradient(160deg, #ecf3f5 0%, #cce6e8 50%, #d8eef0 100%);
}

/* ── Orbs decorativos ───────────────────────── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb linear infinite;
}
.orb-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(114,193,189,0.35) 0%, transparent 70%);
  top: -120px; left: -100px;
  animation-duration: 18s;
}
.orb-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(31,92,126,0.18) 0%, transparent 70%);
  bottom: 60px; right: -80px;
  animation-duration: 22s;
  animation-delay: -7s;
}
.orb-3 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(169,217,215,0.30) 0%, transparent 70%);
  top: 40%; left: 60%;
  animation-duration: 15s;
  animation-delay: -3s;
}
.orb-4 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(123,159,179,0.25) 0%, transparent 70%);
  top: 30%; left: 10%;
  animation-duration: 20s;
  animation-delay: -10s;
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0px) scale(1); }
  33%       { transform: translateY(-30px) scale(1.05); }
  66%       { transform: translateY(20px) scale(0.97); }
}

/* ── Partículas ─────────────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.particle {
  position: absolute;
  background: #72c1bd;
  border-radius: 50%;
  animation: floatParticle ease-in-out infinite;
}
@keyframes floatParticle {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.2; }
  50%       { transform: translateY(-40px) scale(1.3); opacity: 0.5; }
}

/* ── Header ─────────────────────────────────── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 36px;
  background: linear-gradient(135deg, #7b9fb3 0%, #1f5c7e 100%);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  animation: slideDown 0.7s ease both;
}
.header-center .logo {
  height: 70px;
  object-fit: contain;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ── Carrossel Instagram ────────────────────── */
.carousel-container {
  position: fixed !important;
  top: 110px;
  left: 0; right: 0;
  bottom: 170px;
  z-index: 200;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  gap: 10px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.carousel-container.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Barras de progresso — fora da imagem, em cima */
.carousel-progress {
  width: 95%;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(31,92,126,0.18);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar .progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #72c1bd, #1f5c7e);
  border-radius: 2px;
}
.progress-bar.completed .progress-fill {
  width: 100%;
}
.progress-bar.active .progress-fill {
  width: 0%;
  animation: progressFill 4s linear forwards;
}
@keyframes progressFill {
  from { width: 0%; }
  to   { width: 100%; }
}

/* Área da imagem */
.carousel {
  position: relative !important;
  width: 95% !important;
  flex: 1;
  min-height: 0;
  border-radius: 20px;
  overflow: hidden !important;
  background: #1a3a4a;
  box-shadow: 0 12px 48px rgba(31,92,126,0.28);
}
.carousel-img {
  position: absolute !important;
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: 100% !important;
  object-fit: cover !important;
  opacity: 0 !important;
  transition: opacity 0.8s ease-in-out;
  display: block !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.carousel-img.active {
  opacity: 1 !important;
}

/* Dots — fora da imagem, embaixo */
.carousel-dots {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(31,92,126,0.25);
  transition: all 0.3s ease;
  cursor: pointer;
}
.dot.active {
  background: #1f5c7e;
  width: 28px;
  border-radius: 5px;
}

/* ── Tarja (CTA) ────────────────────────────── */
.tarja {
  position: fixed;
  bottom: 82px;
  left: 0; right: 0;
  z-index: 250;
  text-align: center;
  padding: 32px 20px;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ecf3f5;
  background: linear-gradient(135deg, #1f5c7e 0%, #7b9fb3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseBtn 3s ease-in-out infinite;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.tarja.hidden {
  opacity: 0;
  visibility: hidden;
}

/* ── Conteúdo Principal (Botões) ────────────── */
#conteudo {
  display: none;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: fixed;
  top: 110px;
  left: 0; right: 0;
  bottom: 82px;
  z-index: 400;
  overflow-y: auto;
  padding: 20px;
}
#conteudo.mostrar {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

/* ── Grupo de Botões ────────────────────────── */
.btn-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 800px;
  padding: 10px 20px;
}

/* ── Botão de Exame (CDI-style) ─────────────── */
.btn-exame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 24px;
  width: 92%;
  max-width: 700px;
  border-radius: 16px;
  cursor: pointer;
  background: linear-gradient(135deg, #7b9fb3 0%, #1f5c7e 100%);
  border: none;
  box-shadow: 0 6px 24px rgba(31,92,126,0.30), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
  color: #ecf3f5;
  animation: fadeInUp 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
.btn-exame::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 55%);
  border-radius: inherit;
  pointer-events: none;
}
.btn-exame:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(31,92,126,0.40), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-exame:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 3px 12px rgba(31,92,126,0.30), inset 0 2px 4px rgba(0,0,0,0.12);
}
.btn-exame h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  color: #ecf3f5;
  margin: 0;
  line-height: 1.2;
}
.btn-exame p {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  font-weight: 400;
  color: rgba(236,243,245,0.65);
  margin: 0;
  line-height: 1.4;
}

/* Entrada escalonada */
.btn-exame:nth-child(1)  { animation-delay: 0.10s; }
.btn-exame:nth-child(2)  { animation-delay: 0.15s; }
.btn-exame:nth-child(3)  { animation-delay: 0.20s; }
.btn-exame:nth-child(4)  { animation-delay: 0.25s; }
.btn-exame:nth-child(5)  { animation-delay: 0.30s; }
.btn-exame:nth-child(6)  { animation-delay: 0.35s; }
.btn-exame:nth-child(7)  { animation-delay: 0.40s; }
.btn-exame:nth-child(8)  { animation-delay: 0.45s; }
.btn-exame:nth-child(9)  { animation-delay: 0.50s; }
.btn-exame:nth-child(10) { animation-delay: 0.55s; }

/* Botões de emergência (cores distintas) */
.btn-vermelho {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
}
.btn-amarelo {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
}
.btn-amarelo h2,
.btn-amarelo p {
  color: #1a1a1a !important;
}

/* ── Rodapé ─────────────────────────────────── */
.footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 280;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 32px;
  background: linear-gradient(135deg, #1f5c7e 0%, #7b9fb3 100%);
  border-top: 1px solid rgba(255,255,255,0.12);
  animation: slideUp 0.7s ease both;
}
.footer-center {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-logo {
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
}

/* ── Alerta de totem ────────────────────────── */
.totem-alert {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  padding: 20px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
}

/* ── Animações ──────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes pulseBtn {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(31,92,126,0.55), inset 0 1px 0 rgba(255,255,255,0.15);
  }
  50% {
    box-shadow: 0 12px 52px rgba(114,193,189,0.70), 0 0 0 14px rgba(114,193,189,0.12), inset 0 1px 0 rgba(255,255,255,0.15);
  }
}

body.page-exit {
  animation: pageExit 0.45s ease forwards;
  pointer-events: none;
}
@keyframes pageExit {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.06); }
}