:root {
  --verde: #a6e100;
  --verde-escuro: #7cb800;
  --preto: #0a0a0a;
  --cinza: #1c1c1c;
  --cinza-claro: #2c2c2c;
  --branco: #f5f5f5;
  --vermelho: #ff4d4d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--preto);
  color: var(--branco);
  min-height: 100vh;
  padding-top: env(safe-area-inset-top); /* evita conteúdo entrar embaixo da hora/status bar no iPhone */
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 100px;
  min-height: 100vh;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
}
.brand img.logo-mark {
  width: 92px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(166,225,0,0.75)) drop-shadow(0 0 22px rgba(166,225,0,0.35));
}

h2 { color: var(--branco); font-size: 18px; margin: 0 0 16px; }

.card {
  background: var(--cinza);
  border: 1px solid var(--cinza-claro);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 13px;
  color: #aaa;
  margin: 12px 0 6px;
}

input[type=text], input[type=tel], input[type=password] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--cinza-claro);
  background: #141414;
  color: var(--branco);
  font-size: 15px;
}
input:focus { outline: 2px solid var(--verde); }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 14px;
  text-decoration: none;
}
.btn-primary { background: var(--verde); color: #0a0a0a; }
.btn-primary:active { background: var(--verde-escuro); }
.btn-secondary { background: var(--cinza-claro); color: var(--branco); }
.btn-danger { background: var(--vermelho); color: #fff; }
.btn-link { background: transparent; color: var(--verde); text-decoration: underline; }

.door-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cinza);
  border: 1px solid var(--cinza-claro);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.door-item .status {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.status.online { background: var(--verde); }
.status.offline { background: #666; }
.door-name { font-weight: 700; font-size: 16px; }
.door-meta { font-size: 12px; color: #999; margin-top: 4px; }

.open-btn {
  background: var(--verde);
  color: #0a0a0a;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
}

.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #111;
  border-top: 1px solid var(--cinza-claro);
  display: flex;
  justify-content: center;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.tabbar a {
  color: #888;
  text-decoration: none;
  padding: 8px 20px;
  font-size: 13px;
}
.tabbar a.active { color: var(--verde); font-weight: 700; }

.error { color: var(--vermelho); font-size: 13px; margin-top: 8px; }
.hint { color: #888; font-size: 12px; margin-top: 6px; }

/* Tela de chamada (visitante) */
.call-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.pulse {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(166,225,0,0.25), transparent 70%);
  display: flex; align-items: center; justify-content: center;
  animation: pulse 1.6s infinite;
  margin-bottom: 24px;
}
.pulse img {
  width: 78px; height: auto;
  filter: drop-shadow(0 0 10px rgba(166,225,0,0.85)) drop-shadow(0 0 24px rgba(166,225,0,0.45));
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(166,225,0,0.35); }
  70% { box-shadow: 0 0 0 30px rgba(166,225,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(166,225,0,0); }
}

.qr-box {
  background: #fff;
  padding: 14px;
  border-radius: 14px;
  display: inline-block;
  margin-top: 10px;
  position: relative;
}
.qr-logo-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px #fff;
}
.qr-logo-overlay img {
  width: 36px; height: auto;
  filter: drop-shadow(0 0 6px rgba(166,225,0,0.9)) drop-shadow(0 0 14px rgba(166,225,0,0.5));
}

/* Banner de chamada — fixo, aparece por cima de QUALQUER tela do app */
.global-ring-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  background: linear-gradient(180deg, #0a0a0a 80%, rgba(10,10,10,0.95));
  border-bottom: 2px solid var(--verde);
}
.global-ring-banner .ring-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.global-ring-banner .ring-text { font-weight: 700; font-size: 15px; }
.global-ring-banner .ring-text small { display: block; font-weight: 400; color: #aaa; font-size: 12px; }
.global-ring-banner a.btn {
  margin: 0;
  padding: 10px 16px;
  width: auto;
  white-space: nowrap;
}

.copy-row {
  display: flex; gap: 8px; align-items: center;
  background: #141414; border: 1px solid var(--cinza-claro);
  border-radius: 10px; padding: 10px 12px; font-size: 13px;
  word-break: break-all;
}
