

.page-contatti {
  --radius: clamp(1.75rem, 3.5vw, 3.5rem);
  --error: #b42318;
  --error-bg: #fdf1f0;
  --field-bg: #f3f3f1;
}

.ct-open__title,
.ct-side__title,
.ct-done__title {
  font-family: var(--font-title);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.ct-open {
  position: relative;
  background: var(--paper);
  padding: calc(var(--nav-h) + clamp(2rem, 5vw, 4rem)) var(--gutter) calc(clamp(3.5rem, 7vw, 5.5rem) + var(--radius));
  text-align: center;
}

.ct-open__title {
  font-size: clamp(5rem, 22vw, 21rem);
  line-height: 0.84;
  color: var(--magenta);
}
.ct-open__title .rise { padding-top: 0.06em; }

.ct-open__sub {
  max-width: 46ch;
  margin: clamp(1.25rem, 2.5vw, 2rem) auto 0;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-soft);
}

.ct-sheet {
  position: relative;
  margin-top: calc(var(--radius) * -1);
  padding: clamp(4rem, 7vw, 6.5rem) var(--gutter) calc(clamp(4rem, 7vw, 6rem) + var(--radius));
  background: var(--magenta);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -30px 60px -20px rgb(21 23 42 / 0.28);
}

.ct-sheet__in {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2.5rem, 6vw, 7rem);
  align-items: start;
  max-width: 1480px;
  margin-inline: auto;
}

.ct-side__sticky {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}

.ct-side__title {
  font-size: clamp(3.25rem, 7.2vw, 8rem);
  line-height: 0.9;
}
.ct-side__title .rise { padding-top: 0.06em; margin-top: -0.06em; }

.ct-side__text {
  max-width: 30ch;
  margin-top: clamp(1.25rem, 2vw, 1.75rem);
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.35;
}

.ct-direct {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.25rem;
  border-top: 1px solid rgb(255 255 255 / 0.35);
}
.ct-direct__label {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ct-direct__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.ct-direct__row + .ct-direct__row { margin-top: 0.25rem; }

.ct-direct__link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-size: clamp(1.4rem, 2.3vw, 2.1rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 calc(50% + 0.75em) / 100% 2px no-repeat;
  transition: background-size 300ms var(--ease-out), transform 160ms var(--ease-out);
}
.ct-direct__link:active { transform: scale(0.98); }
.ct-direct__link:focus-visible { outline-color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .ct-direct__link:hover { background-size: 0% 2px; background-position-x: 100%; }
}

.ct-copy {
  display: inline-grid;
  place-items: center;
  min-width: 5.5rem;
  min-height: 44px;
  padding: 0 1rem;
  border: 1.5px solid rgb(255 255 255 / 0.7);
  border-radius: 999px;
  font-size: 0.9375rem;
  color: #fff;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
}
.ct-copy:active { transform: scale(0.96); }
.ct-copy:focus-visible { outline-color: #fff; border-radius: 999px; }
.ct-copy.is-done { background: #fff; color: var(--magenta); border-color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .ct-copy:hover { border-color: #fff; background: rgb(255 255 255 / 0.12); }
  .ct-copy.is-done:hover { background: #fff; }
}

.ct-card {
  position: relative;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
  padding: clamp(1.5rem, 3.4vw, 3rem);
  border-radius: clamp(1.25rem, 2vw, 1.75rem);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 40px 80px -40px rgb(21 23 42 / 0.5);
}

.ct-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.25rem;
}
.field { min-width: 0; margin: 0; padding: 0; border: 0; }
.field--wide { grid-column: 1 / -1; }

.field__label {
  display: block;
  margin-bottom: 0.5rem;
  padding: 0;
  font-size: 0.975rem;
  line-height: 1.3;
  color: var(--ink);
}
.field__opt {
  margin-left: 0.35em;
  font-size: 0.8125rem;
  color: var(--muted);
}

.field__input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 0 1rem;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: var(--field-bg);
  font: inherit;
  font-size: 1.0625rem;
  color: var(--ink);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
  appearance: none;
}
.field__input--area {
  min-height: 9.5rem;
  padding: 0.9rem 1rem;
  line-height: 1.5;
  resize: vertical;
}
.field__input::placeholder { color: var(--muted); opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .field__input:hover { border-color: #d3d4da; }
}

.field__input:focus,
.field__input:focus-visible {
  outline: none;
  border-color: var(--navy);
  background: var(--white);
  box-shadow: 0 0 0 4px rgb(32 52 98 / 0.14);
}
.field__input[aria-invalid="true"] { border-color: var(--error); background: var(--error-bg); }
.field__input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgb(180 35 24 / 0.14); background: var(--white); }

.field__error {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--error);
}
.field__error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.05rem;
  border-radius: 50%;
  background: var(--error);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
}
.field__error:empty { display: none; }

.combo { position: relative; }
.combo > select { display: none; }

.combo__btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  cursor: pointer;
}
.combo__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combo__btn:not(.is-filled) .combo__value { color: var(--muted); }

.combo__dot {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--c, transparent);
  box-shadow: inset 0 0 0 1.5px var(--c, var(--muted));
}
.combo__btn:not(.has-dot) .combo__dot { display: none; }

.combo__plus {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--ink);
  transition: transform 220ms var(--ease-out);
}
.combo__plus svg { width: 100%; height: 100%; fill: currentColor; }
.combo__btn[aria-expanded="true"] .combo__plus { transform: rotate(45deg); }
.combo__btn:active { transform: scale(0.99); }

