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

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #fff;
}

body.maisvoz-locked { overflow: hidden; }

.maisvoz-bg {
  min-height: 100%;
  background: linear-gradient(160deg, #0d47a1 0%, #1a73e8 50%, #1565c0 100%);
}

.maisvoz-bg-protector {
  background: linear-gradient(160deg, #1b5e20 0%, #2e7d32 45%, #1b5e20 100%);
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  padding: env(safe-area-inset-top) 1rem env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}

.maisvoz-header { text-align: center; padding: 1.25rem 0 0.75rem; }
.maisvoz-header h1 { font-size: 1.75rem; font-weight: 800; }
.maisvoz-header p { font-size: 0.9rem; opacity: 0.92; margin-top: 0.35rem; }

.nav-cards { display: flex; flex-direction: column; gap: 1rem; flex: 1; justify-content: center; padding: 1rem 0; }

.nav-card {
  display: block;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

.nav-card strong { display: block; font-size: 1.15rem; margin-bottom: 0.35rem; }
.nav-card span { font-size: 0.85rem; opacity: 0.9; }

.nav-card:active { transform: scale(0.98); }
.nav-card-assistant { border-left: 4px solid #ff9100; }
.nav-card-protector { border-left: 4px solid #69f0ae; }
.nav-card-pai { border-left: 4px solid #64b5f6; }

.apk-download {
  display: inline-block;
  background: #2e7d32;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  margin: 0.25rem;
  font-size: 0.88rem;
}
.apk-download-pai { background: #1565c0; }

.settings-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.2);
  margin: 0.75rem 0;
}

.btn-protector-save {
  width: 100%;
  margin-top: 0.75rem;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  background: #fff;
  color: #1b5e20;
}

.btn-protector-secondary {
  width: 100%;
  margin-top: 0.5rem;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  background: #1565c0;
  color: #fff;
}

body.maisvoz-grace [data-maisvoz-muted="1"] {
  pointer-events: none !important;
  opacity: 0.35 !important;
}

.caption-box {
  margin: 1rem 0;
  min-height: 4.5rem;
  background: rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 1rem;
  font-size: 1.05rem;
  line-height: 1.45;
  border: 1px solid rgba(255,255,255,0.2);
}

.mic-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

#micBtn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #ff6d00, #ff9100);
  color: #fff;
  font-size: 3rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

#micBtn.listening { animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.settings {
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.settings label { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.settings input, .settings select {
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
}

.confirm-bar { display: flex; gap: 0.75rem; width: 100%; max-width: 320px; }
.confirm-bar[hidden] { display: none !important; }
.confirm-bar button {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
}

#btnSim { background: #2e7d32; color: #fff; }
#btnNao { background: rgba(255,255,255,0.25); color: #fff; border: 2px solid rgba(255,255,255,0.5); }

.back-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 0.9rem;
}

.protector-status {
  text-align: center;
  padding: 1.5rem;
  background: rgba(0,0,0,0.2);
  border-radius: 16px;
  margin: 1rem 0;
}

.protector-status .shield { font-size: 4rem; }

#log {
  max-height: 90px;
  overflow-y: auto;
  font-size: 0.72rem;
  opacity: 0.85;
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
  padding: 0.5rem;
}

/* Bloqueio de tela */
#protectorLock {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: linear-gradient(180deg, #b71c1c 0%, #7f0000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

#protectorLock[hidden] { display: none !important; }

.lock-panel {
  text-align: center;
  max-width: 360px;
  width: 100%;
}

.lock-panel h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.lock-panel p { margin-bottom: 1.25rem; line-height: 1.5; opacity: 0.95; }

#unlockPin {
  width: 100%;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  padding: 14px;
  border-radius: 12px;
  border: none;
  margin-bottom: 0.75rem;
}

#btnUnlock {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #fff;
  color: #b71c1c;
  font-weight: 700;
  font-size: 1rem;
}

#unlockError { color: #ffcdd2; min-height: 1.2em; margin-top: 0.5rem; font-size: 0.9rem; }

.hints { font-size: 0.78rem; opacity: 0.85; line-height: 1.4; margin-top: 0.5rem; }
