/* ============================================
   WELFORA — Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --white:      #ffffff;
  --bg:         #f5f8fc;
  --navy:       #1e3a6e;
  --navy-mid:   #2a4f8f;
  --navy-light: #e8eef6;
  --blue:       #1e88d4;
  --green:      #5cb85c;
  --accent:     #1e88d4;
  --accent-hover: #1a7abf;
  --text:       #1a2a44;
  --text-mid:   #4a5a74;
  --text-light: #8a9ab4;
  --border:     rgba(30,58,110,0.10);
  --shadow:     0 4px 24px rgba(30,58,110,0.09);
  --shadow-lg:  0 12px 48px rgba(30,58,110,0.14);

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'DM Sans', sans-serif;

  --radius: 6px;
  --radius-lg: 10px;
  --transition: all 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--navy);
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }

p { color: var(--text-mid); line-height: 1.7; }

a { color: inherit; text-decoration: none; }

/* ── CONTAINER ── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
}

/* ── HEADER / NAV ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.site-header.scrolled {
  box-shadow: var(--shadow);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 36px;
  height: 36px;
}
.logo-name {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: var(--transition);
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius);
  text-decoration: none;
}
.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
}
.btn-green {
  background: var(--green);
  color: var(--white);
}
.btn-green:hover {
  background: #4ea84e;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(92,184,92,0.35);
}
.btn-lg { padding: 16px 40px; font-size: 0.92rem; }

/* Hamburger mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  transition: var(--transition);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding: 24px 32px;
    gap: 20px;
    align-items: flex-start;
  }
  .nav-links.open { display: flex; }
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 75% 35%, rgba(30,136,212,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 10% 70%, rgba(92,184,92,0.06) 0%, transparent 55%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 2px;
}
.hero h1 {
  margin-bottom: 24px;
}
.hero h1 em {
  font-style: italic;
  color: var(--blue);
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-mid);
  margin-bottom: 40px;
  max-width: 480px;
  line-height: 1.8;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-visual {
  position: relative;
}
.hero-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.hero-card-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}
.hero-card-value {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--navy);
  margin-bottom: 4px;
}
.hero-card-sub {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 28px;
}
.hero-card-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
}
.bar-label { width: 80px; color: var(--text-mid); flex-shrink: 0; }
.bar-track {
  flex: 1;
  height: 6px;
  background: rgba(13,31,60,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--blue);
  animation: barGrow 1.2s ease both;
}
.bar-fill.green { background: var(--green); }
.bar-amount { width: 60px; text-align: right; color: var(--text-mid); }
@keyframes barGrow {
  from { width: 0 !important; }
}
.hero-badge {
  position: absolute;
  top: -16px; right: -16px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: var(--white);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
  box-shadow: 0 4px 16px rgba(30,136,212,0.35);
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { max-width: 420px; }
}

/* ── SECTIONS ── */
.section { padding: 96px 0; }
.section-alt { background: var(--white); }

.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.section-eyebrow::before,
.section-eyebrow::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 2px;
}
.section-header p {
  max-width: 560px;
  margin: 16px auto 0;
  font-size: 1.05rem;
}

/* ── FEATURES GRID ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.feature-card {
  padding: 36px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  transition: var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(30,136,212,0.35);
}
.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--navy-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--blue);
}
.feature-card h4 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.feature-card p { font-size: 0.92rem; }

@media (max-width: 900px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ── STATS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 64px 0;
}
.stat-item {
  background: var(--white);
  padding: 40px 28px;
  text-align: center;
}
.stat-number {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--navy);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
}
@media (max-width: 768px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
}

/* ── TESTIMONIAL ── */
.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.testimonial-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  position: relative;
}
.testimonial-card::before {
  content: '"';
  font-family: var(--font-serif);
  font-size: 5rem;
  color: var(--blue);
  opacity: 0.25;
  position: absolute;
  top: 12px; left: 28px;
  line-height: 1;
}
.testimonial-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--navy);
  line-height: 1.7;
  margin-bottom: 20px;
  padding-top: 24px;
}
.testimonial-author {
  font-size: 0.85rem;
  color: var(--text-light);
}
.testimonial-author strong {
  display: block;
  color: var(--text);
  font-weight: 500;
}
@media (max-width: 768px) {
  .testimonial-grid { grid-template-columns: 1fr; }
}

