/* CSS RESET & NORMALIZE */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
main, menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  box-sizing: border-box;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, main, menu, nav, section {
  display: block;
}
body {
  line-height: 1.5;
}
ol, ul {
  list-style: none;
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}
input, button, textarea, select {
  font: inherit;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
}

/* ROOT VARIABLES */
:root {
  --color-primary: #08203A;
  --color-secondary: #FFCC29;
  --color-accent: #EDEDED;
  --color-bg: #fff;
  --color-footer-bg: #fafbfc;
  --color-link: var(--color-primary);
  --color-link-hover: #19355A;
  --color-cta: var(--color-secondary);
  --color-cta-hover: #ffd952;
  --color-shadow: rgba(8,32,58,0.06);
  --color-text: #102035;
  --color-grey: #6A7587;
  --font-display: 'Roboto Slab', serif;
  --font-body: 'Open Sans', Arial, sans-serif;
  --border-radius: 12px;
  --header-height: 64px;
  --z-index-header: 30;
  --z-index-mobile-menu: 1000;
  --z-index-cookie: 2000;
}

@media (max-width: 480px) {
  :root {
    --header-height: 54px;
    --border-radius: 8px;
  }
}

/* BODY & TYPOGRAPHY */
body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-primary);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
h1 { font-size: 2.75rem; font-weight: 700; line-height: 1.1; }
h2 { font-size: 2rem; font-weight: 600; line-height: 1.15; }
h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.2; }
h4 { font-size: 1.125rem; font-weight: 500; line-height: 1.3; }
p, li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 10px;
}
small {
  font-size: 0.92em;
  color: var(--color-grey);
}
strong {
  font-weight: 700;
  color: var(--color-primary);
}

/* LINKS & CTA BUTTONS */
a {
  color: var(--color-link);
  transition: color 0.15s;
}
a:hover, a:focus {
  color: var(--color-link-hover);
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cta);
  color: var(--color-primary);
  font-weight: bold;
  font-size: 1.05rem;
  padding: 13px 32px;
  border-radius: var(--border-radius);
  margin-top: 18px;
  box-shadow: 0 2px 8px var(--color-shadow);
  transition: background 0.18s, color 0.18s, box-shadow 0.2s;
  border: none;
  outline: none;
  min-width: 180px;
}
.cta-btn:hover, .cta-btn:focus {
  background: var(--color-cta-hover);
  color: var(--color-primary);
  box-shadow: 0 6px 24px var(--color-shadow);
}

/* LAYOUT CONTAINERS */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}
.content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.section {
  margin-bottom: 60px;
  padding: 40px 20px;
}

/* FLEX LAYOUT PATTERNS (MANDATORY) */
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card {
  margin-bottom: 20px;
  position: relative;
  background: var(--color-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 12px var(--color-shadow);
  overflow: hidden;
  min-width: 260px;
  display: flex;
  flex-direction: column;
}
.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;
  margin-bottom: 20px;
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 10px var(--color-shadow);
  transition: box-shadow 0.18s, transform 0.17s;
  min-width: 260px;
}
.testimonial-card:hover {
  box-shadow: 0 8px 32px var(--color-shadow);
  transform: translateY(-2px) scale(1.022);
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

/* HERO SECTIONS */
.hero {
  background: var(--color-accent);
  min-height: 360px;
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  padding: 0 0 40px 0;
}
.hero .container { width: 100%; }
.hero h1 {
  color: var(--color-primary);
  margin-bottom: 20px;
}
.hero p {
  color: var(--color-text);
  margin-bottom: 14px;
}

/* FEATURES GRID (generalized for all .features-grid in HTML) */
.features-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 18px;
}
.features-grid > div {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: 0 1.5px 10px var(--color-shadow);
  padding: 24px 18px 20px 18px;
  flex: 1 1 260px;
  min-width: 260px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.13s, transform 0.13s;
}
.features-grid > div:hover {
  box-shadow: 0 8px 40px var(--color-shadow);
  transform: translateY(-2px) scale(1.012);
}

