:root {
  --green: #009c3b;
  --green-dark: #067a35;
  --yellow: #ffdf00;
  --blue: #002776;
  --ink: #162033;
  --muted: #617084;
  --surface: #ffffff;
  --surface-soft: #f4f8fb;
  --danger: #b42318;
  --success: #067647;
  --info: #175cd3;
  --border: rgba(22, 32, 51, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 223, 0, 0.24), transparent 24rem),
    radial-gradient(circle at 85% 12%, rgba(0, 39, 118, 0.18), transparent 22rem),
    linear-gradient(135deg, #eaf7ef 0%, #f8fbff 50%, #edf4ff 100%);
}

a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand,
.topnav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  color: var(--ink);
  font-weight: 900;
  line-height: 1.1;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: var(--yellow);
  border: 3px solid var(--green);
}

.topnav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-email {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-button {
  border: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.main-content {
  flex: 1;
  padding-top: 24px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin-top: auto;
  padding: 18px 0 4px;
  color: rgba(97, 112, 132, 0.9);
  font-size: 0.88rem;
  font-weight: 750;
}

.site-footer nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.site-footer a {
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 850;
  opacity: 0.78;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  opacity: 1;
}

.hero,
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 32px;
  align-items: center;
}

.hero {
  min-height: min(620px, calc(100vh - 240px));
}

.hero h1,
.auth-copy h1,
.content-panel h1 {
  max-width: 820px;
  margin: 0;
  color: var(--blue);
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.98;
}

.auth-copy h1,
.content-panel h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.hero p,
.auth-copy p,
.content-panel p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green-dark);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-actions,
.form-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.button-primary {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(0, 156, 59, 0.24);
}

.button-secondary {
  color: var(--blue);
  background: var(--yellow);
}

.full-width {
  width: 100%;
}

.hero-panel,
.auth-card,
.content-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 52px rgba(0, 39, 118, 0.12);
}

