/* ------------------ 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, 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;
}
html { height: 100%; }
body { line-height: 1; min-height: 100vh; background: #F6F6F2; }
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
table { border-collapse: collapse; border-spacing: 0; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
img { max-width: 100%; display: block; }

:root {
  --rcf-primary: #222E2B;
  --rcf-secondary: #8D6742;
  --rcf-accent: #F6F6F2;
  --rcf-electric-blue: #2991F8;
  --rcf-electric-orange: #FF6A1A;
  --rcf-electric-yellow: #FFF229;
  --rcf-success: #19DF6B;
  --rcf-danger: #FF2655;
  --rcf-dark: #1A1A1A;
  --rcf-text: #222E2B;
  --rcf-card-bg: #fff;
  --rcf-border: #e7e7df;
  --rcf-radius: 16px;
  --rcf-shadow: 0 4px 20px rgba(34,46,43,0.09), 0 2px 8px rgba(41,145,248,.07);
  --rcf-transition: all 0.2s cubic-bezier(.4,0,.2,1);
}

/* -------------- TYPOGRAPHY & BASE STYLES -------------- */
body {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 16px;
  background: var(--rcf-accent);
  color: var(--rcf-primary);
}
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', 'Roboto', Arial, sans-serif;
  font-weight: bold;
  color: var(--rcf-primary);
  letter-spacing: -0.5px;
}
h1 { font-size: 2.6rem; line-height: 1.13; margin-bottom: 18px; }
h2 { font-size: 2rem; line-height: 1.2; margin-bottom: 14px; }
h3 { font-size: 1.4rem; line-height: 1.2; margin-bottom: 8px; }
h4 { font-size: 1.12rem; }
p, ul, ol, li {
  font-size: 1rem;
  font-family: 'Roboto', Arial, sans-serif;
  color: var(--rcf-primary);
  margin-bottom: 14px;
}
p:last-child { margin-bottom: 0; }
strong, b { color: var(--rcf-secondary); font-weight: bold; }
.text-section a, .content-wrapper a { color: var(--rcf-electric-blue); font-weight: 500; text-decoration: underline; }
.text-section a:hover, .content-wrapper a:hover { color: var(--rcf-electric-orange); }

/* Typography scale for headings (mobile first, enhanced on desktop) */
@media (min-width: 600px) {
  h1 { font-size: 3.2rem; }
  h2 { font-size: 2.4rem; }
  h3 { font-size: 1.8rem; }
}

/* -------------- CONTAINER & SECTION PATTERNS -------------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: none;
  border-radius: var(--rcf-radius);
}
.text-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 0;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .text-image-section {
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
  }
}

/* -------------- HEADER & NAVIGATION -------------- */
header {
  width: 100%;
  background: var(--rcf-primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1010;
  box-shadow: 0 3px 16px rgba(34,46,43,0.07);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.8rem;
}
header > a img {
  height: 40px;
}
header nav {
  display: flex;
  gap: 24px;
  align-items: center;
}
header nav a {
  font-family: 'Montserrat', 'Roboto', Arial, sans-serif;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 8px 0;
  position: relative;
  transition: color 0.17s linear;
}
header nav a:hover,
header nav a.active {
  color: var(--rcf-electric-yellow);
}
.btn-primary {
  background: var(--rcf-electric-blue);
  color: #fff!important;
  font-family: 'Montserrat', 'Roboto', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.06rem;
  border-radius: 999px;
  padding: 13px 34px;
  box-shadow: 0 2px 12px rgba(41,145,248, 0.14);
  border: none;
  cursor: pointer;
  margin-left: 22px;
  transition: var(--rcf-transition);
  letter-spacing: 0.015em;
  outline: none;
  position: relative;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--rcf-electric-orange);
  color: #fff;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 24px rgba(255,106,26, 0.13);
}
.mobile-menu-toggle {
  display: none;
  background: var(--rcf-electric-orange);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  margin-left: 22px;
  padding: 5px 14px;
  transition: background 0.18s;
  z-index: 1200;
}
.mobile-menu-toggle:focus,
.mobile-menu-toggle:hover {
  background: var(--rcf-electric-blue);
}

@media (max-width: 1024px) {
  header nav { gap: 10px; }
  .btn-primary { margin-left: 8px; padding: 11px 18px; font-size: 0.96rem; }
  header > a img { height: 32px; }
}
@media (max-width: 900px) {
  header nav, .btn-primary { display: none; }
  .mobile-menu-toggle { display: block; }
}

