/* === Dott. Francesco Pellegrini — Design System (Vanilla CSS) === */
:root {
  --green: #C2FFCC; --green-dark: #8ae69a; --blue: #7DDDFF; --blue-dark: #4dc8f0;
  --white: #FFFFFF; --navy: #1A2B4A; --navy-light: #2A3F66;
  --text: #333; --text-light: #666; --bg-alt: #F8FAFB; --border: #E8ECF0;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Lato', -apple-system, sans-serif;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06); --shadow-md: 0 4px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.1);
  --radius: 12px; --transition: all .3s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { font-family: var(--font-body); color: var(--text); background: var(--white); line-height: 1.7; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { font-family: var(--font-heading); color: var(--navy); line-height: 1.25; }
a { text-decoration: none; color: inherit; } img { max-width: 100%; height: auto; display: block; } ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.text-body { font-size: .95rem; color: var(--text-light); line-height: 1.8; margin-bottom: 16px; }
.text-center-desc { max-width: 600px; margin-left: auto; margin-right: auto; }

/* Skip Link */
.skip-link { position: absolute; top: -100%; left: 16px; z-index: 9999; padding: 10px 20px; background: var(--navy); color: #fff; border-radius: 6px; font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 16px; }

/* === NAVBAR === */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(255,255,255,.97); border-bottom: 1px solid transparent; transition: var(--transition); height: 72px; }
.navbar.scrolled { background: rgba(255,255,255,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo img { height: 60px; width: auto; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-link { font-size: .95rem; font-weight: 500; color: var(--text-light); position: relative; transition: var(--transition); letter-spacing: .02em; }
.nav-link::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--blue); transition: width .3s; border-radius: 2px; }
.nav-link:hover, .nav-link.active { color: var(--navy); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Hamburger */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--navy); margin: 5px 0; transition: var(--transition); border-radius: 2px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile */
.mobile-menu { position: fixed; top: 72px; right: 0; bottom: 0; width: 280px; background: var(--white); z-index: 999; padding: 40px 32px; transform: translateX(100%); transition: transform .35s ease; box-shadow: -4px 0 20px rgba(0,0,0,.1); display: flex; flex-direction: column; gap: 0; }
.mobile-menu.open { transform: translateX(0); }
.mobile-menu .nav-link { display: block; padding: 14px 0; font-size: 1.1rem; border-bottom: 1px solid var(--border); }
.mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 998; opacity: 0; pointer-events: none; transition: opacity .3s; }
.mobile-overlay.active { opacity: 1; pointer-events: auto; }

/* === HERO === */
.hero { position: relative; min-height: 85vh; display: flex; align-items: center; overflow: hidden; margin-top: 72px; background: #f0f6fa; }
.hero-bg { position: absolute; top: 50%; right: 2%; transform: translateY(-50%); width: 50%; height: 80%; background-size: contain; background-position: center; background-repeat: no-repeat; z-index: 0; opacity: 0.3; }
.hero-overlay { position: absolute; inset: 0; background: transparent; z-index: 1; }
.hero-content { position: relative; z-index: 2; width: 100%; }
.hero h1 { font-size: clamp(2.5rem,5vw,4rem); color: var(--navy); margin-bottom: 16px; font-weight: 700; }
.hero-subtitle { font-size: clamp(1rem,2vw,1.3rem); color: var(--navy-light); font-weight: 300; letter-spacing: .03em; margin-bottom: 32px; }
.hero-accent-line { width: 60px; height: 3px; margin-bottom: 24px; background: linear-gradient(90deg, var(--navy), var(--navy-light)); border-radius: 2px; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-logo-mobile { display: none; margin-top: 32px; width: 240px; height: auto; opacity: 0.22; }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px; border-radius: 8px; font-weight: 600; font-size: .92rem; cursor: pointer; transition: var(--transition); border: none; font-family: var(--font-body); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline-light { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.4); }
.btn-outline-light:hover { background: rgba(255,255,255,.1); border-color: var(--white); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-white { background: var(--white); color: var(--navy); }
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-full { width: 100%; justify-content: center; }

/* === SECTIONS === */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: var(--blue-dark); margin-bottom: 12px; }
.section-title { font-size: clamp(1.8rem,3vw,2.5rem); margin-bottom: 16px; }
.section-divider { width: 50px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--green), var(--blue)); margin-bottom: 32px; }
.section-divider.center { margin-left: auto; margin-right: auto; }
.section-pre-footer { background: #C2FFCC; }

/* Stats */
.stats-section { background: var(--white); }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 32px; text-align: center; max-width: 800px; margin: 0 auto; }
.stat-number { font-family: var(--font-heading); font-size: 2.8rem; font-weight: 700; line-height: 1; background: linear-gradient(135deg, var(--blue), var(--green-dark)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { color: var(--text-light); margin-top: 8px; font-weight: 500; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-img { border-radius: var(--radius); box-shadow: var(--shadow-md); }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; margin-top: 48px; }
.service-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 24px; transition: var(--transition); text-align: center; }
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--blue); }
.service-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, rgba(125,221,255,.15), rgba(194,255,204,.15)); color: var(--blue-dark); }
.service-icon.icon-alt { color: var(--green-dark); }
.service-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.service-card p { font-size: .9rem; color: var(--text-light); line-height: 1.6; }

