/* Pagina Contatti. */

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

html {
  min-width: 0;
  color-scheme: dark;
  background: #07121c;
}

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: #f4fbff;
  background: #07121c;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.contacts-page-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  background-color: #07121c;
  background-image: url("../assets/backgrounds/contact page desk.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.contacts-page-background::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 50% 42%, rgb(133 204 224 / 4%), transparent 42%),
    linear-gradient(180deg, rgb(2 9 16 / 11%), rgb(2 9 16 / 25%));
}

.contacts-home-link {
  position: fixed;
  z-index: 20;
  top: max(1.15rem, env(safe-area-inset-top));
  left: max(1.15rem, env(safe-area-inset-left));
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.35rem;
  padding: 0.48rem 0.82rem;
  border: 1px solid rgb(207 231 255 / 36%);
  border-radius: 0.42rem;
  color: rgb(247 252 255 / 94%);
  background: rgb(12 25 38 / 52%);
  box-shadow:
    0 0.45rem 1rem rgb(0 0 0 / 20%),
    inset 0 0 0 1px rgb(155 207 255 / 9%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.contacts-home-link:hover {
  border-color: rgb(220 241 255 / 54%);
  background: rgb(16 35 52 / 64%);
  box-shadow:
    0 0.55rem 1.2rem rgb(0 0 0 / 24%),
    0 0 0.9rem rgb(131 198 255 / 12%),
    inset 0 0 0 1px rgb(181 222 255 / 14%);
  transform: translateY(-1px);
}

.contacts-home-link:focus-visible {
  outline: 2px solid rgb(213 239 255 / 86%);
  outline-offset: 3px;
}

.contacts-page-shell {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(5.6rem, calc(env(safe-area-inset-top) + 4.5rem))
    clamp(1rem, 3vw, 2.25rem)
    max(2.2rem, env(safe-area-inset-bottom));
}

.contact-glass {
  position: relative;
  width: min(47rem, 100%);
  padding: clamp(1.45rem, 2.6vw, 2.15rem);
  overflow: hidden;
  border: 1px solid rgb(210 239 249 / 22%);
  border-radius: 0.9rem;
  background:
    linear-gradient(145deg, rgb(9 25 36 / 61%), rgb(15 24 39 / 48%));
  box-shadow:
    0 1.35rem 3.5rem rgb(0 4 12 / 34%),
    inset 0 1px 0 rgb(255 255 255 / 11%),
    inset 0 0 0 1px rgb(166 225 238 / 5%);
  backdrop-filter: blur(21px) saturate(118%);
  -webkit-backdrop-filter: blur(21px) saturate(118%);
}

.contact-glass::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(125deg, rgb(255 255 255 / 7%), transparent 19%),
    radial-gradient(circle at 78% 12%, rgb(151 119 255 / 7%), transparent 29%);
}

.contact-glass::after {
  position: absolute;
  inset: 0.55rem;
  border: 1px solid rgb(198 235 246 / 5%);
  border-radius: 0.62rem;
  pointer-events: none;
  content: "";
}

.contact-header,
.contact-form {
  position: relative;
  z-index: 1;
}

.contact-header {
  max-width: 39rem;
  margin-bottom: 1.55rem;
}

.contact-header h1 {
  margin: 0;
  color: rgb(249 253 255 / 97%);
  font-size: clamp(1.62rem, 3vw, 2.35rem);
  font-weight: 670;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-shadow: 0 0.28rem 1rem rgb(0 6 14 / 36%);
}

.contact-header p {
  max-width: 36rem;
  margin: 0.68rem 0 0;
  color: rgb(226 242 247 / 72%);
  font-size: clamp(0.88rem, 1.25vw, 1rem);
  line-height: 1.62;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.contact-field {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.contact-field--wide {
  grid-column: 1 / -1;
}

.contact-field-label {
  padding-left: 0.1rem;
  color: rgb(224 244 249 / 82%);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.035em;
}

.contact-control {
  width: 100%;
  min-width: 0;
  min-height: 3.05rem;
  padding: 0.76rem 0.88rem;
  border: 1px solid rgb(206 240 248 / 16%);
  border-radius: 0.58rem;
  outline: none;
  color: rgb(248 253 255 / 96%);
  background:
    linear-gradient(180deg, rgb(4 16 24 / 69%), rgb(9 18 29 / 61%));
  box-shadow:
    0 0.5rem 1.1rem rgb(0 3 10 / 16%),
    inset 0 1px 0 rgb(255 255 255 / 5%);
  caret-color: #a9ecf8;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.contact-control:hover {
  border-color: rgb(207 241 249 / 27%);
}

.contact-control:focus {
  border-color: rgb(159 227 242 / 48%);
  box-shadow:
    0 0.55rem 1.15rem rgb(0 3 10 / 18%),
    0 0 0 3px rgb(115 210 231 / 8%),
    0 0 1.2rem rgb(133 99 224 / 10%),
    inset 0 1px 0 rgb(255 255 255 / 7%);
}

.contact-message {
  min-height: 10.4rem;
  resize: vertical;
  line-height: 1.55;
}

.contact-select-wrap {
  position: relative;
  display: block;
}

.contact-select-wrap::after {
  position: absolute;
  top: 50%;
  right: 0.95rem;
  color: rgb(183 227 237 / 66%);
  font-size: 0.78rem;
  content: "⌄";
  pointer-events: none;
  transform: translateY(-56%);
}

.contact-select {
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.contact-select option {
  color: #edf9fc;
  background: #0b1822;
}

.contact-form-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem 1.5rem;
  margin-top: 1.15rem;
}

.contact-privacy {
  max-width: 31rem;
  margin: 0;
  color: rgb(210 230 237 / 57%);
  font-size: 0.7rem;
  line-height: 1.5;
}

.contact-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 2.85rem;
  padding: 0.68rem 1.05rem 0.68rem 1.15rem;
  border: 1px solid rgb(202 239 248 / 28%);
  border-radius: 0.58rem;
  color: rgb(249 253 255 / 95%);
  background:
    linear-gradient(
      135deg,
      rgb(25 74 88 / 73%),
      rgb(66 50 105 / 69%)
    );
  box-shadow:
    0 0.55rem 1.25rem rgb(0 4 12 / 22%),
    inset 0 1px 0 rgb(255 255 255 / 11%);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    filter 150ms ease;
}

.contact-submit:hover {
  border-color: rgb(217 244 250 / 44%);
  box-shadow:
    0 0.7rem 1.45rem rgb(0 4 12 / 26%),
    0 0 1.15rem rgb(135 101 225 / 12%),
    inset 0 1px 0 rgb(255 255 255 / 14%);
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.contact-submit:active {
  transform: translateY(0);
}

.contact-submit:focus-visible {
  outline: 2px solid rgb(171 235 247 / 82%);
  outline-offset: 3px;
}

.contact-submit-arrow {
  color: #bceef7;
  font-size: 1rem;
  line-height: 1;
}

.contact-status {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  overflow: hidden;
  border: 1px solid rgb(202 239 248 / 18%);
  border-radius: 0.6rem;
  background: rgb(5 18 27 / 73%);
  box-shadow:
    0 0.7rem 1.4rem rgb(0 3 10 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 6%);
}

.contact-status[hidden] {
  display: none;
}

.contact-status::before,
.contact-status::after {
  position: absolute;
  width: 1.2rem;
  height: 1.2rem;
  pointer-events: none;
  content: "";
}

.contact-status::before {
  top: 0.3rem;
  left: 0.3rem;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
  opacity: 0.34;
}

.contact-status::after {
  right: 0.3rem;
  bottom: 0.3rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.24;
}

.contact-status--success {
  color: rgb(176 236 223 / 88%);
}

.contact-status--error {
  color: rgb(245 199 186 / 88%);
}

.contact-status-mark {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-top: 0.05rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 800;
}

.contact-status strong {
  display: block;
  color: rgb(248 253 255 / 94%);
  font-size: 0.82rem;
}

.contact-status p {
  margin: 0.22rem 0 0;
  color: rgb(216 235 240 / 67%);
  font-size: 0.74rem;
  line-height: 1.45;
}

@media (max-width: 48rem) {
  .contacts-page-background {
    background-image: url("../assets/backgrounds/contact page mobile.png");
  }

  .contacts-home-link {
    top: max(0.85rem, env(safe-area-inset-top));
    left: max(0.85rem, env(safe-area-inset-left));
  }

  .contacts-page-shell {
    place-items: start center;
    min-height: 100dvh;
    padding:
      max(4.85rem, calc(env(safe-area-inset-top) + 4.1rem))
      0.78rem
      max(1.35rem, env(safe-area-inset-bottom));
  }

  .contact-glass {
    width: 100%;
    padding: 1.1rem;
    border-radius: 0.76rem;
    backdrop-filter: blur(17px) saturate(114%);
    -webkit-backdrop-filter: blur(17px) saturate(114%);
  }

  .contact-header {
    margin-bottom: 1.15rem;
  }

  .contact-header h1 {
    font-size: clamp(1.45rem, 7vw, 1.82rem);
  }

  .contact-header p {
    margin-top: 0.52rem;
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .contact-form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.82rem;
  }

  .contact-field--wide {
    grid-column: auto;
  }

  .contact-control {
    min-height: 2.95rem;
  }

  .contact-message {
    min-height: 9.2rem;
  }

  .contact-form-footer {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.9rem;
    margin-top: 1rem;
  }

  .contact-submit {
    width: 100%;
  }

  .contact-privacy {
    font-size: 0.68rem;
  }
}

.contacts-page-shell {
  position: relative;
  padding-bottom: max(3.5rem, calc(env(safe-area-inset-bottom) + 3rem));
}

@media (prefers-reduced-motion: reduce) {
  .contacts-home-link,
  .contact-control,
  .contact-submit {
    transition: none;
  }
}