/* --------- MOBILE MENU OVERLAY --------- */
.mobile-menu {
  position: fixed;
  z-index: 1800;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(34,46,43, 0.97);
  display: flex;
  flex-direction: column;
  transform: translateX(-100vw);
  transition: transform .38s cubic-bezier(.68,-0.55,.27,1.35);
  pointer-events: none;
}
.mobile-menu.open {
  transform: translateX(0);
  pointer-events: all;
}
.mobile-menu-close {
  align-self: flex-end;
  margin: 24px 24px 0 0;
  background: var(--rcf-electric-orange);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 2.4rem;
  cursor: pointer;
  padding: 6px 18px;
  transition: background 0.13s;
  box-shadow: 0 2px 12px rgba(255,106,26, 0.11);
}
.mobile-menu-close:hover, .mobile-menu-close:focus {
  background: var(--rcf-electric-blue);
}
.mobile-nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
}
.mobile-nav a {
  font-family: 'Montserrat', 'Roboto', Arial, sans-serif;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 14px 0;
  text-align: center;
  min-width: 180px;
  border-radius: 8px;
  transition: background 0.13s, color 0.19s;
}
.mobile-nav a:hover, .mobile-nav a:focus {
  background: var(--rcf-electric-orange);
  color: #fff;
}
@media (max-width: 530px) {
  .mobile-nav a { font-size: 1.16rem; padding: 13px 0; min-width: 80vw; }
  .mobile-menu-close { font-size: 2rem; margin: 13px 13px 0 0; padding: 5px 13px; }
}

/* -------------- SECTION & GRID LAYOUTS (MANDATORY PATTERNS) -------------- */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.card {
  background: var(--rcf-card-bg);
  border-radius: var(--rcf-radius);
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--rcf-shadow);
  padding: 32px 28px;
  min-width: 260px;
}
.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  background: var(--rcf-electric-yellow);
  border-radius: var(--rcf-radius);
  padding: 24px 20px;
  box-shadow: 0 2px 8px rgba(255,242,41, 0.10);
  font-weight: 600;
}
.testimonial-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: #fff;
  border-radius: var(--rcf-radius);
  box-shadow: 0 2px 16px rgba(41,145,248, 0.1), 0 1px 2px rgba(34,46,43,0.04);
  margin-bottom: 20px;
  position: relative;
  max-width: 440px;
  border-left: 5px solid var(--rcf-electric-orange);
}
.testimonial-card p {
  color: var(--rcf-primary);
  font-size: 1.08rem;
  margin-bottom: 8px;
}
.testimonial-meta {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--rcf-electric-blue);
  opacity: 0.93;
}
@media (max-width: 830px) {
  .testimonial-card { max-width: 100%; }
}

/* --------- Service Cards & Blog Preview .........*/
.service-card {
  background: #fff;
  border-radius: var(--rcf-radius);
  box-shadow: var(--rcf-shadow);
  padding: 26px 22px;
  min-width: 250px;
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 5px solid var(--rcf-electric-blue);
  transition: transform 0.18s, box-shadow 0.18s;
}
.service-card:hover {
  transform: translateY(-6px) scale(1.025);
  box-shadow: 0 5px 24px 2px rgba(41,145,248, 0.13);
  border-color: var(--rcf-electric-orange);
}

.blog-preview {
  background: #fff;
  border-radius: var(--rcf-radius);
  box-shadow: 0 1px 10px rgba(34,46,43,0.09);
  padding: 20px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 4px solid var(--rcf-secondary);
  transition: box-shadow 0.19s;
}
.blog-preview .tag {
  display: inline-block;
  padding: 4px 13px;
  border-radius: 999px;
  background: var(--rcf-electric-blue);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 9px;
}
.blog-preview:hover {
  box-shadow: 0 5px 24px 2px rgba(141,103,66, .12);
  border-color: var(--rcf-electric-orange);
}

