/* ============================================
   ACAASHA - Design System (Dark + Light Mode)
   ============================================ */

:root {
  /* Dark Mode (default) */
  --bg-primary: #4E5444;
  --bg-secondary: #454b3c;
  --bg-card: #565c4c;
  --text-primary: #EAEAD0;
  --text-secondary: #DCDCDC;
  --text-muted: #a8a89a;
  --accent: #8B6D4C;
  --accent-hover: #9d7d5a;
  --accent-light: #a88b66;
  --input-bg: #454b3c;
  --input-border: rgba(234, 234, 208, 0.2);
  --link: #DCDCDC;
  --link-underline: rgba(220, 220, 220, 0.6);
  --bar-auto: #b87333;
  --bar-carencia: #5a9a8a;
  --bar-controle: #a08060;
  --bar-desvalorizacao: #7a7a70;
  --bar-desconexao: #5a5a52;
  --shadow: rgba(0, 0, 0, 0.25);
  --texture: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

[data-theme="light"] {
  --bg-primary: #e8e6df;
  --bg-secondary: #d4d2c8;
  --bg-card: #dfddd4;
  --text-primary: #2a2a24;
  --text-secondary: #3a3a32;
  --text-muted: #5a5a50;
  --accent: #7a5a3a;
  --accent-hover: #8b6d4c;
  --accent-light: #9d7d5a;
  --input-bg: #e0ded6;
  --input-border: rgba(42, 42, 36, 0.15);
  --link: #4a4a40;
  --link-underline: rgba(74, 74, 64, 0.5);
  --bar-auto: #a06028;
  --bar-carencia: #4a8a7a;
  --bar-controle: #8a7048;
  --bar-desvalorizacao: #6a6a60;
  --bar-desconexao: #5a5a50;
  --shadow: rgba(0, 0, 0, 0.08);
  --texture: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
}

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

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background-image: var(--texture);
}

/* ========== Views (screens) ========== */
.view {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  padding-bottom: calc(env(safe-area-inset-bottom) + 1rem);
}

.view.active {
  display: flex;
  flex-direction: column;
}

/* ========== Logo & branding ========== */
.logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

/* Logo 1600x300px: proporção mantida, largura máxima em telas pequenas */
.logo-img {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.logo-dark {
  display: block;
}

.logo-light {
  display: none;
}

[data-theme="light"] .logo-dark {
  display: none;
}

[data-theme="light"] .logo-light {
  display: block;
}

.tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
}

/* ========== Welcome screen ========== */
.view-welcome {
  justify-content: flex-start;
  padding: 2rem 1.5rem 2rem;
}

.view-welcome .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 24rem;
  margin: 0 auto;
  width: 100%;
}

.view-welcome h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.view-welcome .subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.view-welcome .hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Input */
.input-group {
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.input-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139, 109, 76, 0.2);
}

/* Button primary */
.btn-primary {
  width: 100%;
  padding: 0.95rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--accent-light) 0%, var(--accent) 50%, #7a5d40 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Links block */
.links-block {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.links-block a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--link-underline);
}

.links-block a:hover {
  text-decoration-color: var(--accent);
}

.footer-note {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* ========== Password screen ========== */
.view-password {
  justify-content: flex-start;
  padding: 2rem 1.5rem 2rem;
}

.view-password .content {
  flex: 1;
  max-width: 24rem;
  margin: 0 auto;
  width: 100%;
}

.view-password h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.view-password .instruction {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 2.75rem;
}

.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle-password:hover {
  color: var(--text-primary);
}

.btn-toggle-password svg {
  width: 1.25rem;
  height: 1.25rem;
}

.requirements {
  margin: 1.25rem 0 1.5rem;
  padding: 0 0.1rem;
}

.requirements h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.requirement-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.requirement-item .check {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.requirement-item.valid .check {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 0.6rem;
  background-position: center;
  background-repeat: no-repeat;
}

.security-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1.5rem;
}

/* ========== Home / Main screen ========== */
.view-home .scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 1rem;
  padding-bottom: 5rem;
}

.view-home .page-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: left;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px var(--shadow);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
}

/* Emotional map bars */
.emotion-item {
  margin-bottom: 0.75rem;
}

.emotion-item:last-child {
  margin-bottom: 0;
}

