/*
Theme Name: ZAFO Public
Theme URI: https://zafo.pl
Author: ZAFO
Description: Publiczna witryna Zespolu Analiz Finansow Oswiaty.
Version: 0.1.19
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Text Domain: zafo-public
*/

:root {
  --ink: #092033;
  --muted: #597083;
  --line: #d9e3ea;
  --soft-line: #edf3f6;
  --navy: #00325a;
  --deep-navy: #002850;
  --green: #57a823;
  --green-dark: #3f7f18;
  --surface: #ffffff;
  --wash: #f5f8fa;
  --alert: #9f3f12;
  --warning: #8a6b10;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

main {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 32px;
  justify-content: space-between;
  min-height: 132px;
  padding: 14px clamp(20px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: inline-flex;
  justify-content: flex-start;
  min-width: min(520px, 58vw);
  overflow: visible;
}

.brand img {
  display: block;
  height: 104px;
  object-fit: contain;
  object-position: left center;
  transform: translateX(-18px);
  width: min(520px, 58vw);
}

.topbar nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.topbar nav a {
  border-radius: 6px;
  color: #29465c;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
}

.topbar nav a:hover {
  background: var(--soft-line);
  color: var(--deep-navy);
}

.hero {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  padding: 64px clamp(20px, 5vw, 72px) 42px;
}

.hero-copy,
.section-heading,
.about-section,
footer {
  max-width: 1160px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  color: var(--deep-navy);
  font-size: clamp(38px, 7vw, 74px);
  line-height: 0.98;
  margin-bottom: 22px;
  max-width: 970px;
}

h2 {
  color: var(--deep-navy);
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
  margin-bottom: 12px;
}

h3 {
  color: var(--deep-navy);
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.lead {
  color: #315268;
  font-size: 19px;
  line-height: 1.62;
  margin-bottom: 30px;
  max-width: 850px;
}

.search-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 40, 80, 0.08);
  max-width: 890px;
  padding: 18px;
}

.search-panel label {
  color: var(--deep-navy);
  display: block;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
}

.search-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 230px;
}

.search-row input,
.search-row select {
  background: #fbfdfe;
  border: 1px solid #c7d6df;
  border-radius: 6px;
  color: var(--ink);
  min-height: 48px;
  padding: 0 14px;
  width: 100%;
}

.search-row input:focus,
.search-row select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(87, 168, 35, 0.18);
  outline: none;
}

.hero-panel {
  align-self: end;
  background: var(--deep-navy);
  border-radius: 8px;
  color: #fff;
  display: grid;
  gap: 1px;
  overflow: hidden;
}

.hero-panel div {
  background: rgba(255, 255, 255, 0.06);
  padding: 24px;
}

.hero-panel span {
  color: #ffffff;
  display: block;
  font-size: 34px;
  font-weight: 850;
  line-height: 1;
  margin-bottom: 8px;
}

.hero-panel p {
  color: #d7e5ee;
  line-height: 1.45;
  margin: 0;
}

.activity-band,
.municipality-section,
.about-section {
  padding: 50px clamp(20px, 5vw, 72px);
}

.activity-band {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
}

.section-heading.wide {
  margin-bottom: 24px;
}

.section-heading.wide p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.58;
  max-width: 850px;
}

.document-list {
  display: grid;
  gap: 12px;
}

.document-list article {
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.document-list article div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.document-list time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.document-list strong {
  color: var(--deep-navy);
  font-size: 15px;
}

.document-list p {
  color: #28475d;
  line-height: 1.45;
  margin-bottom: 12px;
}

.document-list article > span {
  background: rgba(87, 168, 35, 0.1);
  border-radius: 999px;
  color: var(--green-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.document-empty {
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.58;
  margin: 0;
  padding: 18px;
}

.municipality-section {
  background: var(--wash);
}

.table-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 45px rgba(0, 40, 80, 0.06);
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

.public-access-table {
  min-width: 880px;
}

.full-access-table {
  min-width: 1080px;
}

.access-request-table {
  min-width: 1160px;
}

th {
  background: #eef5f8;
  color: var(--deep-navy);
  font-size: 12px;
  letter-spacing: 0;
  padding: 14px 16px;
  text-align: left;
  text-transform: uppercase;
}

td {
  border-top: 1px solid var(--soft-line);
  color: #29465c;
  padding: 16px;
  vertical-align: middle;
}

td strong,
td span {
  display: block;
}

td strong {
  color: var(--deep-navy);
  margin-bottom: 4px;
}

td span {
  color: var(--muted);
  font-size: 13px;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  white-space: nowrap;
}

.status.good {
  background: rgba(87, 168, 35, 0.12);
  color: var(--green-dark);
}

.status.partial {
  background: rgba(138, 107, 16, 0.12);
  color: var(--warning);
}

.status.sent {
  background: rgba(0, 50, 90, 0.1);
  color: var(--deep-navy);
}

.status.missing {
  background: rgba(159, 63, 18, 0.12);
  color: var(--alert);
}

.report-slots {
  display: grid;
  gap: 6px;
}

.report-slots span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.login-button {
  align-items: center;
  background: var(--deep-navy);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  white-space: nowrap;
}

.login-button:hover {
  filter: brightness(1.06);
}

.access-request-button,
.document-toggle,
.document-link {
  align-items: center;
  background: var(--green);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  white-space: nowrap;
}

.access-request-button:hover,
.document-toggle:hover,
.document-link:hover {
  filter: brightness(1.04);
}

.document-link {
  text-decoration: none;
}

.municipality-documents {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  min-width: 280px;
}

.municipality-documents[hidden] {
  display: none;
}

.municipality-documents a {
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--deep-navy);
  display: grid;
  gap: 3px;
  padding: 10px;
  text-decoration: none;
}

.municipality-documents a:hover {
  border-color: var(--green);
}

.municipality-documents time {
  color: var(--muted);
  font-size: 12px;
}

.municipality-documents span {
  color: var(--deep-navy);
  font-size: 13px;
  font-weight: 750;
}

.access-request-form {
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-top: 10px;
  max-width: 310px;
  padding: 12px;
}

.access-request-form[hidden] {
  display: none;
}

.access-request-form label {
  color: var(--deep-navy);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 5px;
}

.access-request-form input {
  background: #ffffff;
  border: 1px solid #c7d6df;
  border-radius: 6px;
  color: var(--ink);
  min-height: 36px;
  padding: 0 10px;
  width: 100%;
}

.access-request-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(87, 168, 35, 0.18);
  outline: none;
}

.auth-modal {
  align-items: center;
  background: rgba(9, 32, 51, 0.62);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 32px clamp(20px, 5vw, 72px);
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 40, 80, 0.22);
  max-width: 560px;
  padding: 28px;
  position: relative;
  width: 100%;
}

