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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Lascia selezionabili i campi del form (input, textarea, select) */
input, textarea, select {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

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

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

ul {
  list-style: none;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ==================== HEADER ==================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: box-shadow var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-lg);
  color: var(--color-primary);
}

/* ===== Emblema medaglione — coin flip ===== */
/* Solo il medaglione ruota come una moneta sull'asse Y. Entrambi i lati hanno
   lo stesso aspetto: bilancia oro su sfondo blu. Il testo resta fermo e leggibile. */
.logo-emblem {
  display: block;
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  perspective: 700px;
  filter: drop-shadow(0 2px 5px rgb(15 36 64 / 0.28));
  transition: transform var(--transition-base);
}

.logo-coin {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: logoCoinFlip 8s cubic-bezier(0.66, 0, 0.34, 1) infinite;
}

.logo-face {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.logo-face svg {
  display: block;
  width: 100%;
  height: 100%;
}

.logo-face--back {
  transform: rotateY(180deg);
}

/* due flip eleganti con brevi pause (stesso aspetto su entrambi i lati) */
@keyframes logoCoinFlip {
  0%, 18%    { transform: rotateY(0deg); }
  38%, 58%   { transform: rotateY(180deg); }
  78%, 100%  { transform: rotateY(360deg); }
}

.logo:hover .logo-emblem {
  transform: scale(1.06);
}

/* Wordmark — "Studio" stabile, "Vicari" con accento oro statico */
.logo-text {
  font-weight: var(--font-medium);
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

.logo-text strong {
  font-weight: var(--font-bold);
  background: linear-gradient(135deg, var(--color-secondary-light), var(--color-secondary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--color-secondary); /* fallback */
}

/* Riduci-movimento: il flip resta (è il marchio) ma molto più lento e calmo */
@media (prefers-reduced-motion: reduce) {
  .logo-coin { animation-duration: 16s; }
  .logo:hover .logo-emblem { transform: none; }
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition-base);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: var(--color-bg-alt);
  padding: calc(var(--header-height) + var(--space-8)) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: var(--shadow-xl);
  transition: right var(--transition-base);
}

.nav.active {
  right: 0;
}

.nav-link {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  color: var(--color-text);
  padding: var(--space-2) 0;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--color-primary);
}

/* Desktop Navigation */
@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }

  .nav {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    background: transparent;
    padding: 0;
    flex-direction: row;
    align-items: center;
    gap: var(--space-6);
    box-shadow: none;
  }

  .nav-link {
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
  }
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--color-secondary);
  color: var(--color-primary-dark);
  border-color: var(--color-secondary);
}

.btn-primary:hover {
  background: var(--color-secondary-dark);
  border-color: var(--color-secondary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-inverse);
  border-color: transparent;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
}

.btn-large {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-loading {
  display: none;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-loading {
  display: inline;
}

/* ==================== HERO SECTION ==================== */
.hero {
  padding: calc(var(--header-height) + var(--space-12)) 0 var(--space-10);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-text-inverse);
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.hero-title .highlight {
  color: var(--color-secondary);
}

.hero-subtitle {
  font-size: var(--text-lg);
  opacity: 0.9;
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

.hero-cta .btn {
  /* Fallback visibilità - GSAP anima da opacity:0 */
  opacity: 1;
  transform: translateY(0);
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-6);
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255,255,255,0.2);
}

.visit-counter {
  text-align: center;
  font-size: var(--text-sm);
  margin: var(--space-8) 0 0 0;
  opacity: 0.85;
}

.visit-counter[hidden] {
  display: none;
}

.visit-counter-number {
  font-weight: var(--font-bold);
  margin-right: 0.35em;
}

.badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  opacity: 0.85;
}

.badge svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 768px) {
  .hero {
    padding: calc(var(--header-height) + var(--space-20)) 0 var(--space-16);
  }

  .hero-title {
    font-size: var(--text-5xl);
  }

  .hero-subtitle {
    font-size: var(--text-xl);
  }

  .hero-cta {
    flex-direction: row;
    justify-content: center;
  }
}

/* ==================== SECTIONS ==================== */
.section {
  padding: var(--space-16) 0;
}

.section-light {
  background: var(--color-bg);
}

.section-dark {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  text-align: center;
  margin-bottom: var(--space-2);
}

.section-dark .section-title {
  color: var(--color-text-inverse);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-light);
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-cta .container {
  text-align: center;
}

