/* =============================================================================
   SCEGLICASA — DESIGN SYSTEM TOKENS
   ----------------------------------------------------------------------------
   Allineato al documento "Sceglicasa Cloud Design System".
   Tipografia: REM Bold (titoli) + DM Sans (testo/UI).
   Palette: blu brand #0183F9, ink #363645, neutri freddi.
   Spaziatura 8pt. Raggi 8/12/16. Tono UI sobrio e professionale.
   ----------------------------------------------------------------------------
   17/10/2026 — Font ospitati sul sito (niente più @import Google Fonts).
   File woff2 sottoinsieme latin da @fontsource, solo i pesi usati nel CSS:
   REM 700 · DM Sans 400 / 500 / 600 / 700.
   Contrasto AA: --scc-ink-500 scurito, aggiunti --scc-blue-text (testo blu su
   chiaro) e --scc-blue-on-dark (testo blu su scuro). Sfondi invariati.
   ============================================================================= */

@font-face {
  font-family: 'REM';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/rem-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/dm-sans-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/dm-sans-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/dm-sans-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/dm-sans-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  /* Tipografia */
  --font-heading: 'REM', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Brand Sceglicasa */
  --scc-blue-500: #0183F9;
  --scc-blue-700: #0168C8;
  --scc-blue-050: #EAF4FF;
  --scc-blue-text: #016FD4;     /* testo blu piccolo su bianco/bg: 4,97:1 / 4,71:1 */
  --scc-blue-on-dark: #5AABFF;  /* testo blu su ink-900: 4,92:1 */
  --scc-ink-900: #363645;
  --scc-ink-700: #4C4C5F;
  --scc-ink-500: #6E707C;       /* era #7A7D8A (4,10:1) → 4,92:1 su bianco */
  --scc-bg: #F7F9FC;
  --scc-surface: #FFFFFF;
  --scc-border: #E6EAF0;

  /* Stati */
  --scc-success: #16A34A;
  --scc-warning: #D97706;
  --scc-error: #DC2626;
  --scc-info: #0EA5E9;

  /* Tipografia scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.5rem;
  --text-xl: 2rem;
  --text-2xl: 2.5rem;
  --text-3xl: 3.25rem;
  --text-display: 4.25rem;

  /* Spaziatura 8pt */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Raggi (da design system) */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Ombre — sobrie, funzionali */
  --shadow-sm: 0 1px 2px rgba(54, 54, 69, 0.06);
  --shadow-md: 0 4px 12px rgba(54, 54, 69, 0.08);
  --shadow-lg: 0 12px 32px rgba(54, 54, 69, 0.10);

  /* Container */
  --container-md: 768px;
  --container-lg: 1100px;
  --container-xl: 1280px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ----------------------------------------------------------------------------
   Reset & base
   ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--scc-ink-900);
  background: var(--scc-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--scc-ink-900);
  margin: 0 0 var(--space-4);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 4.5vw + 1rem, var(--text-display)); }
h2 { font-size: clamp(1.75rem, 2.5vw + 1rem, var(--text-3xl)); }
h3 { font-size: clamp(1.25rem, 1.2vw + 0.85rem, var(--text-xl)); }

p { margin: 0 0 var(--space-4); color: var(--scc-ink-700); }

a { color: var(--scc-blue-500); text-decoration: none; transition: color 200ms var(--ease-out); }
/* rimosso `a:hover { color: var(#fff); }`: dichiarazione non valida, già ignorata dai browser */

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

button { font-family: inherit; cursor: pointer; border: 0; background: none; }

::selection { background: var(--scc-blue-050); color: var(--scc-ink-900); }

:focus-visible {
  outline: 2px solid var(--scc-blue-500);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ----------------------------------------------------------------------------
   Layout utilities
   ---------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container--xl { max-width: var(--container-xl); }

.section { padding: var(--space-20) 0; }
@media (max-width: 768px) {
  .section { padding: var(--space-16) 0; }
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--scc-blue-text);
  margin-bottom: var(--space-4);
}

/* ----------------------------------------------------------------------------
   Header / Sceglicasa branding bar
   ---------------------------------------------------------------------------- */
.scc-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--scc-border);
  transition: box-shadow 200ms var(--ease-out);
}
.scc-bar.is-scrolled { box-shadow: var(--shadow-sm); }

.scc-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-3) var(--space-6);
  max-width: var(--container-xl);
  margin: 0 auto;
}

.scc-bar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.scc-bar__brand img, .scc-footer__top img {
  height: 32px;
  width: auto;
}
.scc-bar__brand-mark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--scc-blue-500);
  letter-spacing: -0.02em;
}
.scc-bar__brand-mark span { color: var(--scc-ink-900); }
.scc-bar__brand-sub {
  font-size: var(--text-xs);
  color: var(--scc-ink-500);
  border-left: 1px solid var(--scc-border);
  padding-left: var(--space-3);
  margin-left: var(--space-1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scc-bar__nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.scc-bar__nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--scc-ink-700);
}
.scc-bar__nav a:hover { color: var(--scc-blue-500); }

.scc-bar__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--scc-blue-text);
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--scc-blue-500);
  border-radius: var(--radius-sm);
  transition: all 200ms var(--ease-out);
}
.scc-bar__cta:hover {
  background: var(--scc-blue-500);
  color: #fff;
}

@media (max-width: 880px) {
  .scc-bar__nav { display: none; }
  .scc-bar__brand-sub { display: none; }
}

