/* --- 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; }
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {display: block;}
body { line-height: 1; }
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; }


/* --- BRAND VARIABLES --- */
:root {
  --primary: #21455B;
  --secondary: #F5F2EB;
  --accent: #E3A53A;
  --danger: #FA4444;
  --success: #49C378;
  --info: #3DB1E3;

  --font-display: 'Quicksand', Arial, sans-serif;
  --font-body: 'Roboto', Arial, sans-serif;

  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 10px;

  --shadow-hover: 0 8px 32px rgba(33,69,91,0.12);
  --shadow-card: 0 2px 12px rgba(33,69,91,0.09);
  --shadow-cta: 0 4px 16px rgba(227,165,58,0.22);
  --transition: 0.22s cubic-bezier(.59,.1,.49,1.08);
}

@font-face {
  font-family: 'Quicksand';
  src: local('Quicksand'), url('https://fonts.googleapis.com/css?family=Quicksand:700,500,400&display=swap');
}
@font-face {
  font-family: 'Roboto';
  src: local('Roboto'), url('https://fonts.googleapis.com/css?family=Roboto:400,500,700&display=swap');
}

body {
  font-family: var(--font-body);
  color: var(--primary);
  background: var(--secondary);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  letter-spacing: 0.05em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--primary);
  margin-bottom: 16px;
  word-break: break-word;
  letter-spacing: 0.02em;
}
h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 18px; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 700; }
h4, h5, h6 { font-size: 1.1rem; font-weight: 500; }
p,
dl, dt, dd, ul, ol, li {
  font-family: var(--font-body);
  font-size: 1rem;
}
p { margin-bottom: 18px; }
b, strong {font-weight: 700;}

/* --- LAYOUT CONTAINERS --- */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: var(--secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}
.text-section { display: flex; flex-direction: column; gap: 16px; }

.card-container, .card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-start;
}
.card {  margin-bottom: 20px; position: relative;  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-card); transition: box-shadow var(--transition); padding: 24px; display: flex; flex-direction: column; align-items: flex-start; min-width: 260px; }
.card:hover { box-shadow: 0 6px 24px rgba(26,80,144,0.16); }
.card-content { display: flex; flex-direction: column; justify-content: center; }

.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: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  position: relative;
  min-width: 260px;
}
.testimonial-card p {
  color: #333 !important;
  font-size: 1.1rem;
}
.testimonial-card small {color: var(--accent); font-family: var(--font-display); font-size: 1rem; font-weight: 700;}
.feature-item {display: flex; flex-direction: column; align-items: flex-start; gap: 15px;}