.section-cta .section-title {
  margin-bottom: var(--space-6);
}

/* CTA link — statico in idle, oro su hover */
.cta-shimmer-link {
  display: inline-block;
  color: var(--color-text-light);
  text-decoration: none;
  transition: color var(--transition-base), transform var(--transition-base);
}

.cta-shimmer-link:hover {
  color: var(--color-secondary);
  transform: translateY(-1px);
}

.section-dark .section-subtitle {
  color: rgba(255,255,255,0.8);
}

/* Payment Info */
.payment-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-8);
}

.payment-info svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-24) 0;
  }

  .section-title {
    font-size: var(--text-4xl);
  }
}

/* ==================== STEPS (Come Funziona) ==================== */
.steps {
  display: grid;
  gap: var(--space-8);
}

.step {
  text-align: center;
  padding: var(--space-6);
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
}

.step-number {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  background: var(--color-secondary);
  color: var(--color-primary-dark);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--space-4);
  background: var(--color-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--color-text-inverse);
}

.step-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-2);
}

.step-text {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }
}

/* ==================== SERVICES GRID ==================== */
.services-grid {
  display: grid;
  gap: var(--space-6);
}

.service-card {
  background: var(--color-bg-alt);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.service-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-text-inverse);
}

.service-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-2);
}

.service-text {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: var(--leading-relaxed);
}

@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==================== FEATURES ==================== */
.features {
  display: grid;
  gap: var(--space-8);
}

.feature {
  text-align: center;
}

.feature-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto var(--space-4);
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--color-primary);
}

.feature-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-2);
}

.feature-text {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

@media (min-width: 768px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-10);
  }
}

@media (min-width: 1024px) {
  .features {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==================== CONTACT FORM ==================== */
.contact-form {
  max-width: 700px;
  margin: 0 auto;
  background: var(--color-bg-alt);
  padding: var(--space-6);
  padding-bottom: var(--space-8);
  border-radius: var(--radius-lg);
}

.form-row {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--color-error);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.form-input.error,
.form-select.error {
  border-color: var(--color-error);
}

.form-input.success,
.form-select.success {
  border-color: var(--color-success);
}

.form-textarea {
  min-height: 240px;
  max-height: 85vh;
  overflow-y: auto;
  resize: vertical;
  field-sizing: content;
}

.form-error {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
  min-height: 18px;
}

.form-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-light);
  margin-top: var(--space-1);
}

