@font-face { font-family: Montserrat; src: url("fonts/Montserrat-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Montserrat; src: url("fonts/Montserrat-SemiBold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Montserrat; src: url("fonts/Montserrat-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #515151;
  --accent: #ff161f;
  --accent-dark: #a31721;
  --canvas: #f7f7f6;
  --surface: #fff;
  --line: #d8d8d5;
  --focus: #005992;
  font: 1rem/1.55 Montserrat, Verdana, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
a { color: var(--accent-dark); text-underline-offset: .2em; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { font-size: clamp(1.9rem, 1.35rem + 2vw, 2.9rem); line-height: 1.12; letter-spacing: -.035em; margin: 0 0 1.5rem; }
h2 { font-size: 1.12rem; margin: 0 0 .6rem; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
small, .muted { color: var(--muted); }
.wrap { width: min(calc(100% - 3rem), 76rem); margin-inline: auto; }
main.wrap { flex: 1 0 auto; padding-block: 3rem 4rem; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-content { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding-block: .9rem; }
.wordmark { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; gap: 1.55rem; line-height: 1.25; }
.wordmark strong { font-size: 1.05rem; }
.wordmark small { display: block; font-size: .76rem; margin-top: .14rem; }
.government-mark { width: 10rem; height: auto; display: block; margin: 1.875rem; }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: .85rem 1.2rem; }
nav a, nav button { color: var(--ink); font-size: .88rem; font-weight: 600; }
nav form { margin: 0; }
.link-button { background: none; border: 0; text-decoration: underline; text-underline-offset: .2em; padding: 0; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: .8rem; color: var(--muted); }
.site-footer > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; padding-block: 1.2rem; }
.skip { position: fixed; top: .7rem; left: .7rem; transform: translateY(-200%); background: var(--surface); padding: .65rem; z-index: 2; }
.skip:focus { transform: none; }

main.login-main { display: grid; align-content: center; min-height: min(36rem, 62vh); }
.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  width: min(100%, 60rem);
  margin-inline: auto;
  border: 1px solid var(--line);
  border-top: .25rem solid var(--accent);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(20, 20, 20, .045);
}
.login-intro, .login-actions { padding: clamp(1.2rem, 4.5vw, 3.5rem); }
.login-intro { display: flex; flex-direction: column; justify-content: center; background: #f1f1ee; }
.login-intro p { max-width: 33ch; color: #353535; }
.login-actions { align-self: center; }
.login-actions form { margin: 0 0 .9rem; }
.google-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #747775;
  border-radius: 6px;
  background: var(--surface);
  color: #1f1f1f;
  font: 500 14px/20px "Google Sans", Arial, sans-serif;
}
.google-button svg { flex: none; }
.google-button:hover { background: #f7f8f8; }
.login-support { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1.5rem; font-size: .86rem; }
.login-support strong { display: block; }
.login-support p { margin-top: .3rem; color: var(--muted); }
.notice { border: 1px solid #d4dfea; border-left: 4px solid var(--focus); background: #f1f6fa; padding: .9rem 1rem; margin-bottom: 1rem; }
.notice p { margin-top: .35rem; }
.notice.success { background: #eff7ee; border-color: #42754a; }
.notice.alert { background: #fff2f3; border-color: var(--accent-dark); }

button, input, select { font: inherit; }
button, summary { cursor: pointer; }
.button {
  display: inline-flex;
  justify-content: center;
  min-height: 2.65rem;
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: .3rem;
  background: var(--ink);
  color: #fff;
  padding: .52rem .95rem;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: #323232; }
.button.primary { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.primary:hover { background: #741320; }
.button.danger { background: var(--surface); border-color: var(--accent-dark); color: var(--accent-dark); }
.button.danger:hover { background: #fff2f3; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; margin-bottom: 1.25rem; }
.filters label, .field { display: grid; gap: .35rem; }
.filters label, .field label { font-size: .85rem; font-weight: 600; }
.filters input, .filters select, .field input {
  min-height: 2.65rem;
  min-width: 0;
  width: 100%;
  padding: .4rem .7rem;
  border: 1px solid #8c8c89;
  border-radius: .3rem;
  background: var(--surface);
  color: var(--ink);
}
.filters label:first-child { flex: 1 1 14rem; max-width: 24rem; }
.filters > a { align-self: center; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); border-radius: .35rem; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .85rem; }
th, td { vertical-align: top; border-bottom: 1px solid #e2e2df; padding: .8rem .9rem; }
thead { background: #efefec; }
thead th { white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
th small, td small, .table-line { display: block; }
td small, th small { font-weight: 400; font-size: .76rem; }
.status { display: inline-block; padding: .22rem .55rem; border-radius: .25rem; background: #eee; color: #222; font-size: .77rem; line-height: 1.35; font-weight: 600; }
.status-ativo { background: #e0efdf; color: #174f26; }
.status-pendente { background: #fff0c8; color: #654600; }
.status-bloqueado, .status-rejeitado, .status-expirado { background: #fbe6e8; color: #801521; }
.pagination, .publication-nav { margin-block: 1rem; }
.publication-nav [aria-current] { color: var(--accent-dark); border-bottom: 2px solid; text-decoration: none; }
.back { display: inline-block; font-size: .86rem; margin-bottom: 1.2rem; }
.account-summary { display: flex; gap: 1rem 2rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
dt { font-size: .82rem; font-weight: 600; }
dd { margin: 0; overflow-wrap: anywhere; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: .4rem; padding: clamp(1rem, 3vw, 1.7rem); margin: 0 0 1rem; max-width: 48rem; }
fieldset { border: 0; margin: 0 0 1.1rem; min-inline-size: 0; padding: 0; }
legend { font-weight: 700; margin-bottom: .6rem; padding: 0; }
fieldset > div > div { margin: .55rem 0; }
fieldset > div > div > label { cursor: pointer; }
fieldset input { accent-color: var(--accent-dark); min-width: 1rem; min-height: 1rem; vertical-align: middle; }
.field { max-width: 20rem; margin-bottom: 1rem; }
.errorlist { color: #801521; margin: .3rem 0; padding-left: 1.2rem; }
.audit-details { margin: .5rem 0; }
.audit-details dd { margin-bottom: .3rem; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem); gap: 1rem; margin-top: 1rem; }
.map-main, .map-sidebar { min-width: 0; }
.map-sidebar { background: var(--surface); border: 1px solid var(--line); padding: 1rem; border-radius: .35rem; }
.map-sidebar h2:not(:first-child) { margin-top: 1.5rem; }
.map-controls { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: .6rem; }
.map-controls button { min-height: 2.5rem; border: 1px solid #777; border-radius: .3rem; background: white; padding: .3rem .8rem; font-weight: 600; }
.map-viewport { position: relative; width: 100%; height: clamp(22rem, 55vh, 42rem); overflow: hidden; background: #e9ece9; border: 1px solid #969b96; cursor: grab; touch-action: none; }
.map-viewport:active { cursor: grabbing; }
.map-viewport img { display: block; width: 100%; height: 100%; user-select: none; pointer-events: none; }
.map-marker { position: absolute; width: 15px; height: 15px; border-radius: 50%; border: 3px solid white; background: #b10f1a; box-shadow: 0 0 0 2px #a00000; transform: translate(-50%, -50%); pointer-events: none; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #444; padding: 1rem; }
.map-hint { font-size: .8rem; color: var(--muted); margin-top: .5rem; }
.map-layer { border-bottom: 1px solid var(--line); padding: .7rem 0; overflow-wrap: anywhere; }
.map-layer label { display: flex; gap: .5rem; align-items: baseline; font-weight: 600; }
.map-layer details { margin: .4rem 0 0 1.5rem; font-size: .85rem; }
.map-layer details img { display: block; max-width: 100%; height: auto; margin-top: .5rem; }
.map-layer .layer-status { color: var(--muted); font-size: .8rem; }
.map-selection-item { display: block; width: 100%; margin-top: .5rem; text-align: left; border: 1px solid var(--line); background: #f7f7f6; padding: .5rem; }
.map-selection-item[aria-pressed="true"] { border: 2px solid var(--accent-dark); }
.map-retry-identify { margin-top: .7rem; }

@media (max-width: 680px) {
  .wrap { width: calc(100% - 1.5rem); }
  main.wrap { padding-block: 1.65rem 2.5rem; }
  .topbar-content { align-items: start; flex-direction: column; }
  .login-panel { grid-template-columns: minmax(0, 1fr); }
  .login-intro h1 { margin-bottom: .7rem; }
  .login-intro p { max-width: none; }
  .government-mark { width: 8rem; margin: 1.5rem; }
  .map-layout { grid-template-columns: minmax(0, 1fr); }
}