/* --- HEADER + NAV --- */
header {
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(33,69,91,0.07);
  padding: 0 0 0 0;
}
header {
  display: flex; flex-direction: row; align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 77px;
  position: relative;
  z-index: 10;
}
header > img {
  height: 54px;
  margin: 12px 20px 12px 0;
}
header nav {
  display: flex; flex-direction: row; gap: 16px;
  align-items: center;
}
header nav a {
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
header nav a:hover, header nav a:focus {
  background: var(--accent);
  color: #fff;
}
.cta-primary {
  background: var(--accent);
  color: #fff !important;
  border: none;
  border-radius: 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .04em;
  padding: 13px 36px;
  cursor: pointer;
  box-shadow: var(--shadow-cta);
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-left: 12px;
  position: relative;
  overflow: hidden;
}
.cta-primary:after {
  content: '';
  display: block;
  position: absolute;
  top:0; left:0; width:100%; height:100%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.22s;
}
.cta-primary:hover,
.cta-primary:focus {
  background: #ffd566;
  color: var(--primary) !important;
  box-shadow: 0 8px 30px rgba(227,165,58,0.30);
  transform: translateY(-2px) scale(1.04);
}
.cta-primary:hover:after,
.cta-primary:focus:after { opacity: 0.23; }

.cta-secondary {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 28px;
  font-family: var(--font-display);
  font-weight: 700;
  padding: 11px 30px;
  font-size: 1.07rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border var(--transition);
  margin-left: 8px;
}
.cta-secondary:hover, .cta-secondary:focus {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}

/* --- ICONS (in LI) --- */
ul li img, ol li img {
  height: 24px; width: 24px;
  margin-right: 10px;
  vertical-align: middle;
  display: inline-block;
}
ul li, ol li { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
ol { list-style: decimal inside; padding-left: 18px; }
ul { padding-left: 10px; }

/* --- DL/FAQ --- */
dl {
  border-left: 5px solid var(--accent);
  padding-left: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
dt {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  font-size: 1.13rem;
}
dd {
  color: var(--primary);
  margin-bottom: 10px;
  margin-left: 0;
}

/* --- FOOTER --- */
footer {
  background: var(--primary);
  color: #fff;
  padding: 48px 0 24px 0;
  font-size: 1rem;
}
footer > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}
footer img {
  height: 46px;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,.05));
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
footer nav a {
  color: var(--accent);
  text-decoration: underline;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  transition: color .18s;
}
footer nav a:hover, footer nav a:focus { color: #ffd566; }
footer address {
  color: #f3e9c7;
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-top: 8px;
  line-height: 1.6;
}
footer address img {
  height: 18px; width: 18px;
  margin-right: 6px;
  vertical-align: middle;
  margin-bottom: 2px;
}
footer address a { color: #ffe791; text-decoration: underline; }

/* --- BUTTONS (General style for cookie, forms, etc) --- */
button, .button, input[type="submit"] {
  font-family: var(--font-display);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .04em;
  padding: 11px 30px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  outline: none;
  margin: 0 8px 0 0;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
button:hover, button:focus, .button:hover, .button:focus,
input[type="submit"]:hover, input[type="submit"]:focus {
  background: #ffd566;
  color: var(--primary);
}

/* --- MOBILE MENU --- */
.mobile-menu-toggle {
  display: none;
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 109;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 1.65rem;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: background var(--transition), transform var(--transition);
}
.mobile-menu-toggle:active, .mobile-menu-toggle:focus {
  background: #ffd566; color: var(--primary);
}
.mobile-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: fixed;
  top: 0; left: 0; height: 100vh; width: 100vw;
  background: rgba(249,241,225,0.97);
  z-index: 9990;
  transform: translateX(-105%);
  transition: transform 0.37s cubic-bezier(.55,0,.25,1);
  box-shadow: 0 0 42px rgba(33,69,91,0.11);
}
.mobile-menu.open {  transform: translateX(0); }
.mobile-menu-close {
  background: transparent;
  color: var(--primary);
  border: none;
  font-size: 2.4rem;
  font-family: var(--font-display);
  position: absolute;
  top: 17px; right: 25px;
  cursor: pointer;
  z-index: 10000;
  border-radius: 10px;
  padding: 2px 14px;
  line-height: 1;
  transition: background .2s;
}
.mobile-menu-close:hover, .mobile-menu-close:focus {
  background: var(--accent);
  color: #fff;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 80px 36px 0 36px;
  width: 100%;
}
.mobile-nav a {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  padding: 12px 10px;
  border-radius: 12px;
  text-decoration: none;
  background: transparent;
  transition: background .18s, color .18s;
  margin-bottom: 4px;
  display: block;
}
.mobile-nav a:hover, .mobile-nav a:focus {
  background: var(--accent);
  color: #fff;
}

/* --- SECTIONS --- */
section {
  margin-bottom: 60px;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--secondary);
  box-shadow: var(--shadow-card);
}
section > .container { width: 100%; }

/* --- MICRO-INTERACTIONS & ANIMATION --- */
.cta-primary, .cta-secondary, button, .card, .testimonial-card {
  transition: box-shadow var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}
.card:hover, .testimonial-card:hover {
  box-shadow: 0 8px 24px rgba(33, 69, 91, 0.18);
  transform: translateY(-3px);
}
a {
  color: var(--accent);
}
a:hover, a:focus {
  color: #E36E2E;
  text-decoration: underline;
}

/* --- PLAYFUL DYNAMIC EFFECTS --- */
h1, h2 {
  position: relative;
  max-width: 90%;
}
h1:after, h2:after {
  content: '';
  display: block;
  width: 38px;
  height: 7px;
  border-radius: 7px;
  background: var(--accent);
  position: absolute;
  left: 3px;
  bottom: -8px;
  opacity: 0.35;
  animation: bop 2.7s infinite alternate cubic-bezier(.3,1.48,.6,.92);
}
@keyframes bop {
    0% { width:38px; left:3px; opacity:0.32; }
   30% { width:44px; left:-8px; opacity:0.4; }
   70% { width:33px; left:7px; opacity:0.35; }
  100% { width:38px; left:3px; opacity:0.32; }
}

.cta-primary {
  position: relative;
  overflow: hidden;
}
.cta-primary:before {
  content: '';
  display: block;
  position: absolute;
  top: -60%;
  left: -25%;
  width: 70%; height: 220%;
  background: rgba(255,255,255,0.12);
  transform: skewX(-40deg);
  transition: left .5s linear;
  z-index: 1;
}
.cta-primary:hover:before, .cta-primary:focus:before {
  left: 90%;
}

.section {
  position: relative;
  overflow: hidden;
}
.section:after {
  content: '';
  width: 90px;
  height: 90px;
  background: var(--accent);
  opacity: 0.08;
  border-radius: 60% 40% 50% 60%;
  position: absolute;
  right: -36px; bottom: -23px;
  z-index: 0;
  pointer-events: none;
  animation: floaty 11s infinite alternate cubic-bezier(.3,1.78,.6,.82);
}
@keyframes floaty {
  0% { transform: translateY(0) scale(1) rotate(-5deg);}
  60% { transform: translateY(-18px) scale(1.06) rotate(2deg);}
  100%{transform: translateY(4px) scale(.97) rotate(-1deg);}
}


/* --- RESPONSIVE DESIGN (MOBILE-FIRST) --- */
@media (max-width: 1020px) {
  .container {max-width: 96vw;}
}
@media (max-width: 900px) {
  h1 {font-size: 2rem;}
  h2 {font-size: 1.45rem;}
  .section, section {  padding: 30px 0; }
}
@media (max-width: 768px) {
  html { font-size: 15px; }
  h1 {font-size: 1.65rem;} h2 {font-size: 1.2rem;} h3 {font-size: 1rem;}
  .container {max-width: 98vw; padding: 0 5px;}
  .section, section { border-radius: var(--radius-md); }
  .content-wrapper { gap: 16px; }
  .text-section { gap: 8px; }
  .content-grid,.card-container,.card-grid {
    flex-direction: column !important;
    gap: 14px;
  }
  .testimonial-card { min-width: 0; padding: 14px; }
  .card { min-width: 0; padding: 14px; }
  .text-image-section { flex-direction: column !important; gap: 18px; }
  header nav { display: none !important; }
  .cta-primary, .cta-secondary { padding: 11px 16vw; font-size: 1rem;}
  header > img { height: 38px; margin: 12px 8px 12px 0; }
  .mobile-menu-toggle {
    display: block;
  }
  header {
    padding-right: 62px;
  }
}

@media (max-width: 520px) {
  .cta-primary, .cta-secondary { padding: 11px 8vw; font-size: 1rem;}
  .section, section { padding: 18px 0; }
  footer > div { padding: 0 8px; }
}

/* --- COOKIE CONSENT BANNER & MODAL --- */
.cookie-consent-banner {
  position: fixed;
  left: 0; bottom: 0;
  width: 100vw;
  padding: 22px 10vw 22px 28px;
  background: #222;
  color: #fff;
  box-shadow: 0 -2px 18px rgba(33,69,91,0.15);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  z-index: 999999;
  font-family: var(--font-body);
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
  transition: opacity 0.38s, transform 0.46s;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.cookie-consent-banner.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.cookie-consent-banner p {
  color: #fff;
  margin:0;
  flex: 2 1 60%;
}
.cookie-consent-banner .cookie-actions {
  display: flex; flex-direction: row; gap: 14px;
  flex: 1 1 40%;
  align-items: center;
}
.cookie-consent-banner button {
  padding: 8px 18px;
  font-size: 1rem;
  border: none;
  background: var(--accent);
  outline: none;
  color: #fff;
  border-radius: 18px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 0 0;
}
.cookie-consent-banner .cookie-actions .settings-btn {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--accent);
  margin-left: 8px;
}
.cookie-consent-banner .cookie-actions .settings-btn:hover {
  background: var(--accent);
  color: #fff;
}
.cookie-consent-banner .cookie-actions .reject-btn {
  background: var(--danger);
}
.cookie-consent-banner .cookie-actions .accept-btn {
  background: var(--success);
}
/* Cookie modal overlay */
.cookie-modal-overlay {
  position: fixed;
  top:0; left:0; width:100vw; height:100vh;
  background: rgba(22, 22, 22, 0.55);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.cookie-modal-overlay.show { opacity: 1; pointer-events: all; }
.cookie-modal {
  background: #fff;
  color: var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 42px rgba(33,69,91,0.16);
  padding: 36px 28px 30px 32px;
  min-width: 315px; max-width: 98vw;
  min-height: 110px;
  font-size: 1.09rem;
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: relative;
  animation: modalfly-in .46s cubic-bezier(.5,2.2,.5,.85);
}
@keyframes modalfly-in {
  0% { transform: scale(.7) translateY(40px); opacity: 0; }
 100% {transform: scale(1) translateY(0); opacity:1; }
}
.cookie-modal .close-modal {
  position: absolute;
  top: 14px; right: 20px;
  background:transparent;
  border: none;
  font-size: 1.65rem;
  color: var(--accent);
  cursor: pointer;
  line-height: 1;
}
.cookie-modal h2 {
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 10px;
  font-family: var(--font-display);
}
.cookie-category-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.cookie-category {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
}
.cookie-category input[type="checkbox"] {
  width: 22px; height: 22px;
  accent-color: var(--accent);
  border-radius: 4px;
}
.cookie-category label { font-size: 1.08rem; font-weight: 500;}
.cookie-category.essential label::after {
  content: ' (Essenziali)'; color: var(--success); font-size: 0.97em;
  font-weight: 600;
}
.cookie-modal .cookie-actions {
  display: flex; flex-direction: row; gap: 18px; margin-top: 20px;
  margin-bottom: 0;
}
.cookie-modal .cookie-actions button {
  border-radius: 18px;
  padding: 8px 22px;
  font-size: 0.98rem;
  font-family: var(--font-display);
  font-weight: 700;
}
@media (max-width: 700px) {
  .cookie-consent-banner {flex-direction: column; align-items: flex-start; gap: 8px; padding: 19px 12px; font-size: 0.98rem;}
  .cookie-consent-banner .cookie-actions {gap:9px;}
  .cookie-modal {padding: 20px 9px 16px 19px; }
}

/* --- PLAYFUL TYPOGRAPHY --- */
h1, h2, h3 { font-family: 'Quicksand', Arial, sans-serif; }
h1, h2 { font-weight: 800;
  color: var(--primary);
  text-shadow: 1px 1px 0 rgba(251, 220, 94,.13), 0 2px 8px rgba(227,165,58,0.08);
}
h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.024em;
}

/* --- FUN FONTS IN ICONIC PLACES --- */
.cta-primary, .cta-secondary, nav a {
  font-family: var(--font-display);
  letter-spacing: 0.024em;
  font-weight: 800;
  text-transform: none;
}
.testimonial-card small { font-family: var(--font-display); }

/* --- SPACING CONSISTENCY (margin, gap etc.) --- */
section, .section { margin-bottom: 60px !important; padding-top: 40px; padding-bottom: 40px; }
.card-container, .card-grid, .content-grid, .testimonial-list {
  gap: 24px !important;
  margin-bottom: 20px;
}
.card, .testimonial-card { margin-bottom: 20px !important; }
.feature-item { gap: 15px !important; }
.text-image-section { gap: 30px !important; }

/* --- ACCESSIBILITY IMPROVEMENTS --- */
:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 1.5px;
}
::selection { background: #ffe791; }

/* --- HIDE MOBILE MENU ON DESKTOP --- */
@media (min-width: 769px) {
  .mobile-menu {
    display: none !important;
  }
  .mobile-menu-toggle {
    display: none;
  }
  header nav {
    display: flex !important;
  }
}

/* --- UTILITY --- */
.hide { display: none !important; }

/* --- PRINT --- */
@media print {
  header, nav, footer, .mobile-menu, .cookie-consent-banner, .cookie-modal-overlay { display: none !important; }
  body, html { background: #fff; color: #333; }
}