.emotion-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.emotion-bar-wrap {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.emotion-bar {
  height: 100%;
  border-radius: 4px;
  transform-origin: left;
}

.emotion-bar.auto { background: var(--bar-auto); }
.emotion-bar.carencia { background: var(--bar-carencia); }
.emotion-bar.controle { background: var(--bar-controle); }
.emotion-bar.desvalorizacao { background: var(--bar-desvalorizacao); }
.emotion-bar.desconexao { background: var(--bar-desconexao); }

/* Estado inicial: barras em zero na tela Hoje (antes da animação) */
.view-home .card-mapa-emocional .emotion-bar {
  transform: scaleX(0);
}

/* Animação do Mapa Emocional ao abrir a tela Hoje */
@keyframes mapa-bar-grow {
  from {
    transform: scaleX(0);
    opacity: 0.6;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes mapa-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-home.animate-map .card-mapa-emocional {
  animation: mapa-card-in 0.4s ease-out forwards;
}

.view-home.animate-map .card-mapa-emocional .emotion-bar {
  animation: mapa-bar-grow 0.6s ease-out forwards;
}

.view-home.animate-map .card-mapa-emocional .emotion-item:nth-child(1) .emotion-bar { animation-delay: 0.15s; }
.view-home.animate-map .card-mapa-emocional .emotion-item:nth-child(2) .emotion-bar { animation-delay: 0.22s; }
.view-home.animate-map .card-mapa-emocional .emotion-item:nth-child(3) .emotion-bar { animation-delay: 0.29s; }
.view-home.animate-map .card-mapa-emocional .emotion-item:nth-child(4) .emotion-bar { animation-delay: 0.36s; }
.view-home.animate-map .card-mapa-emocional .emotion-item:nth-child(5) .emotion-bar { animation-delay: 0.43s; }

/* Insight card */
.insight-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.insight-text strong {
  color: var(--text-primary);
}

/* Meditation card */
.meditation-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.meditation-icon {
  width: 2.5rem;
  height: 2.5rem;
  fill: none;
  stroke: currentColor;
  color: var(--text-primary);
  opacity: 0.9;
  flex-shrink: 0;
}

.meditation-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.meditation-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-light) 0%, var(--accent) 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform 0.15s;
}

.btn-secondary:hover {
  transform: translateY(-1px);
}

.btn-secondary svg {
  width: 1rem;
  height: 1rem;
}

/* Caixa de digitação sempre fixa acima do menu e acima de todo o conteúdo */
.feeling-area {
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  padding: 0 1rem 0.75rem;
  padding-left: calc(1rem + env(safe-area-inset-left));
  padding-right: calc(1rem + env(safe-area-inset-right));
  background: linear-gradient(to top, var(--bg-primary) 70%, transparent);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.feeling-area.visible {
  opacity: 1;
  pointer-events: auto;
  height: 72px;
  overflow: visible;
  transition: none;
  /* mantém position: fixed do .feeling-area – caixa sempre fixa acima do menu */
}

/* Expandir/recolher NÃO altera a área nem o campo de digitação – só o histórico surge ou some acima */
.feeling-area.visible.expanded {
  /* altura e layout da área continuam iguais; nada muda no campo */
}

/* Histórico: posicionado acima do campo (fora do fluxo), só ele anima */
.feeling-area.visible .feeling-history-wrap {
  position: absolute;
  bottom: calc(100% + 10px);
  left: calc(1rem + env(safe-area-inset-left));
  right: calc(1rem + env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.feeling-area.visible.expanded .feeling-history-wrap {
  max-height: 248px;
  min-height: 0;
  background: rgba(30, 35, 28, 0.38);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  backdrop-filter: blur(8px) saturate(1.1);
  border-radius: 14px;
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .feeling-area.visible.expanded .feeling-history-wrap {
  background: rgba(220, 218, 208, 0.35);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  backdrop-filter: blur(8px) saturate(1.1);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.feeling-area.visible.collapsing .feeling-history-wrap {
  max-height: 0;
}

.feeling-history-wrap {
  display: none;
}

.feeling-history {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Barra de rolagem sempre visível e clicável (Chrome, Edge, Safari) */
.feeling-history::-webkit-scrollbar {
  width: 10px;
}

.feeling-history::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 5px;
  margin: 4px 0;
}

.feeling-history::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 5px;
  min-height: 40px;
}

.feeling-history::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

.feeling-history::-webkit-scrollbar-thumb:active {
  background: var(--accent-hover);
}

/* Firefox: barra visível */
.feeling-history {
  scrollbar-width: auto;
  scrollbar-color: var(--accent) rgba(0, 0, 0, 0.2);
}

.feeling-history-msg {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  line-height: 1.4;
  max-width: 90%;
}

.feeling-history-msg.user {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
}

.feeling-history-msg.assistant {
  background: #B7B7A4;
  color: #2a2a24;
}

[data-theme="light"] .feeling-history-msg.assistant {
  background: #B7B7A4;
  color: #2a2a24;
}

.feeling-history-msg.pending {
  opacity: 0.8;
  font-style: italic;
}

/* Caixa de digitação: mesmo estilo sempre (expandido ou não), sem transição nem animação */
.feeling-area .feeling-input-wrap {
  flex-shrink: 0;
  transition: none;
}

.feeling-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
}

.feeling-input-wrap input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.feeling-input-wrap input::placeholder {
  color: var(--text-muted);
}

.feeling-input-wrap input:focus {
  outline: none;
}

.feeling-input-wrap .btn-feeling-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feeling-input-wrap .btn-feeling-toggle:hover {
  color: var(--accent);
}

.feeling-input-wrap .btn-feeling-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.feeling-input-wrap .btn-feeling-toggle .icon-collapse {
  display: none;
}

.feeling-area.expanded .feeling-input-wrap .btn-feeling-toggle .icon-expand {
  display: none;
}

.feeling-area.expanded .feeling-input-wrap .btn-feeling-toggle .icon-collapse {
  display: block;
}

.feeling-input-wrap .btn-mic {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
}

.feeling-input-wrap .btn-mic:hover {
  color: var(--accent);
}

.feeling-input-wrap .btn-mic svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Bottom tab bar */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-primary);
  border-top: 1px solid var(--input-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.35rem 0.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s;
}

.tab-item:focus {
  outline: none;
}

.tab-item:hover {
  color: var(--text-secondary);
}

.tab-item.active {
  color: var(--accent);
}

.tab-item svg {
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
}

.tab-sep {
  flex: 0 0 1px;
  width: 1px;
  height: 1.5rem;
  background: var(--text-muted);
  opacity: 0.5;
  align-self: center;
}

/* ========== Práticas (lista de práticas) ========== */
.view-praticas {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.view-praticas.active {
  display: flex;
}

.praticas-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 5rem;
}

.praticas-intro {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: left;
  margin-bottom: 1.25rem;
  line-height: 1.45;
  padding: 0;
}

.praticas-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pratica-card {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

/* Animação ao abrir a página Práticas: cards surgem suavemente */
@keyframes pratica-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-praticas .pratica-card {
  opacity: 0;
}

.view-praticas.animate-praticas .pratica-card {
  animation: pratica-card-in 0.45s ease-out forwards;
}

.view-praticas.animate-praticas .praticas-list .pratica-card:nth-child(1) { animation-delay: 0.06s; }
.view-praticas.animate-praticas .praticas-list .pratica-card:nth-child(2) { animation-delay: 0.12s; }
.view-praticas.animate-praticas .praticas-list .pratica-card:nth-child(3) { animation-delay: 0.18s; }
.view-praticas.animate-praticas .praticas-list .pratica-card:nth-child(4) { animation-delay: 0.24s; }
.view-praticas.animate-praticas .praticas-list .pratica-card:nth-child(5) { animation-delay: 0.30s; }
.view-praticas.animate-praticas .praticas-list .pratica-card:nth-child(6) { animation-delay: 0.36s; }

.pratica-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.pratica-card:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.pratica-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.pratica-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.pratica-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========== Apoio – profissionais para contato ========== */
.view-apoio {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.view-apoio.active {
  display: flex;
}

.apoio-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 5rem;
}

.view-ajustes .scroll-area.ajustes-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 5rem;
}

.view-ajustes .page-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.apoio-intro {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: left;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.apoio-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.apoio-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

/* Animação ao abrir a página Apoio: cards surgem suavemente */
@keyframes apoio-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-apoio .apoio-card {
  opacity: 0;
}

.view-apoio.animate-apoio .apoio-card {
  animation: apoio-card-in 0.45s ease-out forwards;
}

.view-apoio.animate-apoio .apoio-list .apoio-card:nth-child(1) { animation-delay: 0.06s; }
.view-apoio.animate-apoio .apoio-list .apoio-card:nth-child(2) { animation-delay: 0.12s; }
.view-apoio.animate-apoio .apoio-list .apoio-card:nth-child(3) { animation-delay: 0.18s; }
.view-apoio.animate-apoio .apoio-list .apoio-card:nth-child(4) { animation-delay: 0.24s; }
.view-apoio.animate-apoio .apoio-list .apoio-card:nth-child(5) { animation-delay: 0.30s; }
.view-apoio.animate-apoio .apoio-list .apoio-card:nth-child(6) { animation-delay: 0.36s; }
.view-apoio.animate-apoio .apoio-list .apoio-card:nth-child(7) { animation-delay: 0.42s; }
.view-apoio.animate-apoio .apoio-list .apoio-card:nth-child(8) { animation-delay: 0.48s; }

.apoio-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.apoio-card-foto {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.apoio-card-info {
  flex: 1;
  min-width: 0;
}

.apoio-card-nome {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.apoio-card-especialidade {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.btn-agendar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-light) 0%, var(--accent) 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 6px var(--shadow);
}

.btn-agendar:hover {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px var(--shadow);
}

.btn-agendar:active {
  transform: translateY(0);
}

/* ========== Placeholder pages ========== */
.view-placeholder {
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
}

.view-placeholder h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.view-placeholder p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Ajustes: theme toggle */
.settings-list {
  max-width: 24rem;
  margin: 0 auto;
  width: 100%;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--input-border);
}

.settings-item label {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle {
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-primary);
  top: 1px;
  left: 2px;
  transition: transform 0.2s;
}


.toggle.active {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle.active::after {
  transform: translateX(22px);
}

.toggle-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Back button (on secondary screens) */
.btn-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.25rem 0;
}

.btn-back:hover {
  color: var(--accent);
}

.btn-back svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