/* CTA-Banner Style (used in .cta-banner) */
.cta-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--rcf-electric-blue);
  color: #fff;
  border-radius: var(--rcf-radius);
  gap: 24px;
  margin: 0 auto;
  padding: 32px 20px;
  box-shadow: 0 2px 24px rgba(41,145,248,.11);
  text-align: center;
  font-size: 1.22rem;
}
.cta-banner strong { color: var(--rcf-yellow, #FFF229); font-weight: 800; }
.cta-banner a.btn-primary {
  font-size: 1.1rem;
  margin-left: 0;
  margin-top: 12px;
}

/* FAQ styles */
.faq-group {
  background: #fff;
  border-radius: var(--rcf-radius);
  box-shadow: var(--rcf-shadow);
  padding: 24px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 4px solid var(--rcf-electric-blue);
}
.faq-group h3 { margin-bottom: 2px; }

/* -------------- LISTS & ICON-LISTS -------------- */
ul {
  list-style: none;
  padding-left: 0px;
  margin-bottom: 16px;
}
li {
  display: flex;
  align-items: start;
  gap: 8px;
  font-size: 1rem;
  margin-bottom: 8px;
}
li img {
  height: 22px;
  width: 22px;
  margin-right: 6px;
  flex-shrink: 0;
  display: inline-block;
}
@media (max-width: 680px) {
  .service-card, .faq-group, .feature-item {
    padding: 17px 9px;
  }
  .cta-banner { padding: 18px 8px; }
}

/* -------------- FOOTER STYLES -------------- */
footer {
  width: 100%;
  background: var(--rcf-primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 32px 0 18px 0;
  gap: 16px;
  font-size: 1rem;
  margin-top: 60px;
}
footer .footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  margin-bottom: 12px;
}
footer .footer-nav a {
  color: #fff;
  font-family: 'Montserrat', 'Roboto', Arial, sans-serif;
  font-weight: 600;
  transition: color 0.15s;
}
footer .footer-nav a:hover { color: var(--rcf-electric-yellow); }
footer .footer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 1.01rem;
}
footer .footer-info p {
  display: flex;
  align-items: center;
  color: #fff;
  gap: 8px;
  margin: 0; padding: 0 0 6px 0;
}
footer .footer-info img, footer .footer-brand img {
  height: 19px;
  width: auto;
  vertical-align: middle;
}
footer .footer-brand {
  display: flex;
  justify-content: center;
  margin: 16px 0 0 0;
}
footer .footer-brand img {
  height: 40px;
}
@media (max-width: 700px) {
  footer .footer-info { flex-direction: column; gap: 8px; font-size: 0.97rem; }
}

/* -------------- SPACING (between sections/cards) -------------- */
section:not(:last-child) {
  margin-bottom: 60px;
}
.content-wrapper > * { margin-bottom: 20px; }
.content-wrapper > *:last-child { margin-bottom: 0; }
.card-container > *, .content-grid > *, .testimonial-card, .service-card, .faq-group, .blog-preview, .feature-item {
  margin-bottom: 0;
} /* Card gap handled by flex gap */

/* ----------- BUTTONS & INTERACTION ----------- */
button, .btn-primary, .mobile-menu-toggle, .mobile-menu-close {
  transition: var(--rcf-transition);
}
button:focus-visible, .btn-primary:focus-visible, .mobile-menu-toggle:focus-visible, .mobile-menu-close:focus-visible {
  outline: 3px solid var(--rcf-electric-blue);
  outline-offset: 2px;
}

/* Fade-in Animation for Sections */
@media (prefers-reduced-motion: no-preference) {
  .section, .service-card, .testimonial-card, .faq-group, .blog-preview, .feature-item, .cta-banner {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeInUp .8s cubic-bezier(.45,.2,.25,1) forwards;
    animation-delay: 0.13s;
  }
  .section:nth-of-type(1), .service-card:nth-child(1), .testimonial-card:nth-child(1), .faq-group:nth-child(1), .blog-preview:nth-child(1) { animation-delay: 0.19s; }
  .section:nth-of-type(2), .service-card:nth-child(2), .testimonial-card:nth-child(2), .faq-group:nth-child(2), .blog-preview:nth-child(2) { animation-delay: 0.27s; }
  .section:nth-of-type(3), .service-card:nth-child(3), .testimonial-card:nth-child(3), .faq-group:nth-child(3), .blog-preview:nth-child(3) { animation-delay: 0.37s; }
}
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------- COOKIE CONSENT BANNER ------------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: #fff;
  color: var(--rcf-primary);
  box-shadow: 0 -2px 18px 0px rgba(34,46,43,0.09);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  z-index: 2100;
  gap: 18px;
  font-size: 1.08rem;
  transition: transform 0.33s cubic-bezier(.55,-0.18,.11,1.09), opacity 0.22s linear;
  transform: translateY(0);
  opacity: 1;
}
.cookie-banner.hide {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}
.cookie-banner__message {
  flex: 1 1 60%;
  color: var(--rcf-primary);
}
.cookie-banner__actions {
  display: flex;
  gap: 13px;
}
.cookie-btn, .cookie-btn-alt {
  border: none;
  outline: none;
  border-radius: 20px;
  padding: 9px 24px;
  font-family: 'Montserrat', 'Roboto', Arial, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 1px 7px rgba(41,145,248,.06);
  transition: background .17s, color .17s, box-shadow 0.18s;
}
.cookie-btn {
  background: var(--rcf-electric-blue);
  color: #fff;
}
.cookie-btn:hover { background: var(--rcf-electric-orange); }
.cookie-btn-alt {
  background: var(--rcf-accent);
  color: var(--rcf-primary);
  border: 2px solid var(--rcf-electric-orange);
}
.cookie-btn-alt:hover { background: var(--rcf-electric-orange); color: #fff; }
@media (max-width: 800px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 18px 9px;
  }
  .cookie-banner__message { font-size: 1rem; }
}

