/* =============================================================================
   Dott. Riccardo Nicitra — Custom Premium Stylesheet
   ============================================================================= */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');

/* --- Design Tokens & CSS Variables --- */
:root {
  /* Colors */
  --bg-primary: #FCFAF6;        /* Warm Calming Cream */
  --bg-secondary: #F3ECE2;      /* Darker Cream for Section Alternation */
  --bg-white: #FFFFFF;          /* Pure White for Cards */
  --text-primary: #122A47;      /* Deep Professional Navy */
  --text-muted: #4F5E73;        /* Soft Blue-Grey for Body Text */
  --accent-gold: #C09575;       /* Warm Sand/Gold for Category Subtitles */
  --accent-green: #526B59;      /* Muted Olive Green for Icons/Highlights */
  
  /* Borders & Shadows */
  --border-color: rgba(192, 149, 117, 0.2); /* Soft Gold Border */
  --box-shadow-soft: 0 8px 30px rgba(18, 42, 71, 0.04);
  --box-shadow-medium: 0 12px 40px rgba(18, 42, 71, 0.08);
  --box-shadow-hover: 0 20px 48px rgba(18, 42, 71, 0.12);
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Layout Spacing */
  --section-padding: 7.5rem 10%;
  --section-padding-mobile: 4.5rem 6%;
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* Offsets sticky header */
  overflow-x: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
}

p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.subtitle-category {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: inline-block;
}

/* --- Layout Elements --- */
section {
  padding: var(--section-padding);
  position: relative;
}

@media (max-width: 768px) {
  section {
    padding: var(--section-padding-mobile);
  }
}

.container-flex {
  display: flex;
  gap: 4rem;
  align-items: center;
}

.container-flex.align-top {
  align-items: flex-start;
}

.flex-col-50 {
  flex: 1;
  min-width: 300px;
}

@media (max-width: 992px) {
  .container-flex {
    flex-direction: column;
    gap: 3rem;
  }
  .flex-col-50 {
    width: 100%;
  }
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 1rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: var(--transition-smooth);
  border: 1px solid var(--text-primary);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(18, 42, 71, 0.15);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(18, 42, 71, 0.2);
}

.btn-primary svg {
  margin-left: 0.75rem;
  stroke: currentColor;
  transition: var(--transition-smooth);
}

.btn-primary:hover svg {
  transform: translateX(4px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--text-primary);
  padding: 0.9rem 1.8rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-outline:hover {
  border-color: var(--text-primary);
  background-color: rgba(18, 42, 71, 0.02);
  transform: translateY(-2px);
}

.btn-outline svg {
  margin-left: 0.75rem;
  fill: currentColor;
}

/* --- Header / Navigation --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(252, 250, 246, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(18, 42, 71, 0.05);
  padding: 1.25rem 10%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

header.scrolled {
  padding: 0.9rem 10%;
  box-shadow: var(--box-shadow-soft);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-symbol {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  border-right: 1.5px solid var(--accent-gold);
  padding-right: 0.75rem;
  line-height: 1;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.logo-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Header booking button */
.header-booking-btn {
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  border-radius: 4px;
}

.header-booking-btn svg {
  margin-left: 0; /* Override default right-aligned button icon margin */
  margin-right: 0.6rem;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.header-booking-btn:hover svg {
  transform: scale(1.15); /* Nice subtle scaling animation on hover */
}

.header-booking-btn .btn-text-mobile {
  display: none;
}

@media (max-width: 992px) {
  header {
    padding: 0.95rem 6%;
  }
  header.scrolled {
    padding: 0.95rem 6%;
  }
}

@media (max-width: 768px) {
  .chisono {
    padding-top: 6.5rem; /* Space to clear the fixed header on mobile */
  }
  .header-booking-btn {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
  }
  .header-booking-btn .btn-text-full {
    display: none;
  }
  .header-booking-btn .btn-text-mobile {
    display: inline;
  }
  .logo-name {
    font-size: 0.95rem;
  }
  .logo-title {
    font-size: 0.6rem;
  }
}

@media (max-width: 576px) {
  .logo-title {
    display: none;
  }
  .logo-symbol {
    font-size: 1.5rem;
    padding-right: 0.5rem;
  }
}

/* --- Quote Transition Section --- */
/* --- Chi Sono Section Left Column & Quote Box --- */
.chisono-left {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  width: 100%;
}

.chisono-quote-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2.25rem;
  box-shadow: var(--box-shadow-soft);
  text-align: center;
}

.chisono-quote-text {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.chisono-quote-divider {
  width: 40px;
  height: 1px;
  background-color: var(--accent-gold);
  margin: 1.25rem auto;
}

.chisono-quote-highlight {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 0;
}

/* --- Chi Sono Section --- */
.chisono {
  background-color: var(--bg-primary);
}

.chisono-image-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--box-shadow-medium);
  border: 1px solid var(--border-color);
}