/* ── CTA SECTION ── */
.cta-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 96px 0;
  text-align: center;
}
.cta-section h2, .cta-section p { color: var(--white); }
.cta-section p { opacity: 0.7; margin: 16px auto 40px; max-width: 480px; }

/* ── FOOTER ── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand .logo-name { color: var(--white); }
.footer-brand p { font-size: 0.88rem; margin-top: 16px; line-height: 1.7; }
.footer-col h5 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  transition: var(--transition);
}
.footer-col ul li a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ── CALCOLATORE ── */
.calc-hero {
  padding: 140px 0 64px;
  background: var(--navy);
  text-align: center;
}
.calc-hero h1 { color: var(--white); }
.calc-hero p { color: rgba(255,255,255,0.65); margin: 16px auto 0; max-width: 540px; }

.calc-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 40px;
  padding: 64px 0;
  align-items: start;
}
@media (max-width: 960px) {
  .calc-layout { grid-template-columns: 1fr; }
}

.calc-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 96px;
}
.calc-panel-header {
  background: var(--navy);
  padding: 24px 28px;
  color: var(--white);
}
.calc-panel-header h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--white);
  font-weight: 300;
}
.calc-panel-body { padding: 28px; }

.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  transition: var(--transition);
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 6px; }

.calc-btn {
  width: 100%;
  padding: 14px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}
.calc-btn:hover { background: var(--navy-mid); }
.calc-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Result panel */
.result-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  padding: 48px;
  color: var(--text-light);
}
.result-empty svg { opacity: 0.2; margin-bottom: 16px; }
.result-empty p { font-size: 0.9rem; }

.result-content { display: none; }
.result-content.visible { display: block; }

.result-header {
  background: var(--navy);
  padding: 32px 36px;
  color: var(--white);
}
.result-header h2 {
  color: var(--white);
  font-size: 1.6rem;
  font-weight: 300;
  margin-bottom: 4px;
}
.result-header .result-meta { color: rgba(255,255,255,0.6); font-size: 0.88rem; }

.result-body { padding: 36px; }

.result-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}
.result-kpi {
  text-align: center;
  padding: 24px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.result-kpi-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--navy);
  display: block;
  margin-bottom: 4px;
}
.result-kpi-label { font-size: 0.78rem; color: var(--text-light); }

.result-section-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.result-rows { margin-bottom: 32px; }
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(13,31,60,0.06);
  font-size: 0.9rem;
}
.result-row:last-child { border-bottom: none; }
.result-row-label { color: var(--text-mid); }
.result-row-value { font-weight: 500; color: var(--navy); }
.result-row-value.gold { color: var(--blue); }

.result-disclaimer {
  background: rgba(30,136,212,0.07);
  border: 1px solid rgba(30,136,212,0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.6;
}
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* Spinner */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  padding: 48px;
}
.loading-state.visible { display: flex; }

/* ── CONSULENZA ── */
.consult-hero {
  padding: 140px 0 64px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  text-align: center;
}
.consult-hero h1 { color: var(--white); }
.consult-hero p { color: rgba(255,255,255,0.65); margin: 16px auto 0; max-width: 560px; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 64px 0 0;
}
.service-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
}
.service-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.service-card.selected {
  border-color: var(--blue);
  background: rgba(30,136,212,0.04);
}
.service-card h4 { font-family: var(--font-serif); font-size: 1.2rem; margin: 16px 0 10px; }
.service-card p { font-size: 0.88rem; }
.service-duration {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.booking-form-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  margin: 40px 0 64px;
}
.booking-form-wrap h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; }
  .booking-form-wrap { padding: 32px 24px; }
}

/* ── PAGE HERO (generic) ── */
.page-hero {
  padding: 140px 0 72px;
  text-align: center;
}
.page-hero h1 { margin-bottom: 16px; }
.page-hero p { max-width: 560px; margin: 0 auto; font-size: 1.05rem; }

/* ── DIVIDER ── */
.divider {
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin: 20px auto;
}

/* ── ANIMATE ON SCROLL ── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.in-view {
  opacity: 1;
  transform: none;
}

/* ── CHIP ── */
.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--navy-light);
  color: var(--navy);
}
.chip.blue { background: rgba(30,136,212,0.12); color: var(--blue); }
.chip.green { background: rgba(92,184,92,0.12); color: var(--green); }

/* ── SELECT CUSTOM ── */
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%230d1f3c' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