/* -------- COOKIE SETTINGS MODAL --------- */
.cookie-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2300;
  background: rgba(23,34,38, 0.54);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s cubic-bezier(.67,0,.63,1.25);
}
.cookie-modal.active {
  opacity: 1;
  pointer-events: all;
}
.cookie-modal__dialog {
  background: #fff;
  border-radius: var(--rcf-radius);
  box-shadow: 0 2px 28px 0px rgba(41,145,248,0.13);
  padding: 36px 28px 24px 28px;
  max-width: 410px;
  width: 94vw;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  animation: fadeInUp .36s cubic-bezier(.43,.3,.21,1.18);
}
.cookie-modal__close {
  position: absolute;
  top: 16px;
  right: 14px;
  background: var(--rcf-electric-orange);
  color: #fff;
  border: none;
  font-size: 1.44rem;
  border-radius: 8px;
  cursor: pointer;
  padding: 4px 13px;
  transition: background 0.13s;
}
.cookie-modal__close:hover, .cookie-modal__close:focus {
  background: var(--rcf-electric-blue);
}
.cookie-modal__categories {
  display: flex;
  flex-direction: column;
  gap: 19px;
}
.cookie-category {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cookie-category label {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--rcf-primary);
}
.cookie-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 8px;
}
.switch {
  position: relative;
  width: 46px;
  height: 26px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #e6eaee;
  border-radius: 26px;
  transition: background 0.19s;
}
.switch-slider:before {
  position: absolute;
  content: '';
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background-color: var(--rcf-primary);
  border-radius: 50%;
  transition: transform 0.2s, background 0.19s;
}
.switch input:checked + .switch-slider {
  background-color: var(--rcf-electric-blue);
}
.switch input:checked + .switch-slider:before {
  transform: translateX(20px);
  background: var(--rcf-electric-orange);
}
/* Essential category is always enabled */
.cookie-category.essential label { opacity: 0.62; }
.cookie-category.essential .switch-slider { background: #d6d8da !important; }
.cookie-category.essential .switch:after {
  content: "Obbligatorio";
  font-size: 0.84em;
  font-weight: 700;
  color: var(--rcf-secondary);
  margin-left: 12px;
}

/* ----------- RESPONSIVE LAYOUT ----------- */
@media (max-width: 1140px) {
  .container { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 900px) {
  .container { max-width: 98vw; padding-left: 8px; padding-right: 8px; }
  .content-wrapper { gap: 12px; }
}
@media (max-width: 730px) {
  .container { padding-left: 0; padding-right: 0; }
  .content-wrapper { padding: 0; }
  .section { padding: 24px 0px; margin-bottom: 36px; }
}
@media (max-width: 570px) {
  .service-card, .card, .faq-group, .blog-preview, .testimonial-card, .feature-item {
    padding: 12px 5px;
    border-radius: 10px;
  }
  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.08rem; }
  .cta-banner { font-size: 1rem; }
}

/* -------------- UTILITY CLASSES --------------- */
.hide { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* -------------- CUSTOM SCROLLBAR --------------- */
::-webkit-scrollbar {
  width: 11px;
}
::-webkit-scrollbar-thumb {
  background: var(--rcf-electric-blue);
  border-radius: 10px;
}
::-webkit-scrollbar-track {
  background: #eee;
  border-radius: 10px;
}

/* -------------- PRINT STYLES --------------- */
@media print {
  header, footer, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  main { padding: 0; }
  section, .container { box-shadow: none !important; background: none !important; }
}