.chisono-image-wrapper img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: var(--transition-smooth);
}

/* Image hover scaling disabled */

.chisono-content h2 {
  font-size: 2.3rem;
  margin-bottom: 1.5rem;
}

.chisono-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

/* --- Il Mio Approccio Section --- */
.approccio {
  background-color: var(--bg-secondary);
  text-align: center;
}

.approccio-intro {
  max-width: 800px;
  margin: 0 auto 4.5rem;
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.approccio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.approccio-card {
  background-color: var(--bg-primary);
  padding: 3rem 2rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  box-shadow: var(--box-shadow-soft);
  transition: var(--transition-smooth);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.approccio-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--box-shadow-hover);
  border-color: rgba(192, 149, 117, 0.4);
}

.approccio-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: rgba(192, 149, 117, 0.1);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
  transition: var(--transition-smooth);
}

.approccio-icon img {
  width: 32px;
  height: 32px;
}

.approccio-card:nth-child(2) .approccio-icon {
  background-color: rgba(18, 42, 71, 0.06);
  color: var(--text-primary);
}

.approccio-card:nth-child(3) .approccio-icon {
  background-color: rgba(82, 107, 89, 0.1);
  color: var(--accent-green);
}

/* Icon hover scaling disabled */

.approccio-card h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.approccio-card p {
  font-size: 0.98rem;
  line-height: 1.6;
}

/* --- Di Cosa Mi Occupo Section --- */
.occupo {
  background-color: var(--bg-primary);
  text-align: center;
}

.occupo-intro {
  max-width: 800px;
  margin: 0 auto 4.5rem;
}

.occupo-intro h2 {
  font-size: 2.3rem;
  margin-bottom: 1.5rem;
}

.occupo-intro p {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.occupo-intro p:last-child {
  margin-bottom: 0;
}

.occupo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.occupo-card {
  background-color: var(--bg-white);
  padding: 3rem 2rem;
  border-radius: 6px;
  border: 1px solid rgba(18, 42, 71, 0.04);
  box-shadow: var(--box-shadow-soft);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.occupo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--box-shadow-medium);
  border-color: var(--border-color);
}

.occupo-card-icon {
  width: 48px;
  height: 48px;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.occupo-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-primary);
  line-height: 1.4;
}

/* --- Come Funziona Section --- */
.funziona {
  background-color: var(--bg-secondary);
  text-align: center;
}

.funziona-title {
  margin-bottom: 4.5rem;
}

.funziona-title h2 {
  font-size: 2.3rem;
}

.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 35px;
  left: 5%;
  right: 5%;
  height: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.timeline-step {
  position: relative;
  flex: 1;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-number {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: var(--bg-primary);
  border: 2px solid var(--accent-gold);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--box-shadow-soft);
  transition: var(--transition-smooth);
}

/* Step number hover scaling disabled */

.timeline-step h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
}

.timeline-step p {
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 260px;
}

.step-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

