/* ===== VARIABLES & RESET ===== */
:root {
  --primary: #004cff;
  --primary-dark: #008fcc;
  --text: #fff;
  --bg-dark: rgba(0, 0, 0, 0.7);
  --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ===== BASE STYLES ===== */
html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text);
  background-color: transparent;
  height: 100%;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ===== FIX FOR HEADING WARNING ===== */
/* Explicit font sizes for semantic headings */
article h1,
aside h1,
nav h1,
section h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 1rem 0;
}

.sg-offcanvas .offcanvas-title {
  font-size: 1.25rem;
  margin: 0;
}

/* Base heading styles */
h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 700;
}

h2 { font-size: 1.8rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

/* ===== BACKGROUND SLIDESHOW ===== */
#bg-container, .bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
}

.bg-layer {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s var(--transition);
  will-change: opacity;
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
}

.bg-layer.active {
  opacity: 1;
}

/* ===== LAYOUT COMPONENTS ===== */
header {
  text-align: center;
  padding: clamp(2rem, 5vw, 3rem) 1rem;
  background: var(--bg-dark);
  position: relative;
  z-index: 1;
  animation: fadeUp 1s var(--transition) both;
}

main {
  padding: 2rem;
  position: relative;
  z-index: 1;
  animation: fadeUp 1.2s var(--transition) both;
}

section.content-section {
  max-width: min(800px, 90%);
  margin: 2rem auto;
  padding: clamp(1.5rem, 4vw, 2rem);
  background: var(--bg-dark);
  border-radius: 12px;
  animation: fadeUp 1.3s var(--transition) both;
}

/* ===== FOOTER ===== */
.footer {
  font-family: 'Inter', sans-serif;
  background-color: #001B3D; /* granatowa ciemna baza */
  color: #E0E0E0; /* jasny szary tekst */
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.footer-logo {
  display: inline-block !important;
  max-height: 50px !important;
  width: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  background-color: transparent !important;
}
.footer-logo:hover {
  filter: none !important;
  cursor: default; /* wskazuje, że to nie jest link */
}

.footer h5 {
  color: #FFFFFF;
  font-weight: 700;
}

.footer-link {
  color: #AFCBFF;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover,
.footer-link:focus {
  color: #58a6ff;
  text-decoration: underline;
}

.footer ul {
  padding-left: 0;
  list-style: none;
}

.footer hr {
  border-color: rgba(255, 255, 255, 0.15);
}

.logo-column img {
  margin-left: 1rem;
}

@media (min-width: 768px) {
  /* kolumny tekstowe mają taką samą szerokość */
  .footer .row > div:not(.logo-column) {
    flex: 0 0 16.6667%; /* 2 kolumny bootstrapowe to 16.66%, tak ustawiamy stałą szerokość */
    max-width: 16.6667%;
  }

  /* kolumna z logo jest węższa i wypchnięta na prawo */
  .logo-column {
    flex: 0 0 auto;
    max-width: 120px; /* lub inna wartość, dopasuj do potrzeb */
  }
}


/* ===== HERO SECTION ===== */
.hero-section {
  position: relative;
  height: 100vh;
  min-height: -webkit-fill-available; /* Fix iOS */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 0 clamp(1rem, 3vw, 2rem);
  overflow: hidden; /* nie pozwól wyciec wideo */
  z-index: 0; /* niżej niż zawartość i nakładka */
}

/* Wideo tła */
.hero-section .hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* wypełnij, przytnij nadmiar */
  z-index: 0; /* pod nakładką i treścią */
  pointer-events: none; /* nie blokuje interakcji */
}

/* Nakładka półprzezroczysta nad filmem, pod treścią */
.hero-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1; /* nad wideo, pod treścią */
}

/* Treść hero nad nakładką i wideo */
.hero-section .hero-content {
  position: relative;
  z-index: 2;
  max-width: min(900px, 90%);
  animation: fadeUp 0.8s var(--transition) both;
  will-change: transform, opacity; /* optymalizacja animacji */
}

/* Teksty w hero */
.hero-content h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-content h1 span {
  color: var(--primary);
  display: inline-block;
}

.hero-content p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin-bottom: 2rem;
  line-height: 1.6;
}

:where(h1) {
  margin-block: 0.67em;
  font-size: 2em;
}

/* ===== BUTTONS ===== */
.button-link,
.cta-button {
  display: inline-block;
  padding: clamp(0.7rem, 2vw, 0.9rem) clamp(1.3rem, 3vw, 1.8rem);
  background-color: var(--primary); /* upewnij się, że to jest pełny, nieprzezroczysty kolor */
  color: white;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s var(--transition), transform 0.2s var(--transition);
  will-change: transform; /* zamiast translateZ(0) */
}

.button-link:hover, .cta-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px) translateZ(0);
}

.button-link.back {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.button-link.back:hover {
  background: var(--primary);
  color: white;
}

/* ===== FORM STYLES ===== */
.modern-form {
  background: #fff;
  padding: clamp(2rem, 4vw, 3rem);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  max-width: min(600px, 90%);
  margin: 2rem auto;
  color: #333;
}

.form-group {
  margin-bottom: 1.5rem;
}

.modern-form label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.modern-form input,
.modern-form textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font: inherit;
  transition: 
    border-color 0.2s var(--transition),
    box-shadow 0.2s var(--transition);
}

