/* ------------------------------------------------------------
   AffriPupin Tech Serwis – Scandinavian Clean UI
   Mobile-first, flexbox-only layout system
   Fonts: Montserrat (display), Inter (body)
   Brand colors: primary #0D3B66, secondary #2E7D32, accent #F4F7FB
   ------------------------------------------------------------ */

/* Google Fonts (simple, highly readable) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@600;700&display=swap');

/* ------------------------------------------------------------
   CSS Reset / Normalize (lightweight)
------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0 0 16px 24px; padding: 0; }
h1, h2, h3, h4, h5, h6, p { margin: 0 0 12px; }
a { color: inherit; text-decoration-skip-ink: auto; }
button { font: inherit; background: none; border: none; color: inherit; cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 3px solid rgba(13,59,102,0.35); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------
   Theme Variables & Fallbacks
------------------------------------------------------------ */
:root {
  --primary: #0D3B66;
  --secondary: #2E7D32;
  --accent: #F4F7FB;
  --bg: #F7F8F9;
  --surface: #FFFFFF;
  --text: #1F2937;
  --muted: #5B728A;
  --border: #E5EAF0;
  --shadow: 0 1px 2px rgba(13,59,102,0.06), 0 8px 24px rgba(13,59,102,0.08);
}

/* ------------------------------------------------------------
   Base Typography & Body
------------------------------------------------------------ */
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: #FAFBFC;
  letter-spacing: 0.1px;
}