@media (max-width: 768px) {
  .timeline {
    flex-direction: column;
    gap: 3rem;
    align-items: flex-start;
    padding-left: 2rem;
  }
  .timeline::before {
    top: 35px;
    bottom: 35px;
    left: 67px;
    width: 2px;
    height: auto;
  }
  .timeline-step {
    flex-direction: row;
    gap: 2rem;
    text-align: left;
    align-items: flex-start;
  }
  .step-number {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .step-content {
    flex: 1;
    align-items: flex-start;
    text-align: left;
  }
  .timeline-step p {
    max-width: 100%;
  }
}

/* --- Modalità Section (Costs Omitted) --- */
.modalita {
  background-color: var(--bg-primary);
}

.modalita-content h2 {
  font-size: 2.3rem;
  margin-bottom: 1.5rem;
}

.modalita-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.modalita-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.modalita-check {
  width: 24px;
  height: 24px;
  color: var(--accent-green);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.modalita-item-text h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.modalita-info-card {
  background-color: var(--bg-secondary);
  border-left: 3px solid var(--accent-gold);
  padding: 2rem;
  border-radius: 0 6px 6px 0;
  box-shadow: var(--box-shadow-soft);
  max-width: 500px;
}

.modalita-info-card p {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Contatti & Form Section --- */
.contatti {
  background-color: var(--bg-secondary);
}

.contatti h2 {
  font-size: 2.3rem;
  margin-bottom: 2rem;
}

.contatti-info {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.contatti-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.contatti-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(19, 42, 71, 0.05);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contatti-info-text h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.contatti-info-text p,
.contatti-info-text a {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.contatti-info-text a:hover {
  color: var(--accent-green);
}

.contatti-card-col {
  display: flex;
  justify-content: center;
}

.contatti-card {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2.25rem 2.5rem;
  max-width: 450px;
  box-shadow: var(--box-shadow-medium);
}

.contatti-card h4 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.contatti-card p {
  font-size: 0.98rem;
  margin-bottom: 0;
}

/* Forms */
.form-container {
  background-color: var(--bg-primary);
  padding: 3.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: var(--box-shadow-medium);
}

.form-container h3 {
  font-size: 1.6rem;
  margin-bottom: 2rem;
}

.form-legend {
  font-size: 0.82rem;
  margin-top: -1.5rem;
  margin-bottom: 1.75rem;
  color: var(--text-muted);
  opacity: 0.95;
}

.required-star {
  color: var(--accent-green);
  margin-left: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.form-control {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  border: 1px solid rgba(18, 42, 71, 0.1);
  background-color: var(--bg-white);
  color: var(--text-primary);
  transition: var(--transition-smooth);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(192, 149, 117, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.form-checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-green);
  margin-top: 0.2rem;
  cursor: pointer;
}

.form-checkbox-group label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.4;
  cursor: pointer;
}

.form-checkbox-group a {
  color: var(--text-primary);
  text-decoration: underline;
}

.form-container button {
  width: 100%;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .form-container {
    padding: 2.25rem 1.75rem;
  }
}

/* Map Grid Integration */
.map-section {
  padding: 0;
  height: 400px;
  width: 100%;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.map-section iframe {
  width: 100%;
  height: 100%;
  border: none;
  filter: grayscale(1) contrast(1.1) opacity(0.85);
  transition: var(--transition-smooth);
}

.map-section iframe:hover {
  filter: none;
}

/* --- Footer --- */
footer {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 5rem 10% 2.5rem;
}

.footer-top {
  text-align: center;
  border-bottom: 1px solid rgba(252, 250, 246, 0.1);
  padding-bottom: 3.5rem;
  margin-bottom: 2.5rem;
}

.footer-cta-text h3 {
  color: var(--bg-primary);
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.footer-cta-text p {
  color: rgba(252, 250, 246, 0.6);
  font-size: 1.1rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  font-size: 0.88rem;
  color: rgba(252, 250, 246, 0.5);
}

.footer-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-bottom-left strong {
  color: var(--bg-primary);
  font-size: 0.95rem;
}

.footer-bottom-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: right;
  max-width: 450px;
}

.footer-bottom-right a {
  color: rgba(252, 250, 246, 0.5);
  text-decoration: underline;
}

.footer-bottom-right a:hover {
  color: var(--bg-primary);
}

.footer-disclaimer {
  font-size: 0.8rem;
  opacity: 0.75;
  line-height: 1.4;
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  footer {
    padding: 4rem 6% 2rem;
  }
  .footer-top {
    text-align: center;
    padding-bottom: 2.5rem;
  }
  .footer-cta-text h3 {
    font-size: 1.8rem;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-bottom-right {
    text-align: left;
    max-width: none;
  }
}

/* --- GDPR Consent Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, calc(100% + 50px)); /* Slide down fully out of view */
  width: calc(100% - 40px);
  max-width: 600px;
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  box-shadow: var(--box-shadow-medium);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 9999; /* Set high to display above all content */
  transition: var(--transition-smooth);
}

.cookie-banner.show {
  transform: translate(-50%, 0); /* Slide up into view */
}

.cookie-content p {
  font-size: 0.88rem;
  line-height: 1.5;
}

.cookie-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.cookie-policy-link {
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.cookie-buttons button {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-cookie-accept {
  background-color: var(--accent-green);
  color: var(--bg-white);
  border: 1px solid var(--accent-green);
}

.btn-cookie-accept:hover {
  background-color: transparent;
  color: var(--accent-green);
}

.btn-cookie-deny {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-cookie-deny:hover {
  color: var(--text-primary);
}

/* --- Modal Overlay & Dialog --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(18, 42, 71, 0.6); /* Semi-transparent Deep Navy */
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 550px;
  padding: 2.25rem;
  box-shadow: var(--box-shadow-hover);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.modal-header h3 {
  font-size: 1.4rem;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  margin-bottom: 1.75rem;
}

.modal-body p {
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.fallback-msg-header {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.email-preview-box {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: var(--text-muted);
  border-left: 3px solid var(--accent-gold);
}

.email-detail-row {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.email-detail-row strong {
  color: var(--text-primary);
  display: inline-block;
  width: 100px;
}

.modal-footer {
  display: flex;
  width: 100%;
}

.modal-footer-btns {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  width: 100%;
}

.modal-footer button {
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-modal-primary {
  background-color: var(--accent-green);
  color: var(--bg-white);
  border: 1px solid var(--accent-green);
}

.btn-modal-primary:hover {
  background-color: transparent;
  color: var(--accent-green);
}

.btn-modal-secondary {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-modal-secondary:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

@media (max-width: 576px) {
  .modal-content {
    padding: 1.5rem;
  }
  .modal-footer-btns {
    flex-direction: column;
  }
  .modal-footer-btns button {
    width: 100%;
  }
  .email-detail-row strong {
    width: auto;
    display: block;
    margin-bottom: 0.25rem;
  }
}

/* --- Utilities & Dynamic States --- */
.hidden-state {
  display: none !important;
}

/* Visually hidden but accessible to screen readers & SEO crawlers */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Form Loading State (Spinner) */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--bg-white);
  animation: spinner-spin 0.8s linear infinite;
}

@keyframes spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success Modal View */
.success-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--accent-green);
}

.success-icon {
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-text {
  text-align: center;
  font-size: 1.05rem !important;
  color: var(--text-primary) !important;
  margin-top: 1rem;
  line-height: 1.5;
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Mobile Usability & Typography Adjustments --- */
@media (max-width: 768px) {
  /* Headings size reduction */
  .chisono-content h2,
  .occupo-intro h2,
  .funziona-title h2,
  .modalita-content h2,
  .contatti h2 {
    font-size: 1.85rem;
  }
  
  /* Reduction of excessive whitespace and text sizes in intros */
  .approccio-intro,
  .occupo-intro p {
    font-size: 1.125rem;
  }
  
  .approccio-intro,
  .occupo-intro {
    margin-bottom: 2.5rem;
  }
  
  /* Reduced card padding to provide more space for text on mobile */
  .approccio-card,
  .occupo-card {
    padding: 2.25rem 1.5rem;
  }
  
  /* Reduced quote box padding on mobile */
  .chisono-quote-box {
    padding: 1.75rem;
  }
}

@media (max-width: 480px) {
  /* Prevent horizontal overflow on extremely narrow viewports */
  .approccio-grid,
  .occupo-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}


