/* 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,
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 {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 16px;
  background: #F9F6F4;
  color: #222;
}
body {
  min-height: 100vh;
  background: #F9F6F4;
  font-family: 'Open Sans', Arial, sans-serif;
  color: #222;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
ul, ol { padding-left: 24px; margin-bottom: 24px; }
img { max-width: 100%; border-radius: 16px; display: block; }
h1, h2, h3, h4, h5 {
  font-family: 'Montserrat', Arial, sans-serif;
  color: #155278;
  margin-bottom: 16px;
  font-weight: 700;
  line-height: 1.22;
}
h1 { font-size: 2.6rem; margin-bottom: 24px; }
h2 { font-size: 2rem; margin-bottom: 20px; }
h3 { font-size: 1.35rem; margin-bottom: 14px; }
h4 { font-size: 1.16rem; }
p, li {
  color: #42413c;
  font-size: 1rem;
  margin-bottom: 12px;
}
a { color: #155278; text-decoration: none; transition: color .2s; }
a:hover, a:focus { color: #F2AD3D; }
strong { color: #155278; font-weight: 700; }
hr { border: none; border-top: 1px solid #E8E3DC; margin: 40px 0; }

/* BRAND COLORS */
:root {
  --color-primary: #155278;
  --color-primary-darker: #114469;
  --color-secondary: #E8E3DC;
  --color-accent: #F2AD3D;
  --color-bg: #F9F6F4;
  --color-white: #fff;
  --color-dark: #222;
  --shadow: 0 2px 12px 0 rgba(50, 52, 56, 0.07), 0 1.5px 4px 0 rgba(50, 52, 56, 0.04);
}

/* COMMON LAYOUT & CONTAINER */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: var(--color-white);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

/* HEADER STYLES */
header {
  background: var(--color-secondary);
  box-shadow: 0 1.5px 8px 0 rgba(50,52,56,0.03);
}
header .container {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 22px 20px;
}
header img { max-height: 48px; border-radius: 16px; }
.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}
.main-nav a {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  border-radius: 12px;
  padding: 6px 15px;
  transition: background .15s, color .15s;
}
.main-nav a:hover, .main-nav a:focus {
  background: var(--color-accent);
  color: var(--color-dark);
}

/* BUTTONS */
.btn-primary,
.btn-secondary {
  display: inline-block;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  border: none;
  border-radius: 28px;
  padding: 11px 32px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 6px 28px -8px rgba(242,173,61,.12), var(--shadow);
  transition: background .2s, color .2s, box-shadow .17s, transform .18s;
  margin: 0 12px 0 0;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover, .btn-primary:focus {
  background: #fdbe58;
  color: var(--color-primary);
  box-shadow: 0 10px 40px -8px rgba(242,173,61,0.17), var(--shadow);
  transform: translateY(-2px) scale(1.04);
}
.btn-secondary {
  background: var(--color-primary);
  color: var(--color-white);
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--color-accent);
  color: var(--color-dark);
  transform: translateY(-2px) scale(1.03);
}