/* ==================== FILE UPLOAD ==================== */
.file-upload-area {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.file-upload-area:hover,
.file-upload-area.dragover {
  border-color: var(--color-primary);
  background-color: rgba(26, 54, 93, 0.02);
}

.file-upload-area.has-files {
  border-style: solid;
  border-color: var(--color-success);
  background-color: rgba(56, 161, 105, 0.02);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-content {
  pointer-events: none;
}

.file-upload-content svg {
  width: 40px;
  height: 40px;
  stroke: var(--color-text-light);
  margin: 0 auto var(--space-3);
}

.file-upload-text {
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.file-upload-text span {
  color: var(--color-primary);
  font-weight: var(--font-medium);
  text-decoration: underline;
}

.file-upload-hint {
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

/* File List */
.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.file-list:empty {
  display: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.file-item svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-primary);
  flex-shrink: 0;
}

.file-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
}

.file-item-size {
  color: var(--color-text-light);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.file-item-remove {
  background: none;
  border: none;
  padding: var(--space-1);
  cursor: pointer;
  color: var(--color-text-light);
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

.file-item-remove:hover {
  color: var(--color-error);
}

.file-item-remove svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.form-checkbox .form-error {
  width: 100%;
  margin-left: calc(18px + var(--space-3));
}

.form-checkbox input {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.form-checkbox label {
  flex: 1;
  min-width: 0;
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-normal);
}

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

.form-success {
  display: none;
  text-align: center;
  padding: var(--space-8);
}

.form-success.show {
  display: block;
}

.form-success svg {
  width: 60px;
  height: 60px;
  stroke: var(--color-success);
  margin: 0 auto var(--space-4);
}

.form-success h3 {
  font-size: var(--text-xl);
  color: var(--color-success);
  margin-bottom: var(--space-2);
}

.form-success p {
  color: var(--color-text);
}

.btn-download-receipt {
  margin-top: var(--space-6);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-download-receipt svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  margin: 0;
}

.btn-download-receipt:disabled {
  opacity: 0.7;
  cursor: wait;
}

@media (min-width: 768px) {
  .contact-form {
    padding: var(--space-10);
  }

  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== FOOTER ==================== */
.footer {
  background: var(--color-primary-dark);
  color: var(--color-text-inverse);
  padding: var(--space-12) 0 var(--space-6);
}

.footer-grid {
  display: grid;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer-brand .logo {
  color: var(--color-text-inverse);
  margin-bottom: var(--space-4);
}

/* sul fondo blu scuro del footer il medaglione blu sparirebbe: alone oro tenue */
.footer-brand .logo-emblem {
  filter: drop-shadow(0 0 6px rgb(201 162 39 / 0.35)) drop-shadow(0 2px 5px rgb(0 0 0 / 0.4));
}

.footer-brand p {
  font-size: var(--text-sm);
  opacity: 0.8;
  line-height: var(--leading-relaxed);
}

.footer-links h4,
.footer-contact h4 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-4);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  font-size: var(--text-sm);
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.footer-links a:hover {
  opacity: 1;
}

.footer-contact {
  display: flex;
  flex-direction: column;
}

.footer-contact p {
  font-size: var(--text-sm);
}

.footer-contact p + p {
  margin-top: var(--space-2);
}

.footer-contact svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  opacity: 0.7;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.admin-link {
  opacity: 0.4;
  transition: opacity var(--transition-fast);
  display: inline-flex;
  margin-left: auto;
}

/* Credito webmaster — centrato in fondo al footer, con shimmer oro */
.footer-webmaster {
  text-align: center;
  margin-top: var(--space-4);
}

.footer-webmaster a {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-secondary); /* fallback */
  background: linear-gradient(90deg, #a68b1f 0%, #c9a227 25%, #f6e6ab 50%, #c9a227 75%, #a68b1f 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: webmasterShimmer 4s linear infinite;
  transition: transform var(--transition-base), filter var(--transition-base);
}

.footer-webmaster a:hover {
  transform: translateY(-1px) scale(1.05);
  filter: drop-shadow(0 0 7px rgba(201, 162, 39, 0.65));
}

@keyframes webmasterShimmer {
  to { background-position: 200% center; }
}

@media (prefers-reduced-motion: reduce) {
  .footer-webmaster a { animation: none; }
}

.admin-link:hover { opacity: 0.8; }

.admin-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

/* ==================== ANIMATIONS ==================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Overlay mobile menu */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  z-index: 999;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ==================== PAGE HEADER (Internal Pages) ==================== */
.page-header {
  padding: calc(var(--header-height) + var(--space-12)) 0 var(--space-12);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-text-inverse);
  text-align: center;
}

.page-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
}

.page-subtitle {
  font-size: var(--text-lg);
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .page-header {
    padding: calc(var(--header-height) + var(--space-16)) 0 var(--space-16);
  }

  .page-title {
    font-size: var(--text-4xl);
  }
}

/* ==================== BREADCRUMB ==================== */
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  opacity: 0.8;
  margin-bottom: var(--space-4);
}

.breadcrumb a {
  color: var(--color-text-inverse);
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.breadcrumb a:hover {
  opacity: 1;
}

.breadcrumb-separator {
  opacity: 0.5;
}

/* ==================== TEAM PAGE ==================== */
.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: stretch;
  justify-content: center;
  max-width: 1080px;
  margin: 0 auto;
}

.team-grid .lawyer-card {
  transform: translateY(0) !important;
}

.lawyer-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.lawyer-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.lawyer-avatar {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lawyer-avatar svg {
  width: 64px;
  height: 64px;
  color: var(--color-text-inverse);
  opacity: 0.85;
}

.lawyer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.lawyer-initials {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--color-text-inverse);
}

.lawyer-info {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: center;
}

.lawyer-name {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.lawyer-title {
  font-size: var(--text-sm);
  color: var(--color-secondary);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-3);
}

.lawyer-bio {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: var(--leading-relaxed);
  text-align: justify;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lawyer-card.expanded .lawyer-bio {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.lawyer-toggle {
  margin-top: var(--space-3);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-secondary);
  cursor: pointer;
  align-self: center;
  transition: color var(--transition-base);
}

.lawyer-toggle:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(280px, 320px));
  }
}

