/* ============================================
   DESIGN SYSTEM - Escuta SUS APS
   Prefeitura de Salvador
   ============================================ */

/* --- Reset de viewport (evita faixa clara acima do header por margem padrão / colapso) --- */
html {
  margin: 0;
  padding: 0;
  /* Mesma cor do início do gradiente .bg-page; se houver 1px de gap, não aparece branco do UA */
  background-color: #e4eefb;
}

body {
  margin: 0;
  padding: 0;
}

/* --- Custom Font --- */
* {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  box-sizing: border-box;
}

/* --- CSS Variables (Design Tokens) --- */
:root {
  --azul-900: #0d3b6e;
  --azul-800: #14508c;
  --azul-700: #1a5fb4;
  --azul-600: #1e6dc7;
  --azul-500: #2563eb;
  --azul-400: #3b82f6;
  --azul-100: #dbeafe;
  --azul-50: #eff6ff;
  --cinza-50: #f8fafc;
  --cinza-100: #f1f5f9;
  --cinza-200: #e2e8f0;
  --cinza-300: #cbd5e1;
  --cinza-400: #94a3b8;
  --cinza-500: #64748b;
  --cinza-600: #475569;
  --cinza-700: #334155;
  --cinza-800: #1e293b;
  --sombra-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --sombra-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

/* --- Background da Página --- */

.animacao-bg {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-image: url("Assets/background-Azul-Gradiente.png");
  background-size: 200% 200%;
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: moveBackgroundSeamless 95s linear infinite;
  flex-direction: column;
}

@keyframes moveBackgroundSeamless {
  0% {
    background-position: 0% 0%;
  }

  50% {
    background-position: 100% 100%;
  }

  100% {
    background-position: 0% 0%;
  }
}

.bg-page {
  background:
    radial-gradient(
      ellipse at 15% 10%,
      rgba(219, 234, 254, 0.6) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 85% 20%,
      rgba(191, 219, 254, 0.4) 0%,
      transparent 45%
    ),
    radial-gradient(
      ellipse at 50% 80%,
      rgba(219, 234, 254, 0.3) 0%,
      transparent 50%
    ),
    linear-gradient(
      180deg,
      #e4eefb 0%,
      #edf2f9 15%,
      #f4f7fb 40%,
      #f8fafc 70%,
      #ffffff 100%
    );
  position: relative;
  overflow-x: hidden;
}

/* --- Background Decorativo --- */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Gradient blobs (soft light spots) */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.bg-blob-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  left: -100px;
  background: radial-gradient(
    circle,
    rgba(147, 197, 253, 0.35) 0%,
    transparent 70%
  );
}

.bg-blob-2 {
  width: 350px;
  height: 350px;
  top: 30%;
  right: -80px;
  background: radial-gradient(
    circle,
    rgba(191, 219, 254, 0.3) 0%,
    transparent 70%
  );
}

.bg-blob-3 {
  width: 300px;
  height: 300px;
  bottom: 5%;
  left: -60px;
  background: radial-gradient(
    circle,
    rgba(147, 197, 253, 0.25) 0%,
    transparent 70%
  );
}

/* --- Healthcare Illustrations --- */
.bg-illust {
  position: absolute;
  opacity: 0.55;
  filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.08));
}

/* Stethoscope - top left */
.bg-illust-stethoscope {
  width: 110px;
  height: 110px;
  top: 8%;
  left: 2%;
  transform: rotate(-12deg);
  opacity: 0.45;
}

/* Heart with pulse - top right */
.bg-illust-heart {
  width: 100px;
  height: 100px;
  top: 5%;
  right: 3%;
  transform: rotate(8deg);
  opacity: 0.5;
}

/* Clipboard - right middle */
.bg-illust-clipboard {
  width: 90px;
  height: 110px;
  top: 35%;
  right: 1.5%;
  transform: rotate(5deg);
  opacity: 0.45;
}

/* First aid kit - bottom left */
.bg-illust-firstaid {
  width: 100px;
  height: 100px;
  bottom: 18%;
  left: 1.5%;
  transform: rotate(-5deg);
  opacity: 0.45;
}

