﻿/**
 * BridgeWorks — Popup informativi (grafica allineata al sito)
 */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap");

.bw-popup-root {
  --bw-popup-verde: #2a5c47;
  --bw-popup-verde-m: #3d7260;
  --bw-popup-verde-l: #6aab8a;
  --bw-popup-verde-dark: #1e4536;
  --bw-popup-terracotta: #b87262;
  --bw-popup-cream: #f8fafc;
  --bw-popup-carta: #eef0f3;
  --bw-popup-ink: #292524;
  --bw-popup-ink-soft: #57534e;
  --bw-popup-line: rgba(42, 92, 71, 0.14);
  --bw-popup-line-soft: rgba(120, 113, 108, 0.16);
  --bw-font-display: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  font-family: "DM Sans", system-ui, sans-serif;
}

.bw-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10045;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 20% 15%, rgba(106, 171, 138, 0.18), transparent 42%),
    radial-gradient(circle at 80% 85%, rgba(184, 114, 98, 0.14), transparent 38%),
    rgba(26, 26, 24, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: bw-popup-fade-in 0.32s ease;
}

.bw-popup-overlay[hidden] {
  display: none !important;
}

.bw-popup-dialog {
  position: relative;
  width: min(100%, 500px);
  max-height: min(88vh, 640px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--bw-popup-line-soft);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 28px 70px rgba(26, 26, 24, 0.28),
    0 8px 24px rgba(42, 92, 71, 0.08);
  animation: bw-popup-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.bw-popup-hero {
  position: relative;
  padding: 1.65rem 1.5rem 1.35rem;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.22), transparent 36%),
    radial-gradient(circle at 8% 92%, rgba(184, 114, 98, 0.18), transparent 42%),
    linear-gradient(145deg, var(--bw-popup-verde-dark) 0%, var(--bw-popup-verde) 42%, var(--bw-popup-verde-m) 100%);
  color: #fff;
  overflow: hidden;
}

.bw-popup-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 88%);
  pointer-events: none;
}

.bw-popup-hero::after {
  content: "";
  position: absolute;
  right: -2.5rem;
  bottom: -3rem;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106, 171, 138, 0.35) 0%, transparent 68%);
  pointer-events: none;
}

.bw-popup-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.7rem 0.35rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

.bw-popup-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.bw-popup-brand-icon svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.bw-popup-brand-text {
  font-family: var(--bw-font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f3f4f6;
}

.bw-popup-brand-text span {
  color: #f0c4b8;
}

.bw-popup-title {
  position: relative;
  z-index: 1;
  margin: 0;
  padding-right: 2rem;
  font-family: var(--bw-font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.72rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: #fff;
  text-wrap: balance;
}

.bw-popup-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.bw-popup-close svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.bw-popup-close:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.34);
  transform: scale(1.04);
}

.bw-popup-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.bw-popup-content {
  overflow: auto;
  background: linear-gradient(180deg, var(--bw-popup-cream) 0%, #fff 100%);
}

.bw-popup-body {
  padding: 1.25rem 1.5rem 0.35rem;
  color: var(--bw-popup-ink-soft);
  font-size: 1rem;
  line-height: 1.68;
  white-space: pre-line;
}

.bw-popup-body:empty {
  display: none;
}

.bw-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 1rem 1.5rem 1.35rem;
}

.bw-popup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0.72rem 1.25rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.bw-popup-btn svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  transition: transform 0.18s ease;
}

.bw-popup-btn--primary {
  background: linear-gradient(135deg, var(--bw-popup-verde) 0%, var(--bw-popup-verde-m) 100%);
  color: #f8fafc;
  box-shadow: 0 10px 24px rgba(42, 92, 71, 0.24);
}

.bw-popup-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(42, 92, 71, 0.28);
}

.bw-popup-btn--primary:hover svg {
  transform: translateX(2px);
}

.bw-popup-btn--primary:focus-visible {
  outline: 2px solid rgba(61, 114, 96, 0.35);
  outline-offset: 2px;
}

.bw-popup-btn--ghost {
  background: #fff;
  color: var(--bw-popup-verde-m);
  border-color: rgba(42, 92, 71, 0.22);
  box-shadow: 0 2px 8px rgba(26, 26, 24, 0.04);
}

.bw-popup-btn--ghost:hover {
  background: rgba(106, 171, 138, 0.1);
  border-color: rgba(42, 92, 71, 0.32);
}

.bw-popup-btn--ghost:focus-visible {
  outline: 2px solid rgba(61, 114, 96, 0.28);
  outline-offset: 2px;
}

@keyframes bw-popup-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bw-popup-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.bw-popup-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .bw-popup-overlay {
    padding: 0.85rem;
  }

  .bw-popup-dialog {
    border-radius: 20px;
  }

  .bw-popup-hero {
    padding: 1.35rem 1.15rem 1.1rem;
  }

  .bw-popup-body {
    padding: 1.1rem 1.15rem 0.25rem;
    font-size: 0.96rem;
  }

  .bw-popup-actions {
    flex-direction: column;
    padding: 0.85rem 1.15rem 1.15rem;
  }

  .bw-popup-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bw-popup-overlay,
  .bw-popup-dialog,
  .bw-popup-btn,
  .bw-popup-btn svg,
  .bw-popup-close {
    animation: none !important;
    transition: none !important;
  }
}
