/* ============================================================
   Artwork Contact Form — modal.css v1.3
   ============================================================ */

/* Sicurezza: alcuni temi WordPress resettano [hidden] */
#acf-modal-overlay[hidden] { display: none !important; }

.acf-modal-overlay {
  /* Default: completamente fuori dal layout */
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0,0,0,.55);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity .28s cubic-bezier(.4,0,.2,1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Aperto: aggiunto da JS */
.acf-modal-overlay.is-open {
  display: flex;
  opacity: 1;
}

/* Chiusura con fade: JS aggiunge is-closing, poi rimuove is-open */
.acf-modal-overlay.is-closing {
  display: flex;
  opacity: 0;
  pointer-events: none;
}

/* ---- Inner ---- */
.acf-modal-inner {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
  padding: 48px 52px 56px;
  box-sizing: border-box;
  background: #0d0d0d;
  animation: acf-modal-in .32s cubic-bezier(.4,0,.2,1) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
  /* Isola il form dal layout del tema */
  contain: layout style;
}

.acf-modal-inner.acf-theme-light { background: #fafafa; }

@keyframes acf-modal-in {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Close button ---- */
.acf-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 18px; line-height: 1;
  background: rgba(255,255,255,.08);
  border: none; cursor: pointer;
  color: rgba(255,255,255,.55);
  transition: background .15s, color .15s;
  font-family: sans-serif;
  padding: 0;
  z-index: 1;
}
.acf-modal-close:hover { background: rgba(255,255,255,.14); color: rgba(255,255,255,.9); }
.acf-modal-inner.acf-theme-light .acf-modal-close { background: rgba(0,0,0,.06); color: rgba(0,0,0,.35); }
.acf-modal-inner.acf-theme-light .acf-modal-close:hover { background: rgba(0,0,0,.1); color: rgba(0,0,0,.8); }

/* ---- Trigger button (shortcode/WPBakery) ---- */
.acf-modal-btn {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
  padding: 12px 26px;
  border-radius: 50px;
  border: 1.5px solid #2A2A2A;
  cursor: pointer; background: #2A2A2A; color: #fff;
  transition: background .15s, box-shadow .15s, transform .15s;
  display: inline-block;
  -webkit-tap-highlight-color: transparent;
}
.acf-modal-btn:hover { background: #333; box-shadow: 0 2px 14px rgba(0,0,0,.2); }
.acf-modal-btn:active { transform: scale(.97); }

/* ---- Body lock ---- */
body.acf-modal-open { overflow: hidden; }

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .acf-modal-inner {
    padding: 36px 24px 44px;
    max-height: 95vh;
    border-radius: 18px 18px 0 0;
  }
  .acf-modal-overlay.is-open {
    align-items: flex-end;
    padding: 0;
  }
}