.hero-panel {
  padding: 28px;
  transform: rotate(-2deg);
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sticker-grid span {
  display: grid;
  min-height: 130px;
  place-items: center;
  border: 3px solid var(--green);
  border-radius: 8px;
  color: var(--blue);
  background: linear-gradient(145deg, #fffefa, #e8f5ff);
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 950;
}

.auth-card,
.content-panel {
  padding: 24px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.dashboard-hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--blue);
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.album-total {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(0, 39, 118, 0.12);
}

.total-number {
  color: var(--blue);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 950;
  line-height: 1;
}

.total-label {
  color: var(--muted);
  font-weight: 850;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.group-card {
  --group-color: #4f8f49;
  --group-ink: #ffffff;
  overflow: hidden;
  border: 1px solid rgba(22, 32, 51, 0.18);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(22, 32, 51, 0.1);
}

.group-card[data-color="Verde"] { --group-color: #5ba34e; }
.group-card[data-color="Vermelho"] { --group-color: #c83744; }
.group-card[data-color="Amarelo"] { --group-color: #d9d643; --group-ink: #253041; }
.group-card[data-color="Azul"] { --group-color: #263e84; }
.group-card[data-color="Laranja"] { --group-color: #d95d36; }
.group-card[data-color="Verde Escuro"] { --group-color: #1f6355; }
.group-card[data-color="Lilás"] { --group-color: #b8bad7; --group-ink: #253041; }
.group-card[data-color="Turquesa"] { --group-color: #63bab2; --group-ink: #253041; }
.group-card[data-color="Azul Escuro"] { --group-color: #262060; }
.group-card[data-color="Rosa Claro"] { --group-color: #dfa1a5; --group-ink: #253041; }
.group-card[data-color="Magenta"] { --group-color: #9f174d; }
.group-card[data-color="Marrom"] { --group-color: #6e3e3c; }
.group-card[data-color="Dourado"] { --group-color: #caa33a; --group-ink: #253041; }

.group-header {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  color: var(--group-ink);
  background: var(--group-color);
}

.group-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  opacity: 0.82;
  text-transform: uppercase;
}

.group-header h2 {
  margin: 2px 0 0;
  font-size: 2.8rem;
  line-height: 0.9;
}

.group-summary {
  display: grid;
  min-width: 76px;
  justify-items: end;
  font-weight: 900;
}

.group-summary strong {
  font-size: 1.05rem;
}

.team-list {
  display: grid;
}

.team-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 58px;
  border-top: 1px solid rgba(22, 32, 51, 0.12);
}

.team-link {
  color: inherit;
  text-decoration: none;
}

.team-link:hover {
  text-decoration: none;
}

.team-link:hover .team-main,
.team-link:focus-visible .team-main {
  filter: brightness(1.05);
}

.team-link:focus-visible {
  outline: 3px solid rgba(0, 39, 118, 0.28);
  outline-offset: -3px;
}

.team-code {
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(22, 32, 51, 0.12);
  color: var(--ink);
  background: #f6f7f9;
  font-weight: 950;
}

.team-main {
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 10px 12px;
  color: var(--group-ink);
  background: color-mix(in srgb, var(--group-color) 88%, white);
}

.team-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.team-title span {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-title strong {
  flex: 0 0 auto;
  font-size: 0.88rem;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(22, 32, 51, 0.14);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.progress-small {
  height: 7px;
  background: rgba(255, 255, 255, 0.44);
}

.progress-small span {
  background: #ffffff;
}

.sticker-page {
  display: grid;
  gap: 18px;
}

.sticker-hero {
  --group-color: var(--green);
  --group-ink: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 20px;
  align-items: end;
  border-radius: 8px;
  padding: 22px;
  color: var(--group-ink);
  background: var(--group-color);
  box-shadow: 0 18px 42px rgba(0, 39, 118, 0.14);
}

.sticker-hero[data-color="Verde"] { --group-color: #5ba34e; }
.sticker-hero[data-color="Vermelho"] { --group-color: #c83744; }
.sticker-hero[data-color="Amarelo"] { --group-color: #d9d643; --group-ink: #253041; }
.sticker-hero[data-color="Azul"] { --group-color: #263e84; }
.sticker-hero[data-color="Laranja"] { --group-color: #d95d36; }
.sticker-hero[data-color="Verde Escuro"] { --group-color: #1f6355; }
.sticker-hero[data-color="LilÃ¡s"] { --group-color: #b8bad7; --group-ink: #253041; }
.sticker-hero[data-color="Turquesa"] { --group-color: #63bab2; --group-ink: #253041; }
.sticker-hero[data-color="Azul Escuro"] { --group-color: #262060; }
.sticker-hero[data-color="Rosa Claro"] { --group-color: #dfa1a5; --group-ink: #253041; }
.sticker-hero[data-color="Magenta"] { --group-color: #9f174d; }
.sticker-hero[data-color="Marrom"] { --group-color: #6e3e3c; }
.sticker-hero[data-color="Dourado"] { --group-color: #caa33a; --group-ink: #253041; }

.sticker-hero .eyebrow,
.sticker-hero h1 {
  color: currentColor;
}

.sticker-hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: currentColor;
  font-size: 0.9rem;
  font-weight: 900;
  opacity: 0.86;
}

.sticker-total {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.sticker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
}

.sticker-toolbar div {
  display: grid;
  gap: 2px;
}

.sticker-toolbar strong {
  color: var(--ink);
  font-size: 1rem;
}

.sticker-toolbar span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.pending-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 14px 4px 5px;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.pending-toggle:hover {
  text-decoration: none;
}

.pending-toggle span {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: #d7dde6;
}

.pending-toggle span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(22, 32, 51, 0.22);
  content: "";
  transition: transform 0.18s ease;
}

.pending-toggle.is-active {
  color: var(--green-dark);
  border-color: rgba(0, 156, 59, 0.32);
  background: #eefaf2;
}

.pending-toggle.is-active span {
  background: var(--green);
}

.pending-toggle.is-active span::after {
  transform: translateX(20px);
}

.sticker-mark-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.sticker-mark-grid form {
  min-width: 0;
  margin: 0;
}

.sticker-tile {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1.18;
  align-content: space-between;
  border: 2px solid rgba(22, 32, 51, 0.14);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 24px rgba(22, 32, 51, 0.08);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sticker-tile:hover,
.sticker-tile:focus-visible {
  border-color: rgba(0, 156, 59, 0.48);
  outline: 0;
  transform: translateY(-1px);
}

.sticker-tile.is-collected {
  color: #ffffff;
  border-color: var(--green);
  background: linear-gradient(145deg, var(--green), var(--green-dark));
}

.sticker-code,
.sticker-state {
  font-weight: 900;
}

.sticker-code {
  font-size: 0.92rem;
}

.sticker-number {
  justify-self: center;
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 950;
  line-height: 1;
}

.sticker-state {
  color: var(--muted);
  font-size: 0.84rem;
}

.sticker-tile.is-collected .sticker-state {
  color: rgba(255, 255, 255, 0.86);
}

.empty-state {
  border: 1px dashed rgba(22, 32, 51, 0.24);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.86);
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--blue);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.compact-page {
  display: grid;
  gap: 16px;
}

.compact-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.compact-hero h1 {
  max-width: 820px;
  margin: 0;
  color: var(--blue);
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.compact-back {
  margin-bottom: 12px;
  color: var(--blue);
}

.compact-count {
  display: grid;
  min-width: 150px;
  justify-items: end;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px rgba(0, 39, 118, 0.1);
}

.compact-count span {
  color: var(--blue);
  font-size: 2.6rem;
  font-weight: 950;
  line-height: 1;
}

.compact-count strong {
  color: var(--muted);
  font-size: 0.9rem;
}

.compact-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.compact-search {
  display: grid;
  gap: 8px;
}

.compact-search label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

.compact-search div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.compact-search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-weight: 750;
}

.compact-search input:focus {
  border-color: var(--green);
  outline: 3px solid rgba(0, 156, 59, 0.18);
}

.compact-mode {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  background: var(--surface-soft);
}

.compact-mode a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.compact-mode a.is-active {
  color: #ffffff;
  background: var(--blue);
}

.compact-query {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.compact-query a {
  flex: 0 0 auto;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
}

.compact-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-section header a {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 950;
}

.compact-section header span {
  display: inline-grid;
  min-width: 34px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--blue);
  background: #edf4ff;
  font-size: 0.82rem;
  font-weight: 950;
}

.compact-stickers {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.compact-stickers form {
  margin: 0;
}

.compact-sticker {
  display: grid;
  width: 42px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(22, 32, 51, 0.18);
  border-radius: 7px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 950;
}

.compact-sticker:hover,
.compact-sticker:focus-visible {
  border-color: var(--green);
  outline: 3px solid rgba(0, 156, 59, 0.16);
}

.compact-sticker.is-collected {
  color: #ffffff;
  border-color: var(--green);
  background: var(--green);
}

.auth-card {
  display: grid;
  gap: 16px;
}

.auth-card label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.auth-card input:focus {
  border-color: var(--green);
  outline: 3px solid rgba(0, 156, 59, 0.18);
}

.auth-card small {
  color: var(--danger);
  font-weight: 700;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 10px !important;
  font-weight: 700 !important;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--green);
}

.privacy-box {
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.privacy-box p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-links {
  justify-content: space-between;
  font-size: 0.94rem;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.flash {
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
}

.flash-danger {
  color: var(--danger);
  background: #fff4f2;
}

.flash-success {
  color: var(--success);
  background: #ecfdf3;
}

.flash-info {
  color: var(--info);
  background: #eff8ff;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 24px, 680px);
  }

  .topbar {
    align-items: flex-start;
  }

  .brand {
    max-width: 210px;
  }

  .hero,
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .dashboard-hero,
  .group-grid,
  .sticker-hero,
  .compact-hero,
  .compact-controls {
    grid-template-columns: 1fr;
  }

  .compact-count {
    justify-items: start;
  }

  .sticker-mark-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero {
    min-height: auto;
    padding: 24px 0 8px;
  }

  .hero-panel {
    padding: 16px;
    transform: none;
  }

  .sticker-grid span {
    min-height: 96px;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 18px, 520px);
  }

  .topbar {
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  .site-footer {
    margin-top: 28px;
    padding-top: 14px;
  }

  .auth-card,
  .content-panel {
    padding: 18px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .dashboard-hero {
    gap: 16px;
  }

  .sticker-hero {
    padding: 18px;
  }

  .sticker-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .pending-toggle {
    justify-content: space-between;
  }

  .compact-search div {
    grid-template-columns: 1fr;
  }

  .compact-search .button,
  .compact-mode {
    width: 100%;
  }

  .compact-mode a {
    flex: 1 1 0;
    justify-content: center;
  }

  .sticker-mark-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .sticker-tile {
    padding: 10px;
  }

  .team-row {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 56px;
  }

  .team-main {
    padding: 9px 10px;
  }

  .team-title {
    display: grid;
    gap: 2px;
  }

  .team-title span {
    white-space: normal;
  }

  .team-title strong {
    font-size: 0.82rem;
  }
}