/* HERO SECTION */
.hero {
  background: linear-gradient(135deg, #E8E3DC 0%, #FDF6EA 100%);
  border-radius: 0 0 36px 36px;
  box-shadow: 0 4px 32px -12px rgba(21,82,120, 0.07);
  margin-bottom: 56px;
  padding: 0;
}
.hero .container {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 330px;
  height: 100%;
}
.hero .content-wrapper {
  max-width: 660px;
  text-align: left;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.hero h1 {
  color: var(--color-primary);
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 800;
  font-size: 2.25rem;
  margin-bottom: 15px;
}
.hero p {
  color: #4B4742;
  font-size: 1.25rem;
  margin-bottom: 18px;
}
.hero .btn-primary {
  margin-top: 10px;
}

/* FEATURE GRID & CARDS */
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: stretch;
  margin-bottom: 0;
}
.feature-grid > div {
  background: var(--color-bg);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px 24px 28px 24px;
  flex: 1 1 260px;
  min-width: 240px;
  max-width: 340px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  transition: box-shadow 0.16s, transform 0.15s;
  margin-bottom: 20px;
}
.feature-grid > div:hover,
.feature-grid > div:focus-within {
  box-shadow: 0 8px 32px -6px rgba(242,173,61,0.16), 0 2px 6px 0 rgba(30, 60, 90, 0.07);
  transform: translateY(-2px) scale(1.025);
}
.feature-grid h3 { color: var(--color-primary); font-size: 1.19rem; font-weight: 700; }

/* CARD CONTAINERS */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.card {
  background: var(--color-white);
  border-radius: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  padding: 28px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 240px;
  max-width: 360px;
}
.card-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

/* Grids and Flex Containers */
.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: stretch;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 28px;
  background: var(--color-secondary);
  border-radius: 22px;
  box-shadow: 0 4px 22px -10px #E8E3DC, var(--shadow);
  margin-bottom: 20px;
  min-width: 260px;
  max-width: 480px;
  font-size: 1.06rem;
  color: #234;
  transition: box-shadow .13s, transform .13s;
}
.testimonial-card:hover,
.testimonial-card:focus-within {
  box-shadow: 0 8px 32px -8px #F2AD3D, var(--shadow);
  transform: scale(1.01);
}
.testimonial-card strong {
  color: var(--color-primary);
  font-family: 'Montserrat', Arial, sans-serif;
}
.testimonial-card span { color: #625; font-weight: 400; font-size: 0.95em; margin-left: 8px; }

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
}

/* TEXT SECTIONS */
.text-section {
  background: none;
  border-radius: 18px;
  font-size: 1.07rem;
  line-height: 1.75;
  color: #495070;
  padding: 6px 0 6px 0;
  margin-bottom: 12px;
}
.text-section ul {
  padding-left: 18px;
  margin-bottom: 18px;
}
.text-section li {
  margin-bottom: 9px;
}

/* CONTAINER FOR CONTENT-WRAPPER */
.content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* FOOTER */
footer {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 48px 0 0 0;
  margin-top: 40px;
  border-radius: 38px 38px 0 0;
}
footer .container {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 0 20px 20px 20px;
}
footer nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-right: 18px;
}
footer nav a {
  color: #FFFBF3;
  font-size: 1rem;
  font-family: 'Open Sans', Arial, sans-serif;
  opacity: 0.95;
  border-radius: 10px;
  padding: 3px 13px;
  transition: background .15s, color .15s, opacity .13s;
}
footer nav a:hover, footer nav a:focus {
  background: var(--color-accent);
  color: var(--color-primary);
  opacity: 1;
}
footer img { max-height: 48px; border-radius: 12px; margin-bottom: 14px; }
footer div { color: #FFF7E3; font-size: 0.98rem; margin-bottom: 8px; }
.footer-copy {
  width: 100%;
  background: #114469;
  color: #fef5e2;
  text-align: center;
  padding: 14px 0 10px 0;
  font-size: 0.97rem;
  letter-spacing: 0.2px;
  border-radius: 0 0 24px 24px;
}
footer a {
  transition: color .2s, background .16s;
}

/* MOBILE MENU HAMBURGER & MOBILE-NAV */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 18px;
  right: 26px;
  z-index: 1020;
  font-size: 2.2rem;
  background: var(--color-accent);
  color: var(--color-primary);
  border: none;
  border-radius: 20px;
  padding: 7px 18px 8px 18px;
  box-shadow: 0 2px 12px 0 rgba(242,173,61, .12), var(--shadow);
  cursor: pointer;
  transition: background .2s, box-shadow .15s;
}
.mobile-menu-toggle:active,
.mobile-menu-toggle:focus {
  background: #fdbe58;
  outline: 2px solid var(--color-primary);
}
.mobile-menu {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: 100vw;
  background: rgba(255,250,241,0.98);
  box-shadow: 0 8px 40px -12px rgba(242,173,61,0.17);
  z-index: 2051;
  transition: transform 0.44s cubic-bezier(.6,.16,.1,1.15), opacity 0.36s;
  transform: translateX(-100vw);
  opacity: 0;
  overflow-y: auto;
}
.mobile-menu.open {
  display: flex;
  transform: translateX(0vw);
  opacity: 1;
}
.mobile-menu-close {
  align-self: flex-end;
  font-size: 2rem;
  margin: 22px 26px 8px 0;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 6px 14px 7px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .2s;
}
.mobile-menu-close:hover,
.mobile-menu-close:focus {
  background: var(--color-accent);
  color: var(--color-primary-darker);
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 20px;
  padding: 0 0 40px 0;
}
.mobile-nav a {
  display: block;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.22rem;
  text-align: center;
  color: var(--color-primary);
  background: none;
  border: none;
  border-radius: 18px;
  padding: 10px 40px;
  margin: 0 auto;
  transition: background .17s, color .17s;
}
.mobile-nav a:hover,
.mobile-nav a:focus {
  background: var(--color-accent);
  color: var(--color-dark);
}

