:root {
  color-scheme: light;
  --bg: #dfe8ff;
  --bg-strong: #c7d8ff;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: #ffffff;
  --text: #091a55;
  --muted: #355091;
  --accent: #d9253a;
  --accent-strong: #0b43d6;
  --accent-2: #1358f4;
  --border: rgba(9, 26, 85, 0.14);
  --shadow: 0 24px 80px rgba(10, 44, 143, 0.2);
  --radius: 24px;
}

html[data-theme="dark"],
body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #06103a;
  --bg-strong: #0d1f62;
  --surface: rgba(8, 22, 70, 0.88);
  --surface-strong: #102874;
  --text: #f5f8ff;
  --muted: #c2cff5;
  --accent: #ff4f5f;
  --accent-strong: #2d72ff;
  --accent-2: #81a6ff;
  --border: rgba(245, 248, 255, 0.12);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

#home,
#aktualnosci-preview,
#aktualnosci,
#rekrutacja,
#statut {
  scroll-margin-top: 110px;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(19, 88, 244, 0.38), transparent 30%),
    radial-gradient(circle at top right, rgba(11, 67, 214, 0.22), transparent 32%),
    radial-gradient(circle at bottom right, rgba(217, 37, 58, 0.16), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

html[data-theme="dark"] body {
  color-scheme: dark;
}

body.app-loading .site-shell,
body.app-loading .modal-backdrop {
  opacity: 0;
  visibility: hidden;
}

a,
button,
input,
textarea,
select {
  font: inherit;
}

button,
.button-link {
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
}

button.secondary,
.button-link.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

button:hover,
.button-link:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 0.9rem 1rem;
  background: var(--surface-strong);
  color: var(--text);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.topbar,
.panel,
.hero-card,
.modal,
.stats-grid article,
.admin-card {
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 14px 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 14px 36px rgba(11, 67, 214, 0.26);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-nav a,
.admin-nav button {
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  padding: 0.25rem 0.5rem;
}

.theme-toggle {
  padding: 0.35rem;
  background: transparent;
  border: 1px solid var(--border);
}

.theme-pill {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 76px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-strong);
}

.theme-pill::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 20px rgba(17, 38, 108, 0.22);
  transition: transform 0.24s ease;
}

body[data-theme="dark"] .theme-pill::before {
  transform: translateX(36px);
}

.theme-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  transition: color 0.24s ease, transform 0.24s ease;
}

body:not([data-theme="dark"]) .theme-icon-sun,
body[data-theme="dark"] .theme-icon-moon {
  color: #ffffff;
  transform: scale(1.08);
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 20px;
  padding: 44px 0 18px;
}

.hero-copy,
.hero-card,
.panel,
.admin-card,
.stats-grid article {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-copy {
  padding: 36px;
  background:
    linear-gradient(145deg, rgba(31, 83, 210, 0.16), rgba(255, 255, 255, 0.04)),
    linear-gradient(180deg, rgba(217, 37, 58, 0.06), transparent);
}

.hero h1,
.section-head h2,
.modal h2 {
  margin: 0;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  max-width: 12ch;
  margin-bottom: 1.1rem;
}

.hero-text,
.section-head p,
.site-footer p,
.admin-subtitle {
  color: var(--muted);
}

.hero-meta {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  margin-bottom: 0.7rem;
  color: var(--accent-2);
  font-weight: 700;
}

.hero-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.hero-mark img {
  width: min(100%, 220px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 22px 50px rgba(11, 67, 214, 0.3);
}

.hero-actions,
.modal-actions,
.form-actions,
.toolbar,
.inline-actions,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

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

.hero-card,
.panel,
.admin-card,
.stats-grid article {
  padding: 24px;
}

.section-head {
  margin-bottom: 1.7rem;
}

.section-head p {
  margin: 0 0 0.7rem;
}

.section-head h2 {
  margin-bottom: 0.3rem;
}

.shortcut-grid,
.news-grid,
.stats-grid,
.admin-grid {
  display: grid;
  gap: 16px;
}

.shortcut-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.shortcut-grid a,
.news-card,
.stats-grid article,
.list-item,
.badge,
.admin-nav button.active {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-strong);
}

.shortcut-grid a {
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.shortcut-grid a:hover {
  border-color: rgba(31, 83, 210, 0.28);
}

.panel {
  margin-top: 36px;
}

.news-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.news-card,
.list-item {
  padding: 18px;
}

.news-card-body {
  display: grid;
  gap: 12px;
}

.news-meta,
.item-meta,
.mini {
  color: var(--muted);
  font-size: 0.92rem;
}

.stack-list {
  display: grid;
  gap: 14px;
  margin-top: 0.5rem;
}

.news-expand {
  margin-top: 12px;
  align-self: start;
}

.news-full,
.news-preview {
  line-height: 1.7;
}

.news-page-shell {
  padding: 28px;
}

.news-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.news-feature,
.news-sidebar {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-strong);
  padding: 22px;
}

.news-feature-title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
}