/* SECTION & CARD SPACING */
section {
  margin-bottom: 60px;
}
section:last-child {
  margin-bottom: 0;
}

/* UL LI LISTS in sections */
section ul {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
section ul li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: var(--border-radius);
  padding: 12px 16px;
  font-size: 1rem;
  box-shadow: 0 1.2px 8px var(--color-shadow);
}
section ul li img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Testimonial quote text readable on white (contrast) */
.testimonial-card p, .testimonial-card span {
  color: #233243;
}
.testimonial-card span {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.34rem; }
  .features-grid > div { min-width: 170px; max-width: 100%; padding: 16px 12px 14px 12px; }
  .testimonial-card, .card {
    padding: 14px;
  }
}

/* Responsive LAYOUTS: Mobile-first (column), desktop (row) */
.text-image-section,
.features-grid,
.card-container,
.content-grid,
section ul {
  flex-direction: column;
  gap: 18px;
}
@media (min-width: 769px) {
  .text-image-section { flex-direction: row; }
  .features-grid,
  .card-container,
  .content-grid, 
  section ul { flex-direction: row; }
}

@media (max-width: 768px) {
  .section { margin-bottom: 32px; padding: 26px 7vw; }
  .hero { min-height: 220px; padding: 0 0 26px 0; }
}
@media (max-width: 480px) {
  .section { margin-bottom: 24px; padding: 14px 2vw; }
  .hero { min-height: 120px; padding: 6vw 0 14px 0; }
}

/* HEADER & NAV */
header {
  width: 100%;
  background: var(--color-bg);
  box-shadow: 0 1px 12px var(--color-shadow);
  position: sticky;
  top: 0;
  z-index: var(--z-index-header);
}
header .container {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
header nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
header nav a {
  color: var(--color-link);
  font-weight: 500;
  font-size: 1rem;
  opacity: 0.84;
  padding: 8px 7px;
  transition: color 0.15s, opacity 0.18s;
  border-radius: 7px;
}
header nav a:hover, header nav a:focus {
  color: var(--color-primary);
  background: var(--color-accent);
  opacity: 1;
}
header nav .cta-btn {
  margin-left: 10px;
}
header img[alt="AutoPorównania"] {
  height: 42px;
  margin-right: 14px;
}
@media (max-width: 1023px) {
  header nav {
    gap: 8px;
  }
  header img[alt="AutoPorównania"] {
    height: 36px;
  }
}
@media (max-width: 950px) {
  header nav a:not(.cta-btn) {
    font-size: 0.97rem;
    padding: 6px 2px;
  }
  .cta-btn { min-width: 120px; font-size: 1rem; }
}

/* MOBILE NAVIGATION */
.mobile-menu-toggle {
  display: none;
  background: var(--color-accent);
  color: var(--color-primary);
  border: none;
  border-radius: 7px;
  width: 42px;
  height: 42px;
  font-size: 1.7rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 8px var(--color-shadow);
  margin-left: 10px;
  transition: background 0.18s, color 0.2s;
  z-index: var(--z-index-header);
}
.mobile-menu-toggle:hover, .mobile-menu-toggle:focus {
  background: var(--color-secondary);
  color: var(--color-primary);
}
@media (max-width: 950px) {
  header nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: flex;
  }
}

