:root {
  --bg-space: #05080f;
  --bg-deep: #0b1626;
  --surface-1: #15263d;
  --surface-2: #1a2e48;
  --surface-3: #22405f;
  --brand-primary: #3f6f93;
  --brand-hover: #4e83ac;
  --accent-ring: #7fb0cc;
  --accent-light: #9fd0ec;
  --border-subtle: rgba(120, 170, 210, 0.14);
  --text-primary: #e7f1f9;
  --text-secondary: #aac6da;
  --text-muted: #5b7e98;
  --success: #6fd08a;
  --warning: #d9a857;
  --danger: #d27878;
  --info: #8cc8eb;
}

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

html, body {
  min-height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(1200px 800px at 50% 38%, #0e1b2e 0%, #070b14 60%, #04060c 100%);
  color: var(--text-primary);
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.shell {
  width: 100%;
  max-width: 1024px;
  min-height: 100dvh;
  max-height: 820px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(900px 700px at 50% 42%, var(--surface-1) 0%, var(--bg-deep) 55%, #070d18 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.titlebar {
  height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(26, 46, 72, 0.95), rgba(16, 30, 50, 0.95));
  border-bottom: 1px solid var(--border-subtle);
}

.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.titlebar-brand .orb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--accent-ring), #1f4a6b 70%);
  box-shadow: 0 0 10px rgba(127, 176, 204, 0.6);
}

.titlebar h1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #cfe3f2;
}

.titlebar-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.titlebar a {
  color: var(--accent-light);
  text-decoration: none;
  font-size: 12px;
}

.titlebar a:hover { text-decoration: underline; }

.titlebar-links a:first-child {
  color: #7ec8e3;
  font-weight: 600;
}

.stage {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.orbit-path {
  position: absolute;
  border-radius: 50%;
  border: 1.5px dashed rgba(127, 176, 204, 0.3);
  animation: pulseGlow 5s ease-in-out infinite;
}

.orbit-path.inner {
  border: 1px solid rgba(127, 176, 204, 0.1);
  animation: none;
}

.globe {
  position: absolute;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 12px 32px rgba(0, 20, 60, 0.7)) drop-shadow(0 0 24px rgba(63, 111, 147, 0.4));
  animation: globeFloat 6s ease-in-out infinite;
  pointer-events: none;
}

.globe img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

@keyframes globeFloat {
  0%, 100% { filter: drop-shadow(0 12px 32px rgba(0, 20, 60, 0.7)) drop-shadow(0 0 24px rgba(63, 111, 147, 0.4)); transform: translate(-50%, -50%) translateY(0px); }
  50% { filter: drop-shadow(0 20px 40px rgba(0, 20, 60, 0.5)) drop-shadow(0 0 36px rgba(100, 180, 220, 0.5)); transform: translate(-50%, -50%) translateY(-8px); }
}

.orbit-hint {
  position: absolute;
  left: 14px;
  bottom: 12px;
  color: var(--accent-ring);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  pointer-events: none;
}

.app-pill {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(127, 176, 204, 0.45);
  background: linear-gradient(180deg, rgba(22, 42, 66, 0.92), rgba(12, 26, 44, 0.92));
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(180, 215, 240, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.app-pill:hover {
  transform: translate(-50%, -50%) scale(1.07);
  border-color: rgba(140, 200, 235, 0.95);
  box-shadow: 0 12px 30px rgba(40, 110, 160, 0.5), inset 0 1px 0 rgba(180, 215, 240, 0.2);
}

.app-pill.dev {
  border-color: rgba(217, 168, 87, 0.55);
  color: #f0d9a8;
}

.app-pill.docs {
  border-color: rgba(126, 200, 227, 0.65);
  color: #b8e4f4;
}

.app-pill.docs:hover {
  border-color: rgba(126, 200, 227, 1);
  box-shadow: 0 12px 30px rgba(30, 120, 180, 0.5), inset 0 1px 0 rgba(180, 215, 240, 0.2);
}

.statusbar {
  height: 48px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: rgba(8, 16, 28, 0.85);
  border-top: 1px solid var(--border-subtle);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 8px var(--brand-primary);
}

.status-text {
  color: var(--text-secondary);
  font-size: 13px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.footer-dev {
  height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(5, 8, 15, 0.9);
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.footer-dev a {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 600;
}

.footer-dev a:hover { text-decoration: underline; }
.footer-sep { color: var(--border-subtle); margin: 0 2px; }
.footer-version { font-family: var(--mono, monospace); font-size: 10px; color: var(--text-muted); letter-spacing: 0.04em; opacity: .7; }

/* Botão de instalação PWA */
#pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--accent-ring);
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s;
  margin-right: 8px;
}
#pwa-install-btn:hover {
  background: var(--accent-ring);
  color: #fff;
}

/* Subpages (CTI, URA, etc.) */
.page-wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.page-card {
  background: rgba(16, 30, 50, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.page-card h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.page-card p, .page-card li {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.metric {
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}

.metric .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric .value {
  font-size: 15px;
  font-weight: 600;
  font-family: ui-monospace, Consolas, monospace;
}

.metric.ok .value { color: var(--success); }
.metric.warn .value { color: var(--warning); }
.metric.err .value { color: var(--danger); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent-ring);
  background: var(--brand-primary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  margin-top: 12px;
  margin-right: 8px;
}

.btn:hover { background: var(--brand-hover); }
.btn.secondary {
  background: var(--surface-2);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.badge-dev {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(217, 168, 87, 0.2);
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (max-width: 560px) {
  .app-pill { font-size: 13px; padding: 9px 14px; }
}