.combo__list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(19rem, 60svh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 24px 48px -18px rgb(21 23 42 / 0.3);
  transform-origin: 50% 0;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 130ms ease, transform 130ms var(--ease-out), visibility 0s linear 130ms;
}
.combo.is-up .combo__list {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: 50% 100%;
  transform: translateY(6px) scale(0.97);
}
.combo.is-open .combo__list {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 160ms ease, transform 200ms var(--ease-out), visibility 0s;
}
.combo__list:focus { outline: none; }
.combo__list:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.combo__hl {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  height: 46px;
  border-radius: 10px;
  background: var(--field-bg);
  opacity: 0;
  pointer-events: none;
  transition: transform 170ms var(--ease-out), height 170ms var(--ease-out), opacity 120ms ease;
}
.combo__hl.is-on { opacity: 1; }
.combo__hl.is-instant { transition: none; }

.combo__opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 46px;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
}
.combo__opt .combo__dot { width: 0.65rem; height: 0.65rem; }
.combo__opt:not([data-color]) .combo__dot { --c: transparent; }
.combo__list:not(.has-dots) .combo__dot { display: none; }
.combo__label { flex: 1; min-width: 0; }

.combo__check {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--navy);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.combo__check path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  transition: stroke-dashoffset 260ms var(--ease-out) 60ms;
}
.combo__opt[aria-selected="true"] .combo__check path { stroke-dashoffset: 0; }

.seg__track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 14px;
  background: var(--field-bg);
}
.seg__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 10px;
  background: var(--navy);
  transition: transform 260ms var(--ease-out);
}
.seg:has(input[value="Telefono"]:checked) .seg__thumb { transform: translateX(100%); }

.seg__opt {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0 0.75rem;
  border-radius: 10px;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
}
.seg__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg__opt span { transition: color 200ms ease; }
.seg__opt:has(input:checked) span { color: #fff; }
.seg__opt:has(input:focus-visible) { outline: 2px solid var(--navy); outline-offset: 3px; }
.seg__opt:active span { display: inline-block; transform: scale(0.97); }

.ct-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}

.ct-send {
  position: relative;
  z-index: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 56px;
  padding: 0 1.75rem 0 1.35rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-size: 1.075rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 160ms var(--ease-out), color 350ms ease;
}
.ct-send__plus { display: grid; width: 18px; height: 18px; transition: transform 500ms var(--ease-out); }
.ct-send__plus svg { width: 100%; height: 100%; fill: var(--orange); transition: fill 350ms ease; }
.ct-send__txt { display: inline-block; }
.ct-send__fill {
  position: absolute;
  z-index: -1;
  left: -14%;
  bottom: -400%;
  width: 128%;
  height: 400%;
  border-radius: 50%;
  background: var(--orange);
  transition: transform 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}
.ct-send:active { transform: scale(0.97); }
.ct-send:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 999px; }
@media (hover: hover) and (pointer: fine) {
  .ct-send:hover { color: var(--ink); }
  .ct-send:hover .ct-send__fill { transform: translateY(-50%); }
  .ct-send:hover .ct-send__plus { transform: rotate(90deg); }
  .ct-send:hover .ct-send__plus svg { fill: var(--ink); }
}

.ct-note {
  flex: 1 1 16rem;
  max-width: 36ch;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.ct-done {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1rem;
  padding: clamp(2rem, 5vw, 4rem) 0.5rem;
  text-align: center;
}
.ct-done:focus { outline: none; }
.ct-done[hidden] { display: none; }
.ct-done__plus { width: clamp(4rem, 7vw, 5.5rem); height: clamp(4rem, 7vw, 5.5rem); color: var(--magenta); }
.ct-done__plus svg { width: 100%; height: 100%; fill: currentColor; }
.ct-done__title { margin-top: 0.5rem; font-size: clamp(2.6rem, 5vw, 4.25rem); line-height: 0.95; color: var(--ink); }
.ct-done__text { max-width: 36ch; font-size: 1.0625rem; line-height: 1.5; color: var(--ink-soft); }

.ct-done__link { text-decoration: underline; text-underline-offset: 0.15em; color: var(--navy); }

.ct-again {
  min-height: 48px;
  margin-top: 0.75rem;
  padding: 0 1.4rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 1rem;
  transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
}
.ct-again:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .ct-again:hover { background: var(--ink); color: #fff; }
}

.page-contatti .footer {
  position: relative;
  margin-top: calc(var(--radius) * -1);
  border-radius: var(--radius) var(--radius) 0 0;
}

.js .ct-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease 150ms, transform 900ms var(--ease-out) 150ms;
}
.js .ct-card.is-in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .ct-sheet { padding: 3.5rem var(--gutter) calc(3.5rem + var(--radius)); }
  .ct-sheet__in { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .ct-side__sticky { position: static; }
  .ct-side__title { font-size: clamp(3rem, 14vw, 5.5rem); }
  .ct-direct { margin-top: 2rem; }
}

@media (max-width: 640px) {
  .ct-open__sub { font-size: 1.05rem; }
  .ct-grid { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .ct-card { padding: 1.35rem 1.1rem 1.5rem; }
  .ct-foot { margin-top: 1.75rem; }
  .ct-send { width: 100%; justify-content: center; }
  .ct-note { max-width: none; }
  .seg__opt { font-size: 0.9375rem; padding: 0 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .js .ct-card { transform: none; transition: opacity 400ms ease; }
  .combo__list,
  .combo.is-up .combo__list { transform: none; }
  .combo__hl,
  .seg__thumb,
  .combo__plus,
  .ct-send__plus { transition: none; }
  .ct-send:active,
  .ct-copy:active,
  .ct-again:active,
  .combo__btn:active,
  .ct-direct__link:active { transform: none; }
}