h1, h2, h3, h4 { font-family: "Montserrat", "Inter", system-ui, sans-serif; color: #0E2431; }
h1 { font-size: 32px; line-height: 1.2; letter-spacing: 0.2px; }
h2 { font-size: 24px; line-height: 1.25; margin-bottom: 8px; }
h3 { font-size: 18px; line-height: 1.3; }
@media (min-width: 768px) { h1 { font-size: 40px; } h2 { font-size: 28px; } h3 { font-size: 20px; } }
@media (min-width: 1024px) { h1 { font-size: 48px; } h2 { font-size: 32px; } h3 { font-size: 22px; } }

p { color: var(--text); font-size: 16px; line-height: 1.7; }
small, .small { font-size: 14px; color: var(--muted); }

/* Links */
a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: #0A2F52; }
a.btn-primary, a.btn-secondary { text-decoration: none; }

/* ------------------------------------------------------------
   Layout Primitives (Flexbox-only)
------------------------------------------------------------ */
.container {
  width: 100%;
  padding: 0 16px;
  display: flex;               /* flex-only layout */
  justify-content: center;     /* center the inner wrapper */
}
.content-wrapper {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  display: flex;               /* flex-only layout */
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

/* Universal section spacing to get Scandinavian breathing room */
section { padding: 40px 0; }
section + section { border-top: 1px solid var(--border); }

/* MANDATORY PATTERNS */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; background: #FFFFFF; border: 1px solid var(--border); border-left: 6px solid var(--primary); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Responsive alignment rules for text-image sections */
@media (max-width: 768px) { .text-image-section { flex-direction: column; } }

/* ------------------------------------------------------------
   Topbar & Header
------------------------------------------------------------ */
.topbar { background: var(--accent); color: #2E3A46; font-size: 14px; border-bottom: 1px solid var(--border); }
.topbar .content-wrapper { flex-direction: row; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.topbar a { color: var(--primary); font-weight: 600; }

header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; }
header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.logo img { height: 40px; width: auto; }

/* Desktop main navigation */
.main-nav { display: none; align-items: center; gap: 12px; flex-wrap: wrap; }
.main-nav a { color: #0E2431; padding: 8px 10px; border-radius: 8px; transition: background-color 180ms ease, color 180ms ease; }
.main-nav a:hover { background: var(--accent); color: var(--primary); }
.main-nav a[aria-current="page"] { color: var(--primary); background: #EAF2F9; }

    .main-nav .btn-primary{
        color: #fff;
    }
    /* Mobile burger */
    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 10px;
        background: var(--accent);
        color: #0E2431;
        transition: background-color 180ms ease, transform 180ms ease;
    }
.mobile-menu-toggle:hover { background: #EAF0F5; transform: translateY(-1px); }

@media (min-width: 992px) {
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0; background: #FFFFFF; display: flex; flex-direction: column; gap: 12px; padding: 16px; transform: translateX(100%);
  transition: transform 280ms ease; z-index: 1400; box-shadow: var(--shadow);
}
.mobile-menu.open { transform: translateX(0%); }
.mobile-menu-close { align-self: flex-end; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--accent); color: #0E2431; }
.mobile-nav { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; }
.mobile-nav a { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 10px; color: #0E2431; text-decoration: none; }
.mobile-nav a:hover { background: var(--accent); color: var(--primary); }
.mobile-nav a[aria-current="page"] { background: #EAF2F9; color: var(--primary); }

/* ------------------------------------------------------------
   Hero
------------------------------------------------------------ */
.hero { background: var(--accent); border-bottom: 1px solid var(--border); }
.hero .content-wrapper { align-items: flex-start; gap: 16px; }
.hero p { max-width: 70ch; }
.hero ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.hero li { display: flex; align-items: center; gap: 8px; color: #0E2431; background: #FFFFFF; border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; }
.hero li img { width: 18px; height: 18px; }

/* ------------------------------------------------------------
   Buttons
------------------------------------------------------------ */
.btn-primary, .btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; min-height: 44px; border-radius: 12px; font-weight: 600; transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 120ms ease; }

.btn-primary { background: var(--primary); color: #FFFFFF; box-shadow: 0 1px 2px rgba(13,59,102,0.2); }
.btn-primary:hover { background: #0A2F52; box-shadow: 0 4px 16px rgba(13,59,102,0.22); transform: translateY(-1px); color: #fff; }

.btn-secondary { background: #FFFFFF; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-secondary:hover { background: #EAF2F9; }

/* Text blocks as clean cards where applicable */
.text-section { background: #FFFFFF; border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }

/* Lists inside content areas */
.content-wrapper > ul, .content-wrapper > ol { margin-left: 18px; }
.content-wrapper > ul li, .content-wrapper > ol li { margin-bottom: 6px; }

/* ------------------------------------------------------------
   Testimonials – dark text on light background (contrast ensured)
------------------------------------------------------------ */
.testimonial-card p { margin: 0; color: #0E2431; }
.testimonial-card strong { color: var(--primary); }

/* ------------------------------------------------------------
   Footer
------------------------------------------------------------ */
footer { background: #FFFFFF; border-top: 1px solid var(--border); }
footer .content-wrapper { flex-direction: row; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
footer nav { display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
footer nav h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
footer a { color: #334155; text-decoration: none; }
footer a:hover { color: var(--primary); text-decoration: underline; }

/* ------------------------------------------------------------
   Cards & Hover elevation
------------------------------------------------------------ */
.card:hover, .text-section:hover, .testimonial-card:hover { box-shadow: 0 6px 22px rgba(13,59,102,0.08); transform: translateY(-1px); transition: transform 140ms ease, box-shadow 140ms ease; }

/* ------------------------------------------------------------
   Utilities
------------------------------------------------------------ */
.muted { color: var(--muted); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }

/* ------------------------------------------------------------
   Responsive adjustments
------------------------------------------------------------ */
@media (min-width: 768px) {
  .content-wrapper { gap: 20px; }
}

@media (min-width: 992px) {
  /* Distribute inline sections elegantly while keeping flex-only */
  .content-wrapper.wide, main .container .content-wrapper { gap: 24px; }
  /* Make repeated .text-section siblings flow in rows when there are many */
  .content-wrapper > .text-section { flex: 1 1 320px; }
  .content-wrapper { flex-wrap: wrap; }
  .content-wrapper > h1, .content-wrapper > h2, .content-wrapper > h3, .content-wrapper > p, .content-wrapper > ol, .content-wrapper > ul, .content-wrapper > div:has(> .btn-primary), .content-wrapper > div:has(> .btn-secondary) { flex-basis: 100%; }
}

/* Note: The :has selector isn’t widely supported everywhere; the above lines are progressive enhancement. The layout works without it. */

/* ------------------------------------------------------------
   Mobile Menu Animations (slide in/out)
------------------------------------------------------------ */
.mobile-menu { will-change: transform; }

/* ------------------------------------------------------------
   Cookie Consent Banner & Modal (flex-only)
------------------------------------------------------------ */
.cookie-banner {
  position: fixed; left: 20px; right: 20px; bottom: 20px;
  background: #FFFFFF; color: #0E2431; border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 16px; display: none; z-index: 1500;
  display: none; /* default hidden */
}
.cookie-banner.show { display: flex; }
.cookie-banner { display: none; }
.cookie-banner.show { display: flex; }
.cookie-banner { flex-direction: column; gap: 12px; }
.cookie-banner .cookie-text { display: flex; flex-direction: column; gap: 8px; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-banner .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.cookie-banner .btn-accept { background: var(--primary); color: #fff; }
.cookie-banner .btn-accept:hover { background: #0A2F52; }
.cookie-banner .btn-reject { background: #FFFFFF; color: #0E2431; border: 1.5px solid #CBD5E1; }
.cookie-banner .btn-reject:hover { background: #F6F8FB; }
.cookie-banner .btn-settings { background: #EAF2F9; color: var(--primary); }
.cookie-banner .btn-settings:hover { background: #DFEBF6; }

@media (min-width: 768px) {
  .cookie-banner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* Cookie Preferences Modal */
.cookie-modal {
  position: fixed; inset: 0; display: none; z-index: 1600; align-items: center; justify-content: center; padding: 20px;
}
.cookie-modal.open { display: flex; }
.cookie-modal .cookie-overlay { position: absolute; inset: 0; background: rgba(14,36,49,0.45); }
.cookie-modal .cookie-dialog {
  position: relative; background: #FFFFFF; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 16px; padding: 16px;
}
.cookie-dialog .cookie-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cookie-dialog .cookie-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-dialog .cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.cookie-dialog .cookie-footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.cookie-close { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; }

/* Toggle switch (for Analytics/Marketing) */
.toggle { position: relative; width: 44px; height: 26px; background: #CBD5E1; border-radius: 999px; flex: 0 0 auto; transition: background-color 160ms ease; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #FFFFFF; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.15); transition: transform 160ms ease; }
.toggle.active { background: var(--secondary); }
.toggle.active::after { transform: translateX(18px); }

/* ------------------------------------------------------------
   Accessibility & Contrast in reviews/testimonials
------------------------------------------------------------ */
[aria-label="Menu mobilne"] a, [aria-label="Główna nawigacja"] a { line-height: 1.2; }

/* ------------------------------------------------------------
   Additional polish for Scandinavian clean feel
   - airy spacing ratios using 8/16/24/32px rhythm
   - light borders, soft corners, subtle shadows
------------------------------------------------------------ */
.content-wrapper > p:last-child { margin-bottom: 0; }
.text-section h3 { color: #0E2431; }
.text-section p { color: #314457; }

/* Ensure adequate gaps between sequential blocks */
.content-wrapper > * + * { margin-top: 0; }

/* ------------------------------------------------------------
   Page-specific small refinements
------------------------------------------------------------ */
/* Index lists and CTA blocks */
main .content-wrapper > div:has(> .btn-primary),
main .content-wrapper > div:has(> .btn-secondary) { display: flex; flex-wrap: wrap; gap: 10px; }

/* Ordered lists appearance */
ol { padding-left: 18px; }
ol li { margin-bottom: 6px; }

/* Contact links */
a[href^="tel:"] { white-space: nowrap; }

/* ------------------------------------------------------------
   Print-safe defaults for content pages
------------------------------------------------------------ */
@media print {
  header, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: underline; color: #000; }
}

/* ------------------------------------------------------------
   End of stylesheet
------------------------------------------------------------ */