/* Stars - upper right */
.bg-illust-stars {
  width: 140px;
  height: 55px;
  top: 22%;
  right: 1%;
  transform: rotate(-3deg);
  opacity: 0.4;
}

/* Syringe - left middle */
.bg-illust-syringe {
  width: 48px;
  height: 130px;
  top: 38%;
  left: 4%;
  transform: rotate(20deg);
  opacity: 0.4;
}

/* Shield - bottom right */
.bg-illust-shield {
  width: 85px;
  height: 105px;
  bottom: 8%;
  right: 3%;
  transform: rotate(3deg);
  opacity: 0.4;
}

/* Pill - floating center-left */
.bg-illust-pill {
  width: 70px;
  height: 35px;
  bottom: 40%;
  left: 2%;
  transform: rotate(-25deg);
  opacity: 0.4;
}

/* Floating bubbles */
.bg-bubble {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(147, 197, 253, 0.3);
  background: rgba(219, 234, 254, 0.15);
}

.bg-bubble-1 {
  width: 20px;
  height: 20px;
  top: 15%;
  left: 15%;
}

.bg-bubble-2 {
  width: 14px;
  height: 14px;
  top: 50%;
  right: 12%;
}

.bg-bubble-3 {
  width: 24px;
  height: 24px;
  bottom: 30%;
  right: 8%;
}

.bg-bubble-4 {
  width: 10px;
  height: 10px;
  top: 70%;
  left: 10%;
}

.bg-bubble-5 {
  width: 16px;
  height: 16px;
  top: 28%;
  left: 8%;
}

/* Coluna única (header + cards): mesma largura em todos os breakpoints */
.page-col {
  width: 100%;
}

/* --- Header Institucional --- */
.header-institucional {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  /* Largura = 100% da coluna (.page-col), igual aos .card */
  width: 100%;
  min-width: 0;
  align-self: stretch;
  box-sizing: border-box;
  margin-top: 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  flex: 1;
}

.header-feed {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
  padding-right: 10px;
}

.header-feed::before {
  content: "";
  position: absolute;
  right: 110%;
  width: 50px;
  height: 2px;
  border-top: 2px dotted rgba(26, 48, 96, 0.2);
  top: 50%;
}

.emoji {
  font-size: 2.5rem;
  color: #1a3060;
  opacity: 1;
}

.emoji.highlight {
  font-size: 2.8rem;
  filter: grayscale(100%) sepia(100%) hue-rotate(190deg) brightness(0.8);
  opacity: 1;
  position: relative;
  z-index: 2;
}

.pulse-ring {
  position: absolute;
  right: 5px;
  width: 45px;
  height: 45px;
  background: rgba(26, 48, 96, 0.1);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(26, 48, 96, 0.2);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 15px rgba(26, 48, 96, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(26, 48, 96, 0);
  }
}

.header-text h1 {
  margin: 0;
  font-size: 2rem;
  color: #1a3060;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.header-text p {
  margin: 2px 0 0 0;
  font-size: 1rem;
  color: #556b8d;
  font-weight: 400;
}

.header-logo {
  height: 70px;
  width: auto;
  color: #1a3060;
}

.header-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.header-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  line-height: 1.3;
}

/* --- Hero Section --- */
.hero-section {
  background: linear-gradient(
    180deg,
    rgba(26, 95, 180, 0.06) 0%,
    transparent 100%
  );
  padding: 20px 0 8px;
  position: relative;
  z-index: 10;
}

.hero-message {
  font-size: 0.875rem;
  color: var(--cinza-500);
  font-weight: 400;
  line-height: 1.5;
}

/* --- Cards --- */
.card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  overflow: hidden;
  position: relative;
  margin-bottom: 25px;
  width: 100%;
  min-width: 0;
  align-self: stretch;
}

.card-body {
  padding: 25px 21px;
  width: 100%;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 25px;
  width: 100%;
  background: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(26, 48, 96, 0.1);
}

.card-icon {
  background: #e3eaff;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #1a3060;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.card-icon--health {
  background: #f0fdf4;
  color: #16a34a;
}