.auth-close {
  align-items: center;
  background: var(--soft-line);
  border-radius: 6px;
  color: var(--deep-navy);
  display: inline-flex;
  font-size: 24px;
  font-weight: 700;
  height: 36px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 18px;
  top: 18px;
  width: 36px;
}

.auth-copy {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.58;
  margin-bottom: 18px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  color: var(--deep-navy);
  display: grid;
  font-size: 14px;
  font-weight: 800;
  gap: 7px;
}

.auth-form input {
  background: #fbfdfe;
  border: 1px solid #c7d6df;
  border-radius: 6px;
  color: var(--ink);
  min-height: 44px;
  padding: 0 12px;
  width: 100%;
}

.auth-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(87, 168, 35, 0.18);
  outline: none;
}

.auth-login {
  margin-top: 12px;
}

.auth-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 12px;
}

.auth-actions .auth-login {
  margin-top: 0;
}

.secondary-link {
  background: transparent;
  border: 0;
  color: var(--deep-navy);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.secondary-link:hover {
  color: var(--green-dark);
}

.error-note {
  background: rgba(159, 63, 18, 0.1);
  border-color: rgba(159, 63, 18, 0.22);
  color: var(--alert);
}

.empty-state {
  color: var(--muted);
  padding: 24px;
}

.about-section {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1fr);
}

.about-section p:not(.eyebrow) {
  color: #29465c;
  font-size: 18px;
  line-height: 1.7;
}

footer {
  align-items: stretch;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 0.55fr);
  margin: 0 auto;
  padding: 30px clamp(20px, 5vw, 72px) 42px;
}

.footer-info {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

footer strong {
  color: var(--deep-navy);
  font-size: 20px;
}

footer p {
  color: var(--muted);
  margin: 6px 0 0;
}

address {
  color: #29465c;
  display: flex;
  flex-wrap: wrap;
  font-style: normal;
  gap: 12px 18px;
  justify-content: flex-start;
}

address a {
  color: var(--deep-navy);
  font-weight: 800;
}

.report-box {
  align-self: start;
  justify-self: end;
  max-width: 520px;
  width: 100%;
}

.report-button,
.submit-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 850;
}

.report-button {
  background: var(--deep-navy);
  color: #fff;
  min-height: 48px;
  padding: 0 18px;
  width: 100%;
}

.report-button:hover,
.submit-button:hover {
  filter: brightness(1.04);
}

.report-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 45px rgba(0, 40, 80, 0.08);
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
}

.report-form[hidden],
.form-note[hidden],
.empty-state[hidden] {
  display: none;
}

.report-form label {
  color: var(--deep-navy);
  display: grid;
  font-size: 14px;
  font-weight: 800;
  gap: 7px;
}

.report-form input {
  background: #fbfdfe;
  border: 1px solid #c7d6df;
  border-radius: 6px;
  color: var(--ink);
  min-height: 44px;
  padding: 0 12px;
  width: 100%;
}

.report-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(87, 168, 35, 0.18);
  outline: none;
}

.submit-button {
  background: var(--green);
  color: #fff;
  min-height: 44px;
  padding: 0 16px;
}

.form-note {
  background: rgba(87, 168, 35, 0.1);
  border: 1px solid rgba(87, 168, 35, 0.22);
  border-radius: 6px;
  color: var(--green-dark);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding: 10px 12px;
}

@media (max-width: 980px) {
  .hero,
  .activity-band,
  .about-section {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand {
    min-width: min(360px, 92vw);
  }

  .brand img {
    height: auto;
    max-height: 112px;
    transform: translateX(-10px);
    width: min(360px, 92vw);
  }

  .topbar nav {
    justify-content: flex-start;
    width: 100%;
  }

  .topbar nav a {
    padding: 8px 10px;
  }

  .hero {
    padding-top: 38px;
  }

  h1 {
    font-size: 38px;
  }

  .lead {
    font-size: 17px;
  }

  .search-row,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .activity-band,
  .municipality-section,
  .about-section {
    padding-bottom: 38px;
    padding-top: 38px;
  }

  footer {
    grid-template-columns: 1fr;
  }

  address {
    justify-content: flex-start;
  }

  .report-box {
    justify-self: stretch;
    max-width: none;
  }
}
