/* ==========================================================================
   OPERAGEST & ANCS — MOBILE-FIRST DESIGN SYSTEM
   Design mobile-first: mobile prima, poi tablet/desktop via media query.
   ========================================================================== */

:root {
  /* Spacing Scale (4/8) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Z-Index Nominati */
  --z-base: 1;
  --z-card: 10;
  --z-nav: 100;
  --z-drawer: 200;
  --z-modal: 500;
  --z-toast: 1000;

  /* Durate Transizioni */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Colori & Contrasti Accessibili (>= 4.5:1 per testo, 3:1 per UI) */
  --paper: #f8f6f0;
  --paper-card: #ffffff;
  --travertine: #ece6dc;
  --line: #d8cfc0;
  --line-strong: #a89a85;
  --ink: #111417;
  --ink-soft: #2d3339;
  --muted: #59636e;
  --bronze: #7a5a35;
  --bronze-dark: #543d22;
  --bronze-light: #9c784f;
  --gold: #b38612;
  --gold-dark: #8c6708;
  --navy: #0f2438;
  --navy-dark: #07131e;
  --navy-light: #1c3650;
  --accent-green: #156934;
  --accent-red: #991b1b;
  --shadow-sm: 0 2px 8px rgba(17, 20, 23, 0.05);
  --shadow-md: 0 8px 24px rgba(17, 20, 23, 0.08);
  --shadow-lg: 0 16px 40px rgba(17, 20, 23, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-serif: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Reset e Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 100%; /* Rispetta impostazioni dimensione testo utente (WCAG 1.4.4) */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus Visible - Accessibilità */
:focus-visible {
  outline: 3px solid var(--bronze) !important;
  outline-offset: 2px !important;
}

/* Prefer Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Tipografia Base */
h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
  color: var(--ink);
  letter-spacing: 0.02em;
  font-weight: 700;
  margin-top: 0;
}

h1 {
  font-size: clamp(28px, 6vw, 48px);
  line-height: 1.1;
}

h2 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.2;
}

h3 {
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.25;
}

h4 {
  font-size: clamp(18px, 2.5vw, 22px);
  line-height: 1.3;
}

p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  line-height: 1.6;
}

a {
  color: var(--bronze);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--bronze-dark);
}

/* Layout Wrapper - Mobile First: padding laterale 16px, container max-width */
.wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap-narrow {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Elementi di Stile Base */
.kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--bronze);
  margin-bottom: 8px;
  display: block;
}

.kicker-ancs {
  color: #dfb26b;
}

/* Pulsanti e Bottoni - Mobile Friendly (min 44px touch target) */
.cta, .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bronze);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bronze-dark);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 48px;
  width: 100%;
  text-align: center;
}

.cta:hover, .btn-primary:hover {
  background: var(--bronze-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.cta-secondary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--paper-card);
  color: var(--ink) !important;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 48px;
}

.cta-secondary:hover, .btn-secondary:hover {
  background: var(--travertine);
  border-color: var(--bronze);
}

.cta-gold {
  background: linear-gradient(135deg, #dfb26b 0%, #b89327 100%);
  color: #0f2438 !important;
  border: 1px solid #d4af37;
  font-weight: 700;
}

.cta-gold:hover {
  filter: brightness(1.08);
}

/* Card e Pannelli */
.card-panel {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-panel:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

/* Griglie Responsive */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

.grid-4 {
  grid-template-columns: 1fr;
}

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

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

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

/* Tabelle di Registro */
.table-styled {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  overflow-x: auto;
}

.table-styled th {
  background: var(--travertine);
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 2px solid var(--line-strong);
}

.table-styled td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: middle;
}

.table-styled tr:hover td {
  background: rgba(236, 230, 220, 0.3);
}

/* Badges e Status */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-approvata {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
}

.badge-attesa {
  background: #fff8e1;
  color: #b45305;
  border: 1px solid #e5c27f;
}

.badge-istruttoria {
  background: #e3f2fd;
  color: #0d47a1;
  border: 1px solid #bbdefb;
}

.badge-respinta {
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #ffcdd2;
}

/* Form Styles - Mobile First */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px; /* 16px previene zoom su iOS */
  font-family: var(--font-sans);
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(140, 106, 69, 0.15);
}

label {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

/* Notifiche & Alert */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
}