.news-feature-body {
  line-height: 1.8;
}

.news-sidebar h3 {
  margin: 0 0 1rem;
}

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

.news-sidebar-item {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  padding: 16px;
  box-shadow: none;
}

.news-sidebar-item strong {
  font-size: 1rem;
}

.news-sidebar-item span:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.application-form,
.stacked-form,
.admin-card form {
  display: grid;
  gap: 18px;
}

.static-notice {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  line-height: 1.75;
}

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

.form-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.checkbox,
.checkbox-group label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.checkbox input,
.checkbox-group input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.checkbox-group {
  padding: 0;
  border: 0;
  margin: 0;
}

.form-actions {
  grid-column: 1 / -1;
}

.form-message {
  min-height: 1.3rem;
  color: var(--accent);
}

.rich-article,
.editor-surface {
  line-height: 1.7;
}

.pdf-box {
  display: grid;
  gap: 14px;
  margin-bottom: 1.5rem;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.pdf-box-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.pdf-box-head h3 {
  margin: 0 0 0.35rem;
}

.pdf-frame {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 10, 0.58);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.modal {
  width: min(680px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  position: relative;
}

.modal-wide {
  width: min(1100px, 100%);
  max-height: 88vh;
  overflow: auto;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  padding: 0.5rem 0.8rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 4px 0;
}

.admin-link {
  padding: 0.12rem 0.28rem;
  background: transparent;
  color: var(--muted);
  border: 0;
  text-transform: none;
  letter-spacing: 0.03em;
  font-size: 0.74rem;
  opacity: 0.42;
  box-shadow: none;
}

.admin-link:hover,
.admin-link:focus-visible {
  opacity: 0.72;
  transform: none;
  text-decoration: underline;
}

.admin-layout {
  display: grid;
  gap: 20px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stats-grid article h3 {
  margin: 0.4rem 0;
  font-size: 1.8rem;
}

.admin-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.list-item h4,
.news-card h3,
.admin-card h3 {
  margin: 0 0 1rem;
}

.badge {
  display: inline-flex;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
}

.badge.oczekujace {
  color: #8f5d12;
}

.badge.zaakceptowane {
  color: #1d7f53;
}

.badge.odrzucone {
  color: #ba3a28;
}

.toolbar {
  margin-bottom: 12px;
}

.editor-surface {
  min-height: 180px;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.login-panel {
  max-width: 420px;
  margin: 0 auto;
}

.section-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

@media (max-width: 900px) {
  .hero,
  .application-form,
  .admin-grid,
  .news-page-layout {
    grid-template-columns: 1fr;
  }

  .site-footer,
  .admin-header {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    border-radius: 32px;
    padding: 14px 12px 16px;
    gap: 14px;
  }

  .brand {
    justify-content: center;
    text-align: center;
  }

  .brand-logo {
    width: 60px;
    height: 60px;
  }

  .main-nav {
    width: 100%;
    justify-content: center;
    gap: 8px 14px;
  }

  .main-nav a {
    padding: 0.45rem 0.35rem;
  }

  .theme-toggle {
    justify-self: center;
  }

  .topbar-actions {
    width: 100%;
    justify-content: center;
  }

  .hero {
    padding: 22px 0 10px;
    gap: 16px;
  }

  .hero-copy,
  .hero-card,
  .panel,
  .news-feature,
  .news-sidebar {
    padding: 20px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 10vw, 3rem);
    max-width: none;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .button-link {
    text-align: center;
  }

  .pdf-box-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pdf-frame {
    min-height: 360px;
  }

  .news-page-shell {
    padding: 20px;
  }
}
