@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700;800&family=Barlow:wght@500;600;700&display=swap');

:root {
  --peers-blue: #011334;
  --peers-blue-02: #677185;
  --peers-blue-03: #99a1ae;
  --peers-blue-04: #ccd0d6;
  --peers-lime: #e1ff00;
  --peers-lime-02: #f3ff99;
  --peers-serene: #d8e8ee;
  --peers-serene-02: #e8f1f5;
  --peers-white: #ffffff;
  --peers-pink: #ec4899;

  --info-main: #00b8d9;
  --success-main: #22c55e;
  --warning-main: #ffab00;
  --error-main: #ff5630;

  --grey-50: #fcfdfd;
  --grey-100: #f9fafb;
  --grey-200: #f4f6f8;
  --grey-300: #dfe3e8;
  --grey-400: #c4cdd5;
  --grey-500: #919eab;
  --grey-600: #637381;
  --grey-700: #454f5b;
  --grey-800: #1c252e;
  --grey-900: #141a21;

  --font-primary: 'Public Sans', 'Public Sans Variable', sans-serif;
  --font-secondary: 'Barlow', sans-serif;
  --font-brand: 'TG Haido Grotesk', 'Barlow', sans-serif;

  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-md: 0 4px 8px 0 rgba(145, 158, 171, 0.16);
  --shadow-lg: 0 8px 24px 0 rgba(145, 158, 171, 0.16);
  --shadow-xl: 0 16px 40px 0 rgba(145, 158, 171, 0.16);

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  color: var(--grey-800);
  background: var(--grey-100);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.no-scroll {
  height: 100vh;
  overflow: hidden;
}

/* Evita flash de conteúdo até auth-gate.js confirmar o login. */
html.auth-check body {
  display: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Header / Footer compartilhados ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  background: var(--peers-blue);
  border-bottom: 3px solid var(--peers-lime);
  flex-shrink: 0;
  position: sticky;
  /* Fica logo abaixo da tarja de ambiente (.env-banner), quando ela existe
     -- --env-banner-h é medida em JS e cai pra 0px em produção (sem tarja). */
  top: var(--env-banner-h, 0px);
  z-index: 500;
}

/* ---------- Tarja de ambiente (dev/preview) ---------- */

.env-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #ff8a00;
  color: #241300;
  font-family: var(--font-secondary);
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 6px var(--space-3);
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 501;
  flex-shrink: 0;
}

.env-banner__version {
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  opacity: 0.82;
}

/* ---------- Versão em produção (discreta, sem tarja) ---------- */

.prod-version-tag {
  position: fixed;
  right: 10px;
  bottom: 6px;
  z-index: 50;
  font-family: var(--font-primary);
  font-size: 0.64rem;
  color: var(--grey-400);
  background: rgba(255, 255, 255, 0.7);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-header__logo {
  height: 18px;
  width: auto;
}

.site-header__title {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--peers-lime);
  line-height: 1.25;
}

.site-header__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--peers-lime);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(225, 255, 0, 0.5);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.site-header__back:hover {
  background: rgba(225, 255, 0, 0.15);
  border-color: var(--peers-lime);
}

.site-header__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.site-header__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--peers-blue-04);
}

.site-header__gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--peers-lime);
  background: rgba(225, 255, 0, 0.12);
  border: 1px solid rgba(225, 255, 0, 0.3);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.site-header__gear:hover {
  background: rgba(225, 255, 0, 0.22);
  border-color: var(--peers-lime);
}

.site-header__logout {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--peers-blue);
  background: var(--peers-lime);
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.site-footer {
  margin-top: auto;
  padding: var(--space-3) var(--space-6);
  text-align: center;
  font-size: 0.78rem;
  color: var(--peers-blue-03);
  background: var(--peers-blue);
  flex-shrink: 0;
}

/* ---------- Tela de acesso não liberado (auth-gate.js) ---------- */

.auth-denied {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grey-100);
  padding: var(--space-4);
  box-sizing: border-box;
}

.auth-denied__box {
  background: var(--peers-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  max-width: 440px;
  text-align: center;
}

.auth-denied__box h1 {
  font-family: var(--font-secondary);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--peers-blue);
  margin: 0 0 var(--space-2);
}

.auth-denied__box p {
  font-size: 0.9rem;
  color: var(--grey-700);
  line-height: 1.55;
  margin: 0 0 var(--space-2);
}

.auth-denied__box button,
.auth-denied__box .auth-denied__link {
  display: inline-block;
  margin-top: var(--space-2);
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--peers-blue);
  background: var(--peers-lime);
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
}

/* ---------- Conteúdo de página secundária ---------- */

.page-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: var(--space-6) var(--space-3);
}

.page-content {
  width: 100%;
  max-width: 880px;
  background: var(--peers-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
}

.page-content__eyebrow {
  font-family: var(--font-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--info-main);
  margin: 0 0 var(--space-1);
}

.page-content h1 {
  font-family: var(--font-secondary);
  font-size: 2rem;
  color: var(--peers-blue);
  margin: 0 0 var(--space-2);
}

.page-content p.lead {
  font-size: 1.05rem;
  color: var(--grey-700);
  line-height: 1.6;
  margin: 0 0 var(--space-4);
}

.page-content__placeholder {
  border: 1.5px dashed var(--grey-300);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  color: var(--grey-500);
  background: var(--grey-50);
}

.page-content__placeholder strong {
  display: block;
  color: var(--peers-blue);
  font-family: var(--font-secondary);
  font-size: 1rem;
  margin-bottom: 4px;
}
