/**
 * FlatCMS - Flat-File Content Management System
 * Copyright (C) 2026 Alain BROYE
 * SPDX-License-Identifier: AGPL-3.0-or-later
 *
 * ALTO callback panel. Presentation only: all form fields, submission,
 * validation, notification and consent are native Contact shortcode output.
 */

body.alto-callback-open {
  overflow: hidden;
  overscroll-behavior: none;
}

/*
 * The callback embeds the native Contact form, including its two anti-spam
 * honeypot inputs (company and website). On the homepage the Contact
 * component stylesheet is intentionally not loaded: keep the honeypot
 * invisible in the ALTO callback bundle as well. Do not remove inputs.
 */
.alto-callback-native .flatcms-contact-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.alto-callback-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  isolation: isolate;
}

.alto-callback-layer[hidden] {
  display: none !important;
}

.alto-callback-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: rgba(20, 27, 42, .52);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  transition: opacity .76s ease;
}

.alto-callback-panel {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(580px, 100%);
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #fcfafb;
  box-shadow: -22px 0 70px rgba(17, 24, 39, .18);
  transform: translate3d(103%, 0, 0);
  transition: transform .78s cubic-bezier(.22, .78, .22, 1);
  will-change: transform;
}

.alto-callback-layer.is-open .alto-callback-backdrop {
  opacity: 1;
}

.alto-callback-layer.is-open .alto-callback-panel {
  transform: translate3d(0, 0, 0);
}

.alto-callback-intro {
  position: relative;
  z-index: 0;
  flex: none;
  min-height: 255px;
  padding: 78px 44px 34px;
  overflow: hidden;
  background: linear-gradient(145deg, #751443 0%, #9f1f63 62%, #a72a70 100%);
  color: #fff;
}

.alto-callback-intro::before {
  position: absolute;
  top: -125px;
  right: -125px;
  z-index: -1;
  width: 350px;
  height: 350px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  content: '';
  pointer-events: none;
}

.alto-callback-intro::after {
  position: absolute;
  right: -38px;
  bottom: -110px;
  z-index: -1;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  content: '';
  pointer-events: none;
}

.alto-callback-close {
  position: absolute;
  top: 22px;
  right: 24px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 50%;
  padding: 0;
  background: rgba(255,255,255,.10);
  color: #fff;
  cursor: pointer;
  transition: background .18s ease;
}

.alto-callback-close:hover { background: rgba(255,255,255,.23); }

.alto-callback-close-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 29px/1 Arial, sans-serif;
}

.alto-callback-close svg {
  width: 21px;
  height: 21px;
}

.alto-callback-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  color: #fff;
  font-size: .73rem;
  font-weight: 750;
  letter-spacing: .18em;
}

.alto-callback-eyebrow-line {
  display: block;
  width: 36px;
  height: 1px;
  background: rgba(255,255,255,.55);
}

.alto-callback-title {
  max-width: 425px;
  margin: 0;
  color: #fff;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.1rem, 3vw, 2.8rem);
  font-weight: 400;
  line-height: 1.11;
  letter-spacing: -.045em;
}

.alto-callback-description {
  max-width: 405px;
  margin: 18px 0 0;
  color: rgba(255,255,255,.86);
  font-size: 1rem;
  line-height: 1.55;
}

.alto-callback-content {
  flex: 1;
  min-height: 0;
  padding: 32px 44px 48px;
  background: #fcfafb;
}

.alto-callback-native .flatcms-contact-native {
  max-width: none;
  margin: 0;
  padding: 0;
}