.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8,32,58, 0.86);
  z-index: var(--z-index-mobile-menu);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(.62,1.25,.22,1), opacity 0.22s;
  opacity: 0;
  pointer-events: none;
}
.mobile-menu.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu-close {
  margin: 32px 24px 8px 0;
  padding: 0;
  font-size: 2.2rem;
  border: none;
  background: var(--color-secondary);
  color: var(--color-primary);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  display: flex;
  box-shadow: 0 3px 14px var(--color-shadow);
  transition: background 0.15s, color 0.13s;
  z-index: var(--z-index-mobile-menu);
}
.mobile-menu-close:hover, .mobile-menu-close:focus {
  background: #ffe486;
}
.mobile-nav {
  width: 85vw;
  max-width: 360px;
  background: #fff;
  border-radius: 16px 0 0 16px;
  margin-top: 4px;
  flex-direction: column;
  display: flex;
  gap: 0;
  box-shadow: -2px 0 26px var(--color-shadow);
  min-height: 80vh;
  padding: 38px 0 16px 0;
}
.mobile-nav a {
  color: var(--color-primary);
  font-size: 1.15rem;
  font-weight: 500;
  padding: 18px 28px;
  margin: 0;
  border-bottom: 1px solid #f2f3f6;
  transition: background 0.13s, color 0.14s;
  border-radius: 0;
}
.mobile-nav a:last-child {
  border-bottom: none;
}
.mobile-nav a:hover, .mobile-nav a:focus {
  background: var(--color-accent);
  color: var(--color-link-hover);
}

@media (min-width: 951px) {
  .mobile-menu, .mobile-menu-toggle { display: none !important; }
}