.card-icon--comment {
  background: #fefce8;
  color: #ca8a04;
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a3060;
  letter-spacing: -0.3px;
}

/* --- Form Fields --- */
.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cinza-700);
  margin-bottom: 6px;
}

.field-select {
  width: 100%;
  border: 1px solid var(--cinza-200);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--cinza-700);
  background: #ffffff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  appearance: auto;
}

.field-select:focus {
  outline: none;
  border-color: var(--azul-400);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-textarea {
  width: 100%;
  border: 1px solid var(--cinza-200);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--cinza-700);
  resize: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.field-textarea:focus {
  outline: none;
  border-color: var(--azul-400);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-textarea::placeholder {
  color: var(--cinza-400);
}

.field-input {
  width: 100%;
  border: 1px solid var(--cinza-200);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--cinza-700);
  background: #ffffff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.field-input:focus {
  outline: none;
  border-color: var(--azul-400);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-input:disabled {
  background: var(--cinza-100);
  color: var(--cinza-500);
  cursor: not-allowed;
}

.field-input::placeholder {
  color: var(--cinza-400);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--cinza-700);
  cursor: pointer;
  user-select: none;
}

.field-checkbox {
  width: 1rem;
  height: 1rem;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--azul-600);
  cursor: pointer;
}

.pergunta.desabilitada {
  opacity: 0.55;
  pointer-events: none;
}

.pergunta.desabilitada .opcao-radio {
  pointer-events: none;
}

/* --- Question Text --- */
.question-text {
  font-size: 0.875rem;
  color: var(--cinza-700);
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* --- Botões de opção de satisfação --- */
.opcao-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border: 2px solid var(--cinza-200);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  min-width: 80px;
  text-align: center;
  background: var(--cinza-50);
  height: 80px;
}

.opcao-btn:hover {
  border-color: var(--azul-400);
  background: var(--azul-50);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px -2px rgba(37, 99, 235, 0.1);
}

.opcao-btn span.opcao-texto {
  font-size: 0.75rem;
  line-height: 1.1;
  margin-top: 5px;
  display: block;
}

/* Estado selecionado */
input[type="radio"]:checked + .opcao-btn {
  border-color: var(--azul-500);
  background: var(--azul-100);
  box-shadow: 0 0 0 1px var(--azul-500);
}

input[type="radio"]:checked + .opcao-btn .opcao-texto {
  color: var(--azul-800);
  font-weight: 600;
}

/* Tamanho do emoji */
.opcao-btn::first-line {
  font-size: 1.5rem;
}

/* Escala responsiva */
.escala-satisfacao {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap;
}

/* --- Submit Button --- */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  background: #00a53d;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 14px 32px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26, 95, 180, 0.25);
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
}

.btn-submit:hover {
  background: #0e682f;
  box-shadow: 0 4px 12px rgba(26, 95, 180, 0.35);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(26, 95, 180, 0.2);
}

.btn-submit:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.3),
    0 2px 8px rgba(26, 95, 180, 0.25);
}

/* --- Loading spinner do botão --- */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Animação de entrada da mensagem de sucesso --- */
#mensagem-sucesso:not(.hidden) {
  animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Borda de erro no pergunta --- */
.pergunta.erro .escala-satisfacao {
  border: 1px solid #fca5a5;
  border-radius: 12px;
  padding: 4px;
}

/* --- Dropdown customizado de equipes --- */
/* Quando o dropdown abre, o card precisa ficar acima dos demais e sem recorte do painel. */
.card.card-com-dropdown-open {
  z-index: 40;
  overflow: visible;
}

.equipe-panel {
  z-index: 45;
}