.alert-success {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  color: #1b5e20;
}

.alert-error {
  background: #fdecea;
  border: 1px solid #d9a3a3;
  color: #b71c1c;
}

.alert p {
  margin: 0;
}

/* Avviso Sito in Costituzione */
.warn-banner {
  background: #fdecea;
  border: 2px solid #b71c1c;
  color: #b71c1c;
  padding: 24px;
  border-radius: var(--radius-sm);
  margin: 24px 0;
  text-align: center;
}

.warn-banner h2 {
  color: var(--ink);
}

.warn-banner p {
  color: var(--ink);
}

.warn-banner a {
  color: var(--bronze);
  text-decoration: underline;
}

/* Sezioni */
.section {
  margin-bottom: 40px;
}

.section .t-18, .section h2 {
  margin-bottom: 24px;
}

.section h3 {
  margin-bottom: 16px;
}

.card-panel .t-18 {
  margin-top: 0;
}

.section p {
  line-height: 1.7;
}

.section p.t-18 {
  font-size: 1.25rem;
}

.section ul {
  margin-left: 20px;
  margin-bottom: 24px;
  color: var(--ink-soft);
}

.section ul li {
  margin-bottom: 8px;
}

.section .t-12 {
  font-size: 1rem;
}

.section .t-15 {
  font-size: 1.2rem;
}

.section .c-muted {
  color: var(--muted);
}

.section .c-brown {
  color: var(--bronze);
}

.section .card-panel .t-14 {
  font-size: 1rem;
}

/* Card Product / Servizio */
.card-hover-card .t-15 {
  margin-bottom: 12px;
}

.card-hover-card p {
  margin-bottom: 0;
}

.card-reason p {
  margin-bottom: 8px;
}

.card-reason .t-14 {
  font-size: 1rem;
}

.card-conclusion p {
  margin-bottom: 16px;
}

.card-action .btn-conclusion {
  margin-top: 24px;
}

/* Carrusel Placeholder */
.placeholder-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 40px 20px;
  text-align: center;
}

.placeholder-text p {
  margin-bottom: 0;
}

/* Altri elementi */
footer {
  padding: 40px 20px;
}

footer .table-styled {
  font-size: 14px;
}

footer .table-styled th,
footer .table-styled td {
  padding: 8px 12px;
}

footer .t-11 {
  font-size: 0.9rem;
}

footer .t-13 {
  font-size: 1rem;
}

footer .badge-status {
  font-size: 11px;
}

.footer-text-btn {
  color: var(--bronze);
  text-decoration: underline;
}

.footer-text-btn:hover {
  color: var(--bronze-dark);
}

footer .footer-contact-line {
  margin-bottom: 12px;
}

footer .footer-contact-line b {
  color: var(--ink);
}

footer .footer-contact-line a {
  color: var(--bronze);
  text-decoration: underline;
}

footer .footer-contact-line a:hover {
  color: var(--bronze-dark);
}

.alert p {
  margin: 0;
}

/* ==========================================================================
   VIDEO WEBINAR HOME — PLAY BUTTON ORO STILE YT CON RIFLESSI METALLICI
   ========================================================================== */
.webinar-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: block;
}
.webinar-wrap video {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  object-fit: contain;
}
.webinar-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ffd700 0%, #e8b800 30%, #b8860b 55%, #d4a017 100%);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 -1px 6px rgba(255, 255, 255, 0.75),
    inset 0 1px 4px rgba(139, 100, 10, 0.55),
    0 10px 26px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(212, 160, 23, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  padding: 0;
}
.webinar-play:hover {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow:
    inset 0 -1px 6px rgba(255, 255, 255, 0.85),
    inset 0 1px 4px rgba(139, 100, 10, 0.6),
    0 0 30px rgba(255, 215, 0, 0.55),
    0 12px 30px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(212, 160, 23, 0.5);
}
.webinar-play:focus-visible {
  outline: 3px solid #ffd700;
  outline-offset: 3px;
}
.webinar-play[aria-pressed="true"],
.webinar-play.webinar-play--hidden {
  opacity: 0;
  pointer-events: none;
}
.webinar-play-tri {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent #111417;
  transform: translateX(2px);
  flex-shrink: 0;
}
.webinar-play::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.5) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.webinar-play:hover::before {
  opacity: 1;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}