/* ============================================
   CZARNECKI SOLUTIONS - Dark Theme Only
============================================ */

:root {
  --cursor-size: 20px;
  --cursor-hover-size: 60px;
}

/* Font Setup */
body {
  font-family: 'Space Grotesk', sans-serif;
}

.font-heading, h1, h2, h3, h4, h5, h6 {
  font-family: 'Syncopate', sans-serif;
}

/* ============================================
   CUSTOM CURSOR
============================================ */

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--cursor-size);
  height: var(--cursor-size);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
  mix-blend-mode: difference;
}

.custom-cursor.hover {
  width: var(--cursor-hover-size);
  height: var(--cursor-hover-size);
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(2px);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Mobile: wyłączamy custom-cursor i nie wymuszamy cursor:none */
@media (max-width: 768px) {
  .custom-cursor { display: none !important; }
}

/* Desktop only: chowamy systemowy kursor */
@media (min-width: 769px) {
  *, *::before, *::after { cursor: none !important; }
}

/* ============================================
   PRIVACY CHECKBOX (mobile fix)
============================================ */

.privacy-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.privacy-consent input[type="checkbox"]{
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  pointer-events: auto;
  touch-action: manipulation;
}

/* ============================================
   LOADING SCREEN
============================================ */

.loading-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  font-family: 'Syncopate', sans-serif;
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  margin-bottom: 1.5rem;
  animation: fadeInScale 0.8s ease-out;
  text-transform: uppercase;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-left: 0.3em;
}

.loading-subtitle {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(0.65rem, 1.5vw, 0.875rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.3s forwards;
}

.loading-bar-container {
  width: 100%;
  max-width: 500px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto 1rem;
  position: relative;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0.5) 100%);
  background-size: 200% 100%;
  animation: loadProgress 2s ease-in-out forwards, shimmerBar 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  border-radius: 2px;
}

.loading-percentage {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.5);
  opacity: 0;
  animation: fadeIn 0.5s ease-out 0.5s forwards;
}

@keyframes fadeInScale {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes loadProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes shimmerBar {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Mobile Loading Screen */
@media (max-width: 768px) {
  .loading-logo {
    font-size: 1.25rem;
    letter-spacing: 0.2em;
  }
  .loading-subtitle {
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
  }
}

@media (max-width: 480px) {
  .loading-logo {
    font-size: 1rem;
    letter-spacing: 0.15em;
  }
  .loading-subtitle {
    font-size: 0.5rem;
  }
}

/* ============================================
   SCROLL PROGRESS BAR
============================================ */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.5) 100%);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ============================================
   MOBILE MENU
============================================ */

.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
  max-height: 500px;
}

.menu-open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   GLASS PANEL EFFECT
============================================ */

.glass-panel {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.glass-panel:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ============================================
   TEXT OUTLINE EFFECT
============================================ */

.text-outline {
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.3);
  color: transparent;
  transition: all 0.5s ease;
}

.text-outline:hover {
  -webkit-text-stroke: 2px #fff;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* ============================================
   BUTTON 3D EFFECTS
============================================ */

.btn-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-3d:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.1);
}

.btn-3d:active {
  transform: translateY(-1px) scale(1.01);
}

/* ============================================
   INPUT MICROINTERACTIONS
============================================ */

.input-focus {
  transition: all 0.3s ease;
}

.input-focus:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.input-focus:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* ============================================
   SELECT DROPDOWN
============================================ */

select {
  appearance: none;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: right 1.5rem center;
  padding-right: 3rem !important;
}

select option {
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 10px;
}

.select-dropdown:invalid {
  color: #9ca3af !important;
}

/* ============================================
   LAZY IMAGE LOADING
============================================ */

.skeleton-image {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.lazy-image {
  opacity: 0;
  filter: blur(20px);
  transition: opacity 0.5s ease, filter 0.5s ease;
}

.lazy-image.loaded {
  opacity: 1;
  filter: blur(0);
}

/* ============================================
   SPARKLE EFFECT
============================================ */

.sparkle {
  position: fixed;
  pointer-events: none;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  animation: sparkleAnim 1.5s linear forwards;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  z-index: 9998;
}

@keyframes sparkleAnim {
  0% { transform: scale(1) translate(0, 0); opacity: 1; }
  100% { transform: scale(0) translate(var(--tx), var(--ty)); opacity: 0; }
}

/* ============================================
   STAT CARD HOVER
============================================ */

.stat-card {
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: scale(1.1) translateY(-5px);
}

/* ============================================
   PORTFOLIO ITEM SHINE
============================================ */

.portfolio-item {
  position: relative;
  overflow: hidden;
}

.portfolio-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
  z-index: 1;
}

.portfolio-item:hover::before {
  left: 100%;
}

/* ============================================
   PROCESS STEPS ANIMATION
============================================ */

.process-step {
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.6s ease forwards;
}

.process-step:nth-child(1) { animation-delay: 0.1s; }
.process-step:nth-child(2) { animation-delay: 0.2s; }
.process-step:nth-child(3) { animation-delay: 0.3s; }
.process-step:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   ENHANCED SCROLL ANIMATIONS
============================================ */

.fade-in-element {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-element.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   BACK TO TOP BUTTON
============================================ */

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #fff;
  color: #000;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 4000;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-5px) scale(1.1) rotate(360deg);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

/* ============================================
   COPY NOTIFICATION
============================================ */

.copy-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #fff;
  color: #000;
  padding: 15px 30px;
  border-radius: 30px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 6000;
}

.copy-notification.show {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   NAV LINK UNDERLINE
============================================ */

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #fff;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ============================================
   COOKIE CONSENT BANNER (GDPR)
============================================ */

.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-consent.show { transform: translateY(0); }
.cookie-consent.hide { transform: translateY(100%); }

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.cookie-text { flex: 1; }

.cookie-text p {
  color: #e5e5e5;
  line-height: 1.6;
  margin: 0;
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.cookie-accept {
  background: #fff;
  color: #000;
  padding: 0.75rem 2rem;
  border: none;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.cookie-accept:hover {
  background: #e5e5e5;
  transform: translateY(-2px);
}

.cookie-decline {
  background: transparent;
  color: #9ca3af;
  padding: 0.75rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.cookie-decline:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
  .cookie-buttons {
    width: 100%;
    flex-direction: column;
  }
  .cookie-accept,
  .cookie-decline {
    width: 100%;
  }
}

/* ============================================
   RECENTLY COMPLETED BADGE ANIMATION
============================================ */

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   SMOOTH SCROLLING
============================================ */

html {
  scroll-behavior: smooth;
}

/* ============================================
   TEXT SELECTION
============================================ */

::selection {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ============================================
   iOS: minimalne zabezpieczenia hitboxów (form)
============================================ */

@media (max-width: 768px) {
  #contactForm.glass-panel {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    position: relative;
  }

  #contactForm.fade-in-element,
  #contactForm.fade-in-element.visible {
    transform: none !important;
    transition: none !important;
    opacity: 1 !important;
  }

  #contactForm.glass-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    border-radius: inherit;
  }

  #contactForm.glass-panel > * {
    position: relative;
    z-index: 1;
  }
}
.privacy-consent {
  position: relative;
  z-index: 50;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.privacy-consent input[type="checkbox"],
.privacy-consent .privacy-label {
  position: relative;
  z-index: 51;
}

/* ============================================

CONTACT FORM (NEW iOS-SAFE)

============================================ */

.cs-form {
  position: relative;
}

.cs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .cs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
  }
}

.cs-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

.cs-input,
.cs-select,
.cs-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 14px 16px;
  border-radius: 0;
  outline: none;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease;
  -webkit-text-size-adjust: 100%;
}

.cs-input:focus,
.cs-select:focus,
.cs-textarea:focus {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 6px 18px rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.cs-textarea {
  resize: none;
}

.cs-select {
  appearance: none;
}

.cs-select option {
  background: #111;
  color: #fff;
}

/* Checkbox: zostawiamy NATYWNY wygląd (najpewniejsze na iOS) */
.cs-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 18px 0 22px;
  padding: 14px 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  position: relative;
  z-index: 60;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.cs-checkbox {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  accent-color: #ffffff;
}

.cs-consent-text {
  font-size: 0.75rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
}

.cs-btn {
  width: 100%;
  padding: 18px 18px;
  background: #fff;
  color: #000;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border: none;
  border-radius: 0;
  transition: transform .2s ease, filter .2s ease;
}

.cs-btn:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}

.cs-note {
  margin-top: 14px;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  min-height: 1.2em;
}

.cs-note.success { color: #10b981; }
.cs-note.error { color: #ef4444; }

/* iOS: upewniamy się, że żadna warstwa na formularzu nie blokuje tapów */
@media (max-width: 768px) {
  #csContactForm.glass-panel::before {
    pointer-events: none !important;
  }
}


/* ============================================
   iOS CHECKBOX FIX (Safari)
   Powód: iOS Safari potrafi źle hit-testować elementy wewnątrz kontenera
   z backdrop-filter / transform / opacity (np. glass-panel + animacje).
   Ten patch wyłącza te efekty tylko na mobile.
============================================ */

@media (max-width: 768px) {
  /* Najczęstszy winowajca: backdrop-filter na rodzicu */
  #csContactForm.glass-panel {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Transform na przodkach potrafi psuć klik/tap w Safari iOS */
  #csContactForm.fade-in-element,
  #csContactForm.fade-in-element.visible {
    transform: none !important;
    transition: none !important;
    opacity: 1 !important;
  }

  /* Mobilny :hover bywa „sticky” – nie ruszamy paneli */
  .glass-panel:hover {
    transform: none !important;
  }
}
/* ============================================
   FAST FORM (iOS SAFE) - bez backdrop-filter i bez transform
============================================ */

.sf-panel{
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 32px;
  border-radius: 18px;
}

@media (min-width: 768px){
  .sf-panel{ padding: 48px; }
}

.sf-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 768px){
  .sf-grid{ grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
}

.sf-field{ display:flex; flex-direction:column; gap: 10px; }

.sf-label{
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}

.sf-input,.sf-select,.sf-textarea{
  width:100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color:#fff;
  padding: 14px 16px;
  border-radius: 0;
  outline:none;
}

.sf-input:focus,.sf-select:focus,.sf-textarea:focus{
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.07);
}

.sf-textarea{ resize:none; }

.sf-select{ appearance:none; }
.sf-select option{ background:#111; color:#fff; }

/* checkbox: 100% natywny */
.sf-consent{
  display:flex;
  align-items:flex-start;
  gap: 12px;
  margin: 18px 0 22px;
  padding: 12px 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.02);
  -webkit-tap-highlight-color: transparent;
}

.sf-checkbox{
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  appearance: checkbox;
  -webkit-appearance: checkbox;
}

.sf-consent-text{
  font-size: 0.75rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.65);
  user-select: none;
  -webkit-user-select: none;
}

.sf-btn{
  width:100%;
  padding: 18px 18px;
  background:#fff;
  color:#000;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border: none;
  border-radius: 0;
}

.sf-note{ margin-top: 14px; font-size: 0.875rem; color: rgba(255,255,255,0.7); min-height: 1.2em; }
.sf-note.success{ color:#10b981; }
.sf-note.error{ color:#ef4444; }