.equipe-item {
  background-color: var(--equipe-bg, #f9fafb);
  color: var(--cinza-700);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.equipe-item:hover,
.equipe-item:focus {
  background-color: var(--equipe-bg-hover, #f3f4f6) !important;
  outline: none;
}

#equipe-wrap.equipe-open .equipe-trigger-chevron {
  transform: rotate(-180deg);
}

.equipe-trigger-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}

.equipe-trigger {
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

/* --- Footer Institucional --- */
.footer-institucional {
  padding: 20px 24px;
  position: relative;
  z-index: 10;
}

.footer-content {
  max-width: 672px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.footer-logo {
  height: 60px;
  width: auto;
  margin-top: -57px;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--cinza-400);
}

/* ============================================
   RESPONSIVO
   ============================================ */

/* Large screens: illustrations more visible */
@media (min-width: 1200px) {
  .bg-illust-stethoscope {
    width: 140px;
    height: 140px;
    left: 4%;
    opacity: 0.55;
  }
  .bg-illust-heart {
    width: 130px;
    height: 130px;
    right: 5%;
    opacity: 0.55;
  }
  .bg-illust-clipboard {
    width: 110px;
    height: 135px;
    right: 4%;
    opacity: 0.5;
  }
  .bg-illust-firstaid {
    width: 120px;
    height: 120px;
    left: 3%;
    opacity: 0.5;
  }
  .bg-illust-stars {
    width: 170px;
    height: 65px;
    opacity: 0.45;
  }
  .bg-illust-syringe {
    width: 55px;
    height: 150px;
    left: 6%;
    opacity: 0.45;
  }
  .bg-illust-shield {
    width: 100px;
    height: 125px;
    right: 5%;
    opacity: 0.45;
  }
  .bg-illust-pill {
    width: 80px;
    height: 40px;
    opacity: 0.45;
  }
}

@media (max-width: 1024px) {
  .bg-illust {
    opacity: 0.3;
  }
}

@media (max-width: 768px) {
  .bg-illust {
    opacity: 0.2;
  }
  .bg-bubble {
    display: none;
  }
}

@media (max-width: 640px) {
  .header-content {
    gap: 12px;
  }

  .header-logo {
    height: 42px;
  }

  .header-left {
    gap: 10px;
  }

  .header-feed {
    gap: 8px;
    padding-right: 4px;
  }

  .header-feed::before {
    width: 24px;
    right: 104%;
  }

  .emoji {
    font-size: 1.35rem;
  }

  .emoji.highlight {
    font-size: 1.55rem;
  }

  .pulse-ring {
    width: 30px;
    height: 30px;
    right: 0;
  }

  .header-text h1 {
    font-size: 1.05rem;
    line-height: 1.2;
  }

  .header-text p {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .card {
    padding: 18px;
    border-radius: 10px;
  }

  .header-institucional {
    padding: 18px;
    border-radius: 10px;
  }

  .footer-logo {
    margin-top: 0;
    height: 44px;
  }

  /* Hide illustrations on mobile to avoid clutter */
  .bg-illust {
    display: none;
  }

  .bg-blob {
    opacity: 0.5;
  }
}

@media (max-width: 480px) {
  /* Header: evita overflow horizontal; emojis em linha abaixo, como o conteúdo dos cards quebra */
  .header-content {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 10px;
  }

  .header-left {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-feed {
    flex: 1 1 auto;
    justify-content: center;
    width: 100%;
    padding-right: 0;
  }

  .escala-satisfacao {
    gap: 6px;
  }

  .opcao-btn {
    min-width: 56px;
    padding: 8px 6px;
    font-size: 1.25rem;
  }

  .opcao-btn span.opcao-texto {
    font-size: 0.55rem;
  }

  .header-institucional {
    padding: 16px;
    border-radius: 10px;
  }

  .header-logo {
    height: 32px;
  }

  .header-divider {
    height: 24px;
  }

  .header-feed {
    gap: 6px;
    padding-right: 2px;
  }

  .header-feed::before {
    display: none;
  }

  .header-feed .emoji:not(.highlight) {
    display: none;
  }

  .emoji.highlight {
    font-size: 1.45rem;
  }

  .pulse-ring {
    width: 28px;
    height: 28px;
  }

  .header-text h1 {
    font-size: 0.95rem;
    line-height: 1.2;
  }

  .header-text p {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .card {
    padding: 16px;
  }

  .card-header {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .card-title {
    font-size: 1.05rem;
    line-height: 1.3;
  }

  .field-select,
  .field-input,
  .field-textarea {
    font-size: 16px;
  }

  .btn-submit {
    width: 100%;
    max-width: none;
  }
}