/* Only show burger and mobile menu on small screens */
@media (max-width: 1020px) {
  .main-nav {
    display: none !important;
  }
  .mobile-menu-toggle {
    display: block !important;
  }
}
@media (min-width: 1021px) {
  .mobile-menu { display: none !important; }
  .mobile-menu-toggle { display: none !important; }
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2100;
  width: 100vw;
  background: #fef5e2;
  color: #2c2c24;
  box-shadow: 0 -6px 38px -10px rgba(242,173,61,0.13), 0 -1.5px 8px -1px #ddc79350;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 22px 10vw 22px 10vw;
  font-size: 1.09rem;
  animation: slideUpCookie .42s cubic-bezier(.62,1.23,0.2,1) 1;
}
@keyframes slideUpCookie {
  from { transform: translateY(110%); opacity: 0; }
  to { transform: translateY(0%); opacity: 1; }
}
.cookie-banner p {
  margin: 0;
  color: #2c2b26;
  font-size: 1.06rem;
  flex: 1 1 400px;
}
.cookie-banner .cookie-btn {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  margin: 0 8px;
  border-radius: 18px;
  border: none;
  padding: 8px 20px;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 4px 18px -7px #F2AD3D30;
  transition: background .17s;
}
.cookie-banner .accept {
  background: var(--color-accent);
  color: var(--color-dark);
}
.cookie-banner .accept:hover { background: #fdbe58; }
.cookie-banner .reject {
  background: #ede0cd;
  color: #8a8073;
}
.cookie-banner .reject:hover { background: #f2e0b8; color: #555; }
.cookie-banner .settings {
  background: var(--color-primary);
  color: var(--color-white);
}
.cookie-banner .settings:hover { background: var(--color-primary-darker); }

/* Cookie Modal Preferences */
.cookie-modal {
  position: fixed;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(30,32,34, 0.36);
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInModal .32s .1s cubic-bezier(.62,1.23,0.2,1);
}
@keyframes fadeInModal {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.cookie-modal-content {
  background: #fffdf7;
  border-radius: 26px;
  box-shadow: 0 8px 68px -16px #F2AD3D60, 0 2px 12px 0 rgba(50, 52, 56, 0.07);
  max-width: 430px;
  width: 92vw;
  padding: 34px 32px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cookie-modal-content h2 {
  font-size: 1.32rem;
  color: var(--color-primary);
  font-family: 'Montserrat', Arial, sans-serif;
}
.cookie-category {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}
.cookie-category label {
  color: #554944;
  font-size: 1.05rem;
}
.cookie-toggle {
  display: inline-flex;
  align-items: center;
  width: 38px;
  height: 23px;
  background: #eee1c5;
  border-radius: 16px;
  cursor: pointer;
  position: relative;
  margin-left: 9px;
  transition: background .22s;
}
.cookie-toggle input { display: none; }
.cookie-toggle span {
  display: block;
  width: 18px; height: 18px;
  background: var(--color-accent);
  border-radius: 50%;
  position: absolute;
  left: 3px;
  top: 2.5px;
  transition: left .22s, background .16s;
}
.cookie-toggle input:checked + span {
  left: 17px;
  background: var(--color-primary);
}
.cookie-modal-close {
  align-self: flex-end;
  font-size: 1.5rem;
  background: transparent;
  color: var(--color-primary);
  border: none;
  cursor: pointer;
  margin-top: -10px;
  margin-bottom: 10px;
  transition: color .17s;
}
.cookie-modal-close:hover {
  color: var(--color-accent);
}
.cookie-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 10px;
}
.cookie-modal-buttons .cookie-btn {
  font-size: 1rem;
  border-radius: 16px;
  border: none;
  padding: 8px 16px;
}

/* Responsive Styles & Mobile-First Tweaks */
@media (max-width: 980px) {
  .container {
    max-width: 94vw;
    padding: 0 10px;
    gap: 15px;
  }
  .section {
    padding: 28px 8px;
    margin-bottom: 36px;
  }
  .feature-grid { gap: 16px; }
  .feature-grid > div {
    min-width: 180px;
    padding: 20px 13px;
  }
  .testimonial-card {
    padding: 17px 11px;
    max-width: 96vw;
  }
  .footer-copy { font-size: 0.93rem; }
}
@media (max-width: 820px) {
  .container,
  header .container,
  footer .container {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 0 10px 20px 10px;
  }
  .hero .container { padding: 0 0 0 0; }
  .hero .content-wrapper { align-items: flex-start; text-align: left;
    padding: 20px 0; }
  footer { border-radius: 20px 20px 0 0; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.38rem; }
  h2 { font-size: 1.13rem; }
  h3 { font-size: 1.09rem; }
  body { font-size: 0.99rem; }
  .section { padding: 16px 3vw; border-radius: 14px; }
  .hero {
    min-height: unset;
    padding: 0;
    border-radius: 0 0 16px 16px;
  }
  .hero .container {
    min-height: 180px;
  }
  .card, .feature-grid > div {
    min-width: 70vw;
    padding: 12px 3vw;
    border-radius: 13px;
  }
  .testimonial-card {
    padding: 10px 6px;
    border-radius: 10px;
  }
  .footer-copy { font-size: 0.87rem; padding: 9px 0; }
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 2vw;
    font-size: .95rem;
  }
  .cookie-modal-content { padding: 18px 6px 18px 11px; border-radius: 13px; }
}

/* FLEX LAYOUTS FOR ALL .content-wrapper, .feature-grid, etc (REQUIRED) */
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}
.feature-grid,
.card-container,
.content-grid,
.text-image-section {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
}
/* Adjust flex direction on small screens for text-image-section */
@media (max-width: 768px) {
  .text-image-section { flex-direction: column; align-items: flex-start; gap: 18px; }
}

/* Gap and Margin Consistency */
.card, .testimonial-card, .feature-item {
  margin-bottom: 20px;
}
.section { margin-bottom: 60px; }
.card-container, .content-grid, .feature-grid { gap: 24px; }
.text-image-section { gap: 30px; }
.testimonial-card { gap: 20px; }
.feature-item { gap: 15px; }

/* VISUAL DECORATIONS */
.card, .testimonial-card, .feature-grid > div {
  border-radius: 22px;
  box-shadow: var(--shadow);
}

/* Micro-interactions (hover, focus, transitions) - all buttons and cards */
.btn-primary, .btn-secondary, .feature-grid > div, .card, .testimonial-card {
  transition: box-shadow .15s, transform .15s, background .17s, color .17s;
}
:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* FORM ELEMENTS (Generic, for possible future forms on contatti) */
input, textarea, select, button {
  font-family: 'Open Sans', Arial, sans-serif;
}
input[type="text"],
input[type="email"],
textarea {
  border: 1.5px solid #e8dfc7;
  border-radius: 14px;
  padding: 10px 14px;
  background: #fffcf7;
  font-size: 1rem;
  margin-bottom: 14px;
  color: #504d43;
  box-shadow: 0 1px 4px 0 rgba(222,184,122,0.08);
  width: 100%;
  transition: border-color .19s;
}
input:focus, textarea:focus {
  border-color: var(--color-accent);
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation-duration: 0s !important;
  }
}