@media (min-width: 1024px) {
  .team-grid {
    grid-template-columns: repeat(3, minmax(280px, 320px));
  }
}

/* ==================== BLOG PAGE ==================== */
.blog-grid {
  display: grid;
  gap: var(--space-8);
  align-items: start;
}

.blog-grid .article-card {
  transform: translateY(0) !important;
}

.article-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.article-card .article-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.article-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-image svg {
  width: 48px;
  height: 48px;
  stroke: var(--color-text-inverse);
  opacity: 0.6;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-hero {
  max-width: 1200px;
  margin: 0 auto var(--space-8);
  padding: 0 var(--space-4);
}

.article-hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md, 8px);
}

.article-content {
  padding: var(--space-6);
}

.article-category {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.article-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
  line-height: var(--leading-tight);
}

.article-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.article-link {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.article-link:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==================== ARTICLE PAGE ==================== */
.article-header {
  padding: calc(var(--header-height) + var(--space-12)) 0 var(--space-8);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-text-inverse);
}

.article-header .container {
  max-width: 800px;
}

.article-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
  line-height: var(--leading-tight);
}

.article-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-sm);
  opacity: 0.8;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-12) var(--container-padding);
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin: var(--space-10) 0 var(--space-4);
}

.article-body h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin: var(--space-8) 0 var(--space-3);
}

.article-body p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.article-body ul,
.article-body ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}

.article-body a {
  color: var(--color-primary);
  text-decoration: underline;
}

.article-body blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid var(--color-secondary);
  background: var(--color-bg);
  font-style: italic;
  color: var(--color-text);
}

@media (min-width: 768px) {
  .article-header {
    padding: calc(var(--header-height) + var(--space-16)) 0 var(--space-10);
  }

  .article-header h1 {
    font-size: var(--text-4xl);
  }
}

/* ==================== ARTICLE CTA ==================== */
.article-cta {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-text-inverse);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  text-align: center;
  margin-top: var(--space-12);
}

.article-cta h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
}

.article-cta p {
  opacity: 0.9;
  margin-bottom: var(--space-6);
}

/* ==================== PRIVACY PAGE ==================== */
.privacy-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-12) var(--container-padding);
}

.privacy-content h2 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin: var(--space-8) 0 var(--space-4);
}

.privacy-content p {
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.privacy-content ul {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
  list-style: disc;
}

.privacy-content li {
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}

/* ==================== LOCAL LANDING PAGE ==================== */
.local-hero {
  padding: calc(var(--header-height) + var(--space-12)) 0 var(--space-12);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-text-inverse);
}

.local-hero .container {
  text-align: center;
}

.local-hero h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
}

.local-hero p {
  font-size: var(--text-lg);
  opacity: 0.9;
  margin-bottom: var(--space-6);
}

.local-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.local-info-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.local-info-item svg {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

.map-embed {
  width: 100%;
  height: 300px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: var(--space-8);
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (min-width: 768px) {
  .local-hero {
    padding: calc(var(--header-height) + var(--space-16)) 0 var(--space-16);
  }

  .local-hero h1 {
    font-size: var(--text-4xl);
  }

  .map-embed {
    height: 400px;
  }
}

/* ==================== UTILITIES ==================== */
.text-center {
  text-align: center;
}

.mt-8 {
  margin-top: var(--space-8);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

/* ==================== FLOATING CTA ==================== */
.floating-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  padding: var(--space-3) var(--space-6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

.floating-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.floating-cta.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

/* Gruppo volto + bottone flottante */
.floating-cta-group {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.floating-cta-group.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

/* Dentro al gruppo il bottone non e' piu' posizionato in autonomia */
.floating-cta-group .floating-cta {
  position: static;
  bottom: auto;
  right: auto;
}

/* Foto circolare rotante dei professionisti dello Studio */
.floating-cta-avatar {
  position: relative;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #1a365d;
  border: 2px solid var(--color-accent, #c9a227);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.floating-cta-avatar .fca-face {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Mobile: full width */
@media (max-width: 768px) {
  .floating-cta {
    bottom: 16px;
    right: 16px;
    left: 16px;
    text-align: center;
  }

  .floating-cta-group {
    left: 16px;
    right: 16px;
    bottom: 16px;
    gap: 10px;
  }

  .floating-cta-group .floating-cta {
    flex: 1;
  }

  .floating-cta-avatar {
    width: 50px;
    height: 50px;
  }
}