/* ----------------------------------------------------------------------------
   Buttons (allineati al design system Sceglicasa)
   ---------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 180ms var(--ease-out), color 180ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
  text-decoration: none;
  min-height: 44px;
}

.btn--primary {
  background: var(--scc-blue-500);
  color: #fff;
}
.btn--primary:hover {
  background: var(--scc-blue-700);
}
.btn--primary:active {
  background: var(--scc-blue-700);
  transform: translateY(1px);
}

.btn--secondary {
  background: var(--scc-surface);
  color: var(--scc-ink-900);
  border: 1.5px solid var(--scc-border);
}
.btn--secondary:hover {
  border-color: var(--scc-ink-900);
  background: var(--scc-bg);
}

.btn--ghost {
  background: transparent;
  color: var(--scc-blue-500);
}
.btn--ghost:hover {
  background: var(--scc-blue-050);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  min-height: 52px;
}

.btn__arrow { transition: transform 180ms var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ----------------------------------------------------------------------------
   Form
   ---------------------------------------------------------------------------- */
.form { display: grid; gap: var(--space-5); }

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 640px) { .form__row { grid-template-columns: 1fr; } }

.form__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.form__field label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--scc-ink-700);
}
.form__field label .req { color: var(--scc-error); margin-left: 2px; }

.form__field input,
.form__field select,
.form__field textarea {
  font-family: inherit;
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--scc-border);
  border-radius: var(--radius-sm);
  background: var(--scc-surface);
  color: var(--scc-ink-900);
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
  width: 100%;
  min-height: 44px;
}
.form__field input::placeholder,
.form__field textarea::placeholder {
  color: var(--scc-ink-500);
}
.form__field input:focus,
.form__field select:focus,
.form__field textarea:focus {
  outline: none;
  border-color: var(--scc-blue-500);
  box-shadow: 0 0 0 3px rgba(1, 131, 249, 0.16);
}
.form__field textarea {
  min-height: 110px;
  resize: vertical;
}

.form__field--check {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-3);
}
.form__field--check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--scc-blue-500);
}
.form__field--check label {
  font-size: var(--text-xs);
  color: var(--scc-ink-500);
  line-height: 1.55;
}
.form__field--check label a {
  color: var(--scc-blue-text);
  text-decoration: underline;
}

.form__helper {
  font-size: var(--text-xs);
  color: var(--scc-ink-500);
  margin-top: -2px;
}

.form__success {
  padding: var(--space-5) var(--space-6);
  background: rgba(22, 163, 74, 0.08);
  border: 1.5px solid var(--scc-success);
  border-radius: var(--radius-md);
  color: var(--scc-success);
  font-weight: 500;
}

/* Stato errore campo */
.form__field.has-error input,
.form__field.has-error select,
.form__field.has-error textarea {
  border-color: var(--scc-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.form__field.has-error label {
  color: var(--scc-error);
}
.form__error {
  display: block;
  font-size: var(--text-xs);
  color: var(--scc-error);
  margin-top: var(--space-1);
  font-weight: 500;
  line-height: 1.4;
}

.form__field--check label[for="o_privacy"], .form__field--check label[for="o_marketing"] {
    width: 90%;
    align-self: flex-end;
}

/* Su checkbox: l'errore va a capo sotto entrambi i flex-children */
.form__field--check  {
  flex-wrap: wrap;
  margin: 10px 0;
}
.form__field--check .form__error {
  width: 100%;
  margin-left: calc(18px + var(--space-3));
}
.form__field--check.has-error input[type="checkbox"] {
  outline: 2px solid var(--scc-error);
  outline-offset: 2px;
  box-shadow: none;
}

/* Banner errore generale (es. webhook down) */
.form__error-banner {
  padding: var(--space-3) var(--space-4);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--radius-sm);
  color: var(--scc-error);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.5;
}

/* Spinner loading bottone submit */
.form__spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: scc-spin 0.7s linear infinite;
  margin-right: var(--space-1);
  vertical-align: -2px;
}
@keyframes scc-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .form__spinner { animation-duration: 1.4s; }
}

button[type="submit"][aria-busy="true"] {
  cursor: wait;
  opacity: 0.85;
}

/* ----------------------------------------------------------------------------
   Reveal animation
   ---------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ----------------------------------------------------------------------------
   Footer Sceglicasa shared
   ---------------------------------------------------------------------------- */
.scc-footer {
  background: var(--scc-ink-900);
  color: rgba(255, 255, 255, 0.72);
  padding: var(--space-16) 0 var(--space-8);
  font-size: var(--text-sm);
}
.scc-footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
@media (max-width: 880px) {
  .scc-footer__top { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
}
@media (max-width: 540px) {
  .scc-footer__top { grid-template-columns: 1fr; }
}
.scc-footer__brand {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
.scc-footer__brand .accent { color: var(--scc-blue-500); }
.scc-footer__about {
  color: rgba(255, 255, 255, 0.6);
  max-width: 38ch;
  line-height: 1.6;
  margin: 0;
}
/* h3 nella home (ordine titoli h2 → h3); h4 mantenuto per le altre landing */
.scc-footer h3,
.scc-footer h4 {
  color: #fff;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-4);
  font-family: var(--font-body);
  font-weight: 600;
}
.scc-footer ul { list-style: none; padding: 0; margin: 0; }
.scc-footer li { margin-bottom: var(--space-2); line-height: 1.5; }
.scc-footer a { color: rgba(255, 255, 255, 0.72); }
.scc-footer a:hover { color: #fff; }
.scc-footer__contact-line {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}
.scc-footer__contact-line strong { color: #fff; font-weight: 500; }
.scc-footer__bottom {
  padding-top: var(--space-8);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.56); /* era .5 (4,25:1) → 4,9:1 */
}
.scc-footer__bottom a { color: rgba(255, 255, 255, 0.56); }
.scc-footer__bottom a:hover { color: rgba(255, 255, 255, 0.8); }