/* YouTube Card */
.yt-card-wrapper { display: flex; justify-content: center; margin-top: 32px; }
.yt-card { display: flex; align-items: center; gap: 20px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 32px; transition: var(--transition); max-width: 500px; }
.yt-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.yt-icon { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; background: #FF0000; display: flex; align-items: center; justify-content: center; }
.yt-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.yt-desc { font-size: .85rem; color: var(--text-light); }
.yt-arrow { color: var(--text-light); margin-left: 8px; flex-shrink: 0; }

/* CTA Band */
.cta-band { background: #C2FFCC; padding: 64px 0; }
.cta-band h2 { color: var(--navy); margin-bottom: 12px; }
.cta-band p { color: var(--text); margin-bottom: 28px; }
.cta-band .btn-white { background: var(--navy); color: var(--white); }
.cta-band .btn-white:hover { background: var(--navy-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* === LOCATIONS === */
.locations-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 32px; }
.location-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: var(--transition); }
.location-card:hover { box-shadow: var(--shadow-md); }
.location-info { padding: 28px; }
.location-info h3 { font-size: 1.15rem; margin-bottom: 12px; }
.location-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.location-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(125,221,255,.1); flex-shrink: 0; }
.location-detail { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; color: var(--text-light); margin-bottom: 8px; }
.location-detail a { color: var(--blue-dark); }
.location-detail a:hover { text-decoration: underline; }
.location-map { width: 100%; height: 220px; border: none; border-top: 1px solid var(--border); }

/* === TIMELINE === */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--blue), var(--green)); }
.timeline-item { position: relative; padding-bottom: 32px; }
.timeline-item::before { content: ''; position: absolute; left: -32px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 3px solid var(--blue); z-index: 1; }
.timeline-item:hover::before { background: var(--blue); box-shadow: 0 0 0 4px rgba(125,221,255,.2); }
.timeline-year { font-size: .8rem; font-weight: 700; text-transform: uppercase; color: var(--blue-dark); letter-spacing: .08em; margin-bottom: 4px; }
.timeline-item h3 { font-size: 1rem; font-family: var(--font-body); font-weight: 700; margin-bottom: 4px; color: var(--navy); }
.timeline-item p { font-size: .9rem; color: var(--text-light); }

/* Experience Cards */
.exp-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: var(--transition); margin-bottom: 16px; }
.exp-card:hover { box-shadow: var(--shadow-sm); }
.exp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.exp-header { display: flex; align-items: flex-start; gap: 16px; }
.exp-year { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--blue-dark); margin-bottom: 4px; }
.exp-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.exp-desc { font-size: .9rem; color: var(--text-light); }

/* Highlight Box */
.highlight-box { background: linear-gradient(135deg, rgba(125,221,255,.08), rgba(194,255,204,.08)); border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; padding: 24px 28px; margin: 32px 0; text-align: center; }
.highlight-box p { font-size: 1.15rem; font-weight: 600; color: var(--navy); }

/* === PUBLICATIONS === */
.pub-list { counter-reset: pub; }
.pub-item { padding: 20px 24px; border-left: 3px solid transparent; transition: var(--transition); font-size: .92rem; line-height: 1.7; color: var(--text); border-bottom: 1px solid var(--border); }
.pub-item:hover { background: var(--bg-alt); border-left-color: var(--blue); }
.pub-year-heading { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; background: linear-gradient(135deg, var(--blue), var(--green-dark)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; padding-top: 24px; }
.search-input { width: 100%; padding: 14px 16px 14px 44px; border: 2px solid var(--border); border-radius: 8px; font-size: .95rem; font-family: var(--font-body); transition: var(--transition); background: var(--white); }
.search-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(125,221,255,.15); }
.search-wrapper { position: relative; }
.search-wrapper svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-light); }