.modern-form input:focus,
.modern-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.2);
  outline: 2px solid transparent;
}

.submit-button {
  width: 100%;
  padding: 0.9rem;
}

.form-status {
  margin-top: 1rem;
  font-weight: 600;
}

.form-status.success { color: #2ecc71; }
.form-status.error { color: #e74c3c; }

/* ===== NAVIGATION ===== */
.sg-navbar {
  position: fixed;
  top: 1.2rem;
  right: clamp(1rem, 3vw, 2rem);
  z-index: 1030;
}

.sg-offcanvas {
  background: rgba(0, 27, 61, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  width: 260px;
}

.sg-navlist .nav-link {
  font-size: 1.4rem;
  font-weight: 600;
  padding: 0.7rem 0;
  color: var(--text);
  transition: color 0.2s var(--transition);
}

.sg-navlist .nav-link:hover {
  color: var(--primary);
}

/* ===== NOWOCZESNY HAMBURGER ===== */
.sg-toggler {
  width: 54px;
  height: 54px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, background 0.3s ease;
  animation: pulse 2.5s infinite ease-in-out;
}

.sg-toggler:hover {
  transform: scale(1.07);
  background: rgba(255, 255, 255, 0.12);
}

.icon-container {
  width: 26px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.icon-container span {
  display: block;
  width: 26px;
  height: 3.5px;
  background-color: var(--text);
  border-radius: 50px;
  transform-origin: center;
  transition:
    transform 0.35s ease,
    opacity 0.25s ease,
    background-color 0.3s ease;
}

/* Animacja do "X" */
.sg-toggler[aria-expanded="true"] .icon-container {
  justify-content: center;
}

.sg-toggler[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.sg-toggler[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.sg-toggler[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ===== ANIMACJA PULSOWANIA ===== */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.15); }
  50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ===== MEDIA QUERIES ===== */
/* iOS Viewport Fix */
@supports (-webkit-touch-callout: none) {
  .hero-section {
    min-height: -webkit-fill-available;
  }
}

/* Windows High Contrast Mode */
@media (-ms-high-contrast: active) {
  .button-link, .cta-button {
    border: 2px solid currentColor !important;
  }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    min-height: 150vh;
  }
}

/* Tablet Optimization */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-content h1 {
    font-size: clamp(2.5rem, 4vw, 3rem);
  }
}

/* Desktop Enhancements */
@media (min-width: 1200px) {
  .sg-offcanvas {
    width: 300px;
  }
}

/* 4K Screens */
@media (min-width: 2560px) {
  :root {
    font-size: 110%;
  }
}

.footer .footer-logo {
  display: inline-block !important;
  width: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  background-color: transparent !important;
  transition: none !important;
  cursor: default !important;
}

/* domyślne rozmiary logotypów (zmienialne) */
.footer .footer-logo { max-height: 45px; height: auto; }
.footer .footer-logo.footer-logo--small { max-height: 35px; }

@media (min-width: 992px) {
  .footer .footer-col-about  { flex: 0 0 35% !important; max-width: 35% !important; }
  .footer .footer-col-offer  { flex: 0 0 15% !important; max-width: 15% !important; }
  .footer .footer-col-contact{ flex: 0 0 25% !important; max-width: 25% !important; }
  .footer .footer-col-logos  { flex: 0 0 20% !important; max-width: 20% !important; }

  /* upewniamy się, że rząd trzyma wysokość i wyrównanie */
  .footer .row { align-items: start; }

  /* NOWOŚĆ: wyrównanie logo w stopce */
  .footer .footer-col-logos {
    display: flex !important;
    flex-direction: column;
  }
  .footer .footer-col-logos > div:first-child {
    align-self: center; /* górny wiersz: SITS i PZKITE na środku */
  }
  .footer .footer-col-logos > div:last-child {
    align-self: flex-end; /* dolne logo Nobile do prawej */
  }
}

/* Tablet / małe laptopy — płynne skalowanie (opcjonalne drobne korekty) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .footer .footer-logo { max-height: 40px; }
  .footer .footer-col-about { text-align: center; } /* możesz zmienić gdy chcesz inne wyrównanie */
}

@media (max-width: 767.98px) {
  .footer {
    padding-top: 2.5rem;
    padding-bottom: 1.8rem;
  }

  .footer .footer-logo {
    max-height: 30px;
  }

  .footer .footer-logo.footer-logo--small {
    max-height: 22px;
  }

  /* Ułóż kolumny jedna pod drugą na mobile */
  .footer .row {
    flex-direction: column !important;
  }

  .footer .footer-col-about,
  .footer .footer-col-offer,
  .footer .footer-col-contact,
  .footer .footer-col-logos {
    text-align: center;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Odstępy między sekcjami */
  .footer .footer-col-about + .footer-col-offer,
  .footer .footer-col-offer + .footer-col-contact,
  .footer .footer-col-contact + .footer-col-logos {
    margin-top: 1.5rem;
  }

  .footer .footer-col-logos {
    align-items: center !important;
  }
}

/* Wyłącz ewentualne nadpisujące hover/filtry dla obrazków w stopce */
footer img,
.footer img {
  filter: none !important;
  transition: none !important;
}

