/* ==========================================================================
   EU AI Act Quick Risk Assessment — MODAL / POPUP Version
   Muteki Group Theme
   Trigger via:  data-aia-modal  attribute on any element, or
                 [ai_act_modal_btn] shortcode
   ========================================================================== */

/* ── Modal Overlay ── */
.aiam-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  /* hidden state */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

.aiam-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Dark blurred backdrop */
.aiam-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 16, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Modal Shell ── */
.aiam-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18, 18, 48, 0.97) 0%, rgba(10, 10, 32, 0.99) 100%);
  border: 1px solid rgba(91, 79, 232, 0.28);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 60px rgba(91, 79, 232, 0.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 79, 232, 0.4) transparent;
  /* entrance animation */
  transform: translateY(24px) scale(0.97);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.aiam-overlay.is-open .aiam-shell {
  transform: translateY(0) scale(1);
}

.aiam-shell::-webkit-scrollbar {
  width: 5px;
}
.aiam-shell::-webkit-scrollbar-track {
  background: transparent;
}
.aiam-shell::-webkit-scrollbar-thumb {
  background: rgba(91, 79, 232, 0.4);
  border-radius: 10px;
}

/* Decorative glow blobs inside the shell */
.aiam-shell::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(91, 79, 232, 0.14) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.aiam-shell::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* ── Close Button ── */
.aiam-close {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 16px 18px 0;
  margin-bottom: -8px;
}

.aiam-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s ease;
  flex-shrink: 0;
}
.aiam-close-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #FCA5A5;
  transform: rotate(90deg);
}
.aiam-close-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  fill: none;
}

/* ── Inner container — reuses page CSS variables ── */
.aiam-inner {
  padding: 8px 32px 40px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #F1F5F9;
}

@media (max-width: 600px) {
  .aiam-inner {
    padding: 8px 18px 32px;
  }
}

/* ── Modal-scoped hero head ── */
.aiam-inner .aia-title {
  font-size: clamp(22px, 3.5vw, 32px);
}

.aiam-inner .aia-subtitle {
  font-size: 14px;
}

.aiam-inner .aia-hero-head {
  margin-bottom: 24px;
}

/* ── Tighten the card inside the modal ── */
.aiam-inner .aia-card {
  padding: 28px;
  border-radius: 16px;
}

/* ── Make sure CSS vars are available in modal scope ── */
.aiam-overlay {
  --aia-indigo: #5B4FE8;
  --aia-indigo-light: #7B72EE;
  --aia-violet: #8B5CF6;
  --aia-violet-glow: rgba(139, 92, 246, 0.25);
  --aia-text: #F1F5F9;
  --aia-text-muted: #94A3B8;
  --aia-green: #10B981;
  --aia-green-glow: rgba(16, 185, 129, 0.25);
  --aia-yellow: #F59E0B;
  --aia-yellow-glow: rgba(245, 158, 11, 0.25);
  --aia-red: #EF4444;
  --aia-red-glow: rgba(239, 68, 68, 0.25);
  --aia-stop: #DC2626;
  --aia-radius: 20px;
  --aia-transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Trigger Button Shortcode Styles ── */
.aia-modal-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: linear-gradient(135deg, #5B4FE8 0%, #8B5CF6 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'DM Sans', -apple-system, sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(91, 79, 232, 0.35);
  white-space: nowrap;
}
.aia-modal-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(91, 79, 232, 0.5);
  filter: brightness(1.08);
  color: #FFFFFF;
  text-decoration: none;
}
.aia-modal-trigger-btn svg {
  flex-shrink: 0;
}

/* Prevent body scroll when modal is open */
body.aiam-no-scroll {
  overflow: hidden;
}