.alto-callback-native .flatcms-contact-native-form {
  display: grid;
  gap: 17px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.alto-callback-native .flatcms-contact-custom-grid {
  display: grid;
  /* The Rappel callback has phone + message: both use the full width. */
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.alto-callback-native .flatcms-contact-custom-field .form-group,
.alto-callback-native .flatcms-contact-form .form-group {
  display: flex;
  flex-direction: column;
  align-content: initial;
  gap: 7px;
  min-width: 0;
  margin: 0;
}

.alto-callback-native .flatcms-contact-custom-field .form-label,
.alto-callback-native .flatcms-contact-form label.form-label {
  display: block;
  min-height: 0;
  margin: 0;
  color: #263049;
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.45;
}

.alto-callback-native .flatcms-contact-required-mark {
  color: #a21d63;
}

.alto-callback-native .flatcms-contact-native-form .form-input,
.alto-callback-native .flatcms-contact-native-form input[type="tel"],
.alto-callback-native .flatcms-contact-native-form textarea,
.alto-callback-native .flatcms-contact-native-form select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid #ded6dd;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: #222a3a;
  box-shadow: 0 2px 8px rgba(25,27,36,.035);
  font: 400 16px/1.5 system-ui, sans-serif;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.alto-callback-native .flatcms-contact-native-form textarea {
  min-height: 92px;
  max-height: 250px;
  resize: vertical;
}

.alto-callback-native .flatcms-contact-native-form .form-input::placeholder {
  color: #9298a5;
  opacity: 1;
}

.alto-callback-native .flatcms-contact-native-form .form-input:focus,
.alto-callback-native .flatcms-contact-native-form textarea:focus {
  border-color: #a32a66;
  box-shadow: 0 0 0 4px rgba(159,31,99,.10);
}

.alto-callback-native .flatcms-contact-native-form > button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  min-height: var(--fc-btn-height, 42px);
  margin: 1px 0 0;
  padding: 0 20px;
  border: 1px solid #9f1f63;
  border-radius: var(--fc-btn-radius, 0.5rem);
  background: #9f1f63;
  color: #fff;
  box-shadow: 0 7px 20px rgba(159,31,99,.15);
  font: 650 .96rem/1.4 system-ui, sans-serif;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease;
}

.alto-callback-native .flatcms-contact-native-form > button[type="submit"]:hover {
  background: #801547;
  border-color: #801547;
}

.alto-callback-native .flatcms-contact-native-form .flatcms-contact-choice-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  color: #546070;
  font-size: .85rem;
  line-height: 1.5;
}

.alto-callback-native .flatcms-contact-choice-item input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #9f1f63;
}

.alto-callback-native .flatcms-contact-hint,
.alto-callback-native .flatcms-contact-consent-links {
  margin: 0;
  color: #697385;
  font-size: .78rem;
  line-height: 1.65;
}

.alto-callback-native .flatcms-contact-consent-links a {
  color: #892052;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.alto-callback-native .alert-success {
  margin: 0 0 20px;
  padding: 15px;
  border: 1px solid #b7dec5;
  border-radius: 8px;
  background: #eef9f1;
  color: #25623d;
}

.alto-callback-unavailable {
  margin: 0;
  color: #536174;
  line-height: 1.6;
}

.alto-callback-unavailable a { color: #9f1f63; }

.alto-callback-close:focus-visible,
.alto-callback-native a:focus-visible,
.alto-callback-native button:focus-visible {
  outline: 3px solid #f4b5d8;
  outline-offset: 3px;
}

@media (max-width: 639px) {
  .alto-callback-panel { width: 100%; }
  .alto-callback-intro {
    min-height: 0;
    padding: 80px 27px 30px;
  }
  .alto-callback-title { font-size: clamp(2rem, 9vw, 2.5rem); }
  .alto-callback-description {
    margin-top: 12px;
    font-size: .94rem;
  }
  .alto-callback-close { top: 18px; right: 20px; }
  .alto-callback-content { padding: 27px 25px 40px; }
  .alto-callback-native .flatcms-contact-custom-grid {
    grid-template-columns: minmax(0,1fr);
    gap: 15px;
  }
  .alto-callback-native .flatcms-contact-custom-field--half {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alto-callback-backdrop,
  .alto-callback-panel,
  .alto-callback-close,
  .alto-callback-native .form-input {
    transition: none;
  }
}
