:root {
  --bg: #f8fafc;
  --bg-alt: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --badge-bg: #eff6ff;
  --badge-text: #1d4ed8;
  --notice-bg: #fefce8;
  --notice-border: #fde68a;
  --notice-text: #854d0e;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Nav */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-badge {
  background: var(--primary);
  color: #fff;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 800;
}

nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

nav a:hover,
nav a.active {
  color: var(--primary);
  background-color: var(--badge-bg);
}

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.lang-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Language persistence: applied from localStorage before first paint */
html.lang-en .content-pl { display: none !important; }
html.lang-en .content-en { display: revert !important; }

/* Notice Banner */
.notice-banner {
  background-color: var(--notice-bg);
  border-bottom: 1px solid var(--notice-border);
  color: var(--notice-text);
  font-size: 0.85rem;
  padding: 0.6rem 1.5rem;
  text-align: center;
  font-weight: 500;
}

/* Main Content */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  flex: 1;
  width: 100%;
}

.page-header {
  margin-bottom: 3rem;
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.page-header p {
  color: var(--text-muted);
  max-width: 750px;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* Cards & Layout */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.card .role {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  display: inline-block;
}

/* Callout Box */
.callout {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.callout h3 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.callout p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 1rem;
  transition: background 0.15s ease;
}

.btn:hover {
  background-color: var(--primary-hover);
}

button.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-ghost {
  background: #ffffff;
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--badge-bg);
  color: var(--primary-hover);
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

/* Legal document body (statute translation) */
.doc-body p {
  color: var(--text-main);
}

/* Statute preview modal (Drive-style lightbox, no download) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: #ffffff;
  border-radius: 14px;
  width: min(860px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-wrap: wrap;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.modal-tabs {
  display: inline-flex;
  background: #ffffff;
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.modal-tab {
  border: none;
  background: transparent;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.modal-tab.active {
  background: var(--badge-bg);
  color: var(--primary);
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: inherit;
}

.modal-close:hover {
  background: var(--badge-bg);
  color: var(--text-main);
}

.modal-body {
  overflow-y: auto;
  padding: 1.5rem 2rem;
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--text-main);
}

.modal-body h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}

.modal-body h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0.9rem 0 0.25rem;
}

.modal-body p {
  margin-bottom: 0.5rem;
}

.modal-note {
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  color: var(--notice-text);
  margin-bottom: 1rem;
}

/* Registry & Contact */
.info-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.info-group h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.info-group p {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.org-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.reg-grid {
  display: grid;
  grid-template-columns: 135px 1fr;
  column-gap: 1.25rem;
  row-gap: 0.6rem;
  align-items: baseline;
  margin-top: 1rem;
}

.reg-label {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.reg-value {
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
}

.supervision {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

.email-link:hover {
  text-decoration: underline;
}

.email-link svg {
  flex-shrink: 0;
}

.contact-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* CTA Section */
.cta-section {
  text-align: center;
  margin-top: 3rem;
  padding: 2.5rem 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cta-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.cta-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 560px;
  margin: 0 auto;
}

/* Footer */
footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .nav-container {
    flex-direction: column;
    gap: 0.75rem;
  }
  nav {
    justify-content: center;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .info-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
  }
  .reg-grid {
    grid-template-columns: 115px 1fr;
    column-gap: 0.75rem;
  }
  .page-header h1 {
    font-size: 1.75rem;
  }
}