/* === CONTACT FORM === */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-input { background: var(--white); border: 2px solid var(--border); border-radius: 8px; padding: 12px 16px; font-size: .95rem; font-family: var(--font-body); transition: var(--transition); width: 100%; }
.form-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(125,221,255,.15); }
.form-input.error { border-color: #e74c3c; box-shadow: 0 0 0 3px rgba(231,76,60,.1); }
.form-error { color: #e74c3c; font-size: .8rem; margin-top: 4px; display: none; }
.form-input.error ~ .form-error { display: block; }
textarea.form-input { min-height: 140px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-success { background: rgba(194,255,204,.3); border: 1px solid var(--green-dark); border-radius: 8px; padding: 20px; text-align: center; color: #2d7a3a; font-weight: 500; animation: fadeIn .4s ease; display: none; }
.form-note { font-size: .85rem; color: var(--text-light); font-style: italic; margin-top: 16px; text-align: center; }
.privacy-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.privacy-check input { margin-top: 3px; }
.privacy-check label { font-size: .82rem; color: var(--text-light); }
.privacy-check a { color: var(--blue-dark); text-decoration: underline; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

/* === COOKIE BANNER === */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999; background: rgba(26,43,74,.97); backdrop-filter: blur(12px); border-top: 1px solid rgba(125,221,255,.15); padding: 20px 24px; transform: translateY(100%); transition: transform .4s ease; }
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner.hidden { transform: translateY(100%); }
.cookie-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cookie-inner p { flex: 1; color: rgba(255,255,255,.8); font-size: .9rem; min-width: 280px; }
.cookie-inner a { color: var(--blue); text-decoration: underline; }
.cookie-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-btn { padding: 10px 20px; border-radius: 6px; font-size: .85rem; font-weight: 600; cursor: pointer; border: none; transition: var(--transition); font-family: var(--font-body); }
.cookie-btn-accept { background: var(--blue); color: var(--navy); }
.cookie-btn-accept:hover { background: var(--blue-dark); }
.cookie-btn-reject { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.2); }
.cookie-btn-reject:hover { background: rgba(255,255,255,.1); }
.cookie-btn-custom { background: transparent; color: var(--blue); text-decoration: underline; }

/* Cookie Modal */
.cookie-modal { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.4); backdrop-filter: blur(4px); }
.cookie-modal.visible { display: flex; }
.cookie-modal-box { background: var(--white); border-radius: var(--radius); max-width: 480px; width: 90%; padding: 32px; box-shadow: var(--shadow-lg); }
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.cookie-modal-header h3 { font-size: 1.1rem; color: var(--navy); }
.cookie-modal-header button { background: none; border: none; font-size: 1.5rem; color: var(--text-light); cursor: pointer; }
.cookie-modal-body { margin-bottom: 20px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: var(--bg-alt); border-radius: 8px; margin-bottom: 10px; }
.toggle-row label { font-size: .9rem; font-weight: 600; color: var(--navy); }
.toggle-row small { display: block; font-size: .75rem; color: var(--text-light); font-weight: 400; }
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #ccc; border-radius: 12px; cursor: pointer; transition: var(--transition); }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: var(--transition); }
.toggle-switch input:checked + .toggle-slider { background: var(--blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch input:disabled + .toggle-slider { opacity: .5; cursor: not-allowed; }

/* === FOOTER === */
.footer { background: #FFFFFF; color: var(--text-light); padding: 60px 0 0; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 48px; padding-bottom: 48px; }
.footer-logo img { height: 48px; margin-bottom: 16px; }
.footer-desc { font-size: .88rem; line-height: 1.7; color: var(--text-light); }
.footer h4 { color: var(--navy); font-family: var(--font-body); font-size: .9rem; font-weight: 700; margin-bottom: 16px; text-transform: uppercase; letter-spacing: .08em; }
.footer ul li { margin-bottom: 10px; }
.footer a { color: var(--text-light); transition: var(--transition); font-size: .88rem; }
.footer a:hover { color: var(--blue-dark); }
.footer-hr { border: none; border-top: 1px solid var(--border); margin-bottom: 24px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; font-size: .82rem; color: var(--text-light); }

/* === PAGE HEADER (inner pages) === */
.page-header { background: #7DDDFF; padding: 120px 0 60px; margin-top: 72px; position: relative; overflow: hidden; }
.page-header::before { content: ''; position: absolute; top: -40%; right: -15%; width: 50%; height: 180%; background: radial-gradient(ellipse, rgba(255,255,255,.2) 0%, transparent 70%); pointer-events: none; }
.page-header h1 { color: var(--navy); font-size: clamp(2rem,4vw,3rem); margin-bottom: 8px; }
.page-header .section-label { color: var(--navy-light); }
.page-header .section-divider { background: linear-gradient(90deg, var(--navy), var(--navy-light)); }

/* === LEGAL PAGES === */
.legal-content { max-width: 800px; margin: 0 auto; }
.legal-content h2 { font-size: 1.3rem; margin: 32px 0 12px; }
.legal-content h3 { font-size: 1.1rem; margin: 24px 0 8px; font-family: var(--font-body); color: var(--navy); }
.legal-content p, .legal-content li { font-size: .92rem; color: var(--text-light); line-height: 1.8; margin-bottom: 12px; }
.legal-content ul { padding-left: 20px; }
.legal-content ul li { list-style: disc; margin-bottom: 6px; }
.legal-content a { color: var(--blue-dark); }
.legal-content table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 16px 0; }
.legal-content th { background: var(--bg-alt); padding: 10px 12px; text-align: left; font-weight: 600; color: var(--navy); }
.legal-content td { padding: 10px 12px; border-top: 1px solid var(--border); }

/* === ANIMATIONS === */
.animate-on-scroll { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: .1s; } .delay-2 { transition-delay: .2s; } .delay-3 { transition-delay: .3s; }

/* === RESPONSIVE === */
@media (max-width:1024px) {
  .services-grid { grid-template-columns: repeat(2,1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width:768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .services-grid { grid-template-columns: 1fr; }
  .locations-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .section { padding: 56px 0; }
  .hero { min-height: 70vh; }
  .hero-bg { display: none; }
  .hero-logo-mobile { display: block; }
  .stat-number { font-size: 2rem; }
  .stats-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-buttons { flex-direction: column; }
}