/* MAIN & FOOTER */
main {
  width: 100%;
  padding-bottom: 50px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
footer {
  background: var(--color-footer-bg);
  width: 100%;
  margin-top: 32px;
  box-shadow: 0 -1.5px 14px var(--color-shadow);
  padding: 38px 0 0 0;
}
footer .container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
footer .content-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 42px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
footer nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 160px;
}
footer nav a {
  color: var(--color-link);
  font-size: 1rem;
  opacity: 0.78;
  margin-bottom: 3px;
  transition: color 0.15s, opacity 0.16s;
}
footer nav a:hover, footer nav a:focus {
  color: var(--color-link-hover);
  opacity: 1;
}
footer .contact-info {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.97rem;
  color: var(--color-text);
}
footer .contact-info img {
  width: 20px;
  margin-right: 7px;
  opacity: 0.90;
}
footer .newsletter-signup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  color: var(--color-grey);
}
footer .social-links {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 100px;
}
footer .social-links a img {
  width: 32px; height: 32px;
  opacity: 0.84;
  transition: opacity 0.13s, transform 0.15s;
}
footer .social-links a:hover img {
  opacity: 1;
  transform: scale(1.08);
}
footer .copyright { justify-content: center; align-items: center; margin-bottom: 0; }
footer .copyright small { color: var(--color-grey); }
@media (max-width: 850px) {
  footer .content-wrapper {
    flex-wrap: wrap;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
}

/* 'About us' text section formatting */
.text-section {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.text-section h3 {
  margin-top: 18px;
  color: var(--color-primary);
}

/* Newsletter section (CTA) */
.newsletter-signup h4 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  color: var(--color-primary);
}

/* Cookie Consent Banner Styles */
.cookie-banner {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  width: 100vw;
  background: #fff;
  border-top: 2px solid var(--color-accent);
  box-shadow: 0 -4px 32px var(--color-shadow);
  padding: 20px 15px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 17px;
  align-items: center;
  z-index: var(--z-index-cookie);
  transition: transform 0.33s cubic-bezier(.7,1.25,.22,1), opacity 0.18s;
  font-size: 1rem;
}
.cookie-banner.hide { transform: translateY(120%); opacity: 0; pointer-events: none; }
.cookie-banner.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.cookie-banner strong { color: var(--color-primary); }
.cookie-banner-buttons {
  display: flex;
  gap: 18px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.cookie-banner .cookie-btn {
  padding: 10px 24px;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  background: var(--color-cta);
  color: var(--color-primary);
  margin: 0;
  transition: background 0.15s, color 0.13s, box-shadow 0.16s;
  box-shadow: 0 2px 8px var(--color-shadow);
}
.cookie-btn.settings {
  background: var(--color-bg);
  color: var(--color-link-hover);
  border: 1.2px solid #e3e3e3;
}
.cookie-banner .cookie-btn:hover, .cookie-banner .cookie-btn:focus {
  background: var(--color-cta-hover);
  color: var(--color-link-hover);
}
.cookie-banner .cookie-btn.settings:hover,
.cookie-banner .cookie-btn.settings:focus {
  background: #f5f5f5;
  color: var(--color-primary);
  border-color: var(--color-secondary);
}

/* Cookie Preferences Modal */
.cookie-modal-backdrop {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(18,31,46,0.60);
  z-index: calc(var(--z-index-cookie) + 1);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.cookie-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.cookie-modal {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 60px var(--color-shadow);
  max-width: 420px;
  width: 93vw;
  padding: 34px 22px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  animation: cookieModalFadeIn 0.38s cubic-bezier(.65,1.04,.32,1);
}
@keyframes cookieModalFadeIn {
  from { transform: translateY(32px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.cookie-modal h2 { font-size: 1.28rem; color: var(--color-primary); margin-bottom: 8px; }
.cookie-modal-close {
  position: absolute;
  top: 17px; right: 17px;
  background: var(--color-accent);
  color: var(--color-primary);
  border: none;
  border-radius: 50%;
  font-size: 1.36rem;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  display: flex;
}
.cookie-category-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 5px;
  margin-bottom: 19px;
}
.cookie-category {
  display: flex;
  align-items: center;
  gap: 16px;
}
.cookie-category label {
  font-size: 1rem;
  color: var(--color-text);
  font-weight: 500;
}
.cookie-category .toggle-switch {
  position: relative;
  width: 48px; height: 26px;
  display: inline-block;
}
.toggle-switch input {
  opacity: 0; width: 0; height: 0;
}
.toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #e1e5ea;
  border-radius: 26px;
  transition: background 0.18s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--color-secondary);
}
.toggle-slider:before {
  content: '';
  position: absolute;
  left: 4px; top: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(80,80,80,0.09);
  transition: transform 0.15s;
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}
.cookie-category .always-on {
  color: var(--color-grey);
  font-size: 0.96rem;
  margin-left: 3px;
}
.cookie-modal-actions {
  display: flex; gap: 13px; margin-top: 4px;
  flex-wrap: wrap;
}
.cookie-modal-actions .cookie-btn {
  padding: 9px 22px; font-size: 1rem;
}

/* Hide modal on small screens (optional improvement) */
@media (max-width: 600px) {
  .cookie-modal { max-width: 98vw; padding: 13vw 5vw 9vw 5vw; }
}

/* Scroll bar minimalism */
::-webkit-scrollbar { width: 8px; background: #f2f2f2; }
::-webkit-scrollbar-thumb {
  background: #e0e0e0; border-radius: 8px;
}

/* MICRO-INTERACTIONS */
.card, .features-grid > div, .testimonial-card {
  transition: box-shadow 0.22s, transform 0.16s;
}
.card:hover, .features-grid > div:hover, .testimonial-card:hover {
  box-shadow: 0 8px 40px var(--color-shadow);
  transform: translateY(-3px) scale(1.012);
}

@media (max-width: 680px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.11rem; }
}

/* ACCENTUATE VISUAL HIERARCHY AND SPACING */
section h2 {
  margin-top: 12px;
  margin-bottom: 10px;
  color: var(--color-primary);
}
section h3 {
  margin-bottom: 5px;
  margin-top: 8px;
  color: var(--color-primary);
}

/* Prevent overlapping, safe spacing everywhere */
section, .card, .testimonial-card, .features-grid > div,
.card-container > *, .content-grid > *, .feature-item > * {
  margin-right: 0;
  margin-left: 0;
  margin-top: 0;
  margin-bottom: 0;
}

@media (max-width: 390px) {
  .cta-btn { font-size: 0.965rem; padding: 10px 8vw; min-width: 90vw; }
  .features-grid > div { min-width: 98vw; }
}

/* End of CSS */
