:root {
  --flp-bg-start: #0742b8;
  --flp-bg-end: #0a5dfe;
  --flp-bg-deep: #052f8f;
  --flp-overlay: rgba(3, 7, 18, 0.58);
  --flp-title: #f8fafc;
  --flp-text: #e2e8f0;
  --flp-text-soft: rgba(226, 232, 240, 0.86);
  --flp-accent: #0a5dfe;
  --flp-accent-hover: #084cd2;
  --flp-ring: rgba(10, 93, 254, 0.28);
  --flp-border-outer-a: rgba(191, 219, 254, 0.3);
  --flp-border-outer-b: rgba(96, 165, 250, 0.14);
  --flp-proof-bg: rgba(255, 255, 255, 0.12);
  --flp-proof-border: rgba(255, 255, 255, 0.28);
  --flp-border: rgba(255, 255, 255, 0.2);
}

.flp-lock-scroll {
  overflow: hidden;
}

.flp-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  background: radial-gradient(circle at 14% 15%, rgba(10, 93, 254, 0.26), transparent 42%),
    radial-gradient(circle at 88% 88%, rgba(40, 114, 255, 0.2), transparent 42%), var(--flp-overlay);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  direction: ltr;
}

.flp-modal {
  width: 750px;
  height: 550px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  border-radius: 22px;
  border: 1px solid transparent;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 24% 24%, rgba(10, 93, 254, 0.18), rgba(10, 93, 254, 0) 44%),
    radial-gradient(circle at 70% 75%, rgba(147, 197, 253, 0.08), rgba(147, 197, 253, 0) 55%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.64) 0%, rgba(15, 23, 42, 0.56) 46%, rgba(30, 41, 59, 0.60) 100%) padding-box,
    linear-gradient(135deg, var(--flp-border-outer-a), var(--flp-border-outer-b)) border-box;
  background-clip: border-box, border-box, padding-box, border-box;
  box-shadow:
    0 28px 60px rgba(2, 6, 23, 0.55),
    0 0 0 1px rgba(37, 99, 235, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: contain;
  padding: 24px 32px 22px;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 280ms ease, opacity 280ms ease;
}

.flp-modal > * {
  position: relative;
  z-index: 2;
}

.flp-modal::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 132px;
  z-index: 1;
  background:
    radial-gradient(circle at 24% 8%, rgba(147, 197, 253, 0.18), transparent 48%),
    linear-gradient(125deg, var(--flp-bg-deep) 0%, var(--flp-bg-start) 42%, var(--flp-bg-end) 100%);
  clip-path: ellipse(82% 72% at 50% 0%);
  opacity: 0.88;
  pointer-events: none;
}

.flp-modal::after {
  content: "";
  position: absolute;
  top: -86px;
  right: -70px;
  width: 238px;
  height: 238px;
  border-radius: 999px;
  z-index: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.flp-modal-ready {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.flp-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(191, 219, 254, 0.32);
  border-radius: 999px;
  background: rgba(147, 197, 253, 0.18);
  color: #f8fafc;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.flp-close::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(191, 219, 254, 0.24), rgba(191, 219, 254, 0) 70%);
}

.flp-close:hover {
  background: rgba(147, 197, 253, 0.28);
  transform: translateY(-1px);
}

.flp-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.flp-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #bfdbfe;
  box-shadow: 0 0 0 5px rgba(191, 219, 254, 0.22);
}

.flp-title {
  position: relative;
  margin: 0 0 6px;
  color: var(--flp-title);
  font-size: clamp(1.56rem, 2.8vw, 2.2rem);
  font-weight: 860;
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-align: left;
  text-shadow: 0 1px 18px rgba(2, 6, 23, 0.35);
}

.flp-subtitle {
  position: relative;
  margin: 0;
  color: var(--flp-text);
  font-size: 1.01rem;
  line-height: 1.56;
  text-align: left;
}

.flp-program-label {
  margin: 2px 0 8px;
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.45);
  background: rgba(10, 93, 254, 0.24);
  color: #dbeafe;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.flp-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}

.flp-proof-item {
  border: 1px solid var(--flp-proof-border);
  background: var(--flp-proof-bg);
  color: #e5e7eb;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 999px;
  padding: 6px 10px;
}

.flp-features {
  margin: 10px 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.flp-feature {
  position: relative;
  border: 1px solid var(--flp-border);
  border-radius: 12px;
  padding: 9px 12px 9px 36px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 20% 50%, rgba(147, 197, 253, 0.06), rgba(147, 197, 253, 0) 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.07) 100%);
  font-size: 0.96rem;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.flp-feature::before {
  content: "✓";
  position: absolute;
  left: 12px;
  top: 50%;
  translate: 0 -50%;
  color: #86efac;
  font-weight: 800;
}

.flp-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.flp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, filter 180ms ease;
}

.flp-btn:focus-visible {
  outline: 3px solid var(--flp-ring);
  outline-offset: 2px;
}

.flp-btn-primary {
  color: #fff;
  background: linear-gradient(132deg, #0738b0 0%, #0a52e7 44%, var(--flp-accent) 100%);
  box-shadow: 0 12px 24px rgba(10, 93, 254, 0.34);
  letter-spacing: 0.01em;
}

.flp-btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(132deg, #062f97 0%, #0848cc 44%, var(--flp-accent-hover) 100%);
  filter: saturate(1.08);
}

.flp-btn-ghost {
  color: #ffffff;
  border: 1px solid rgba(191, 219, 254, 0.45);
  background: rgba(255, 255, 255, 0.12);
}

.flp-btn-ghost:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
}

.flp-disclaimer {
  margin: 8px 0 0;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.81rem;
  line-height: 1.48;
}

.flp-microcopy {
  margin: 10px 0 0;
  color: var(--flp-text-soft);
  font-size: 0.84rem;
  line-height: 1.44;
  font-weight: 600;
}

@media (min-width: 641px) and (max-width: 1024px) {
  .flp-modal {
    width: 750px;
    height: 550px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 22px 24px 20px;
    border-radius: 20px;
  }

  .flp-title {
    font-size: clamp(1.5rem, 3.1vw, 2.05rem);
  }

  .flp-subtitle {
    font-size: 0.98rem;
    line-height: 1.54;
  }

  .flp-proof-item {
    font-size: 0.75rem;
  }
}

@media (max-width: 640px) {
  .flp-modal {
    width: calc(100vw - 20px);
    height: auto;
    min-height: auto;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 18px 18px 12px 12px;
    padding: 22px 16px 18px;
  }

  .flp-modal::before {
    height: 84px;
  }

  .flp-modal::after {
    width: 150px;
    height: 150px;
    top: -36px;
    right: -30px;
  }

  .flp-title {
    font-size: 1.95rem;
    font-size: clamp(1.44rem, 6vw, 1.9rem);
  }

  .flp-subtitle {
    font-size: 0.96rem;
    line-height: 1.54;
  }

  .flp-actions {
    flex-direction: column;
  }

  .flp-btn {
    width: 100%;
  }

  .flp-proof {
    margin: 14px 0 10px;
  }

  .flp-proof-item {
    font-size: 0.74rem;
  }

  .flp-disclaimer,
  .flp-microcopy {
    font-size: 0.82rem;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .flp-overlay {
    place-items: start center;
  }

  .flp-modal {
    margin-top: 8px;
    width: min(750px, calc(100vw - 20px));
    height: auto;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
    padding: 18px 14px 14px;
  }

  .flp-badge {
    margin-bottom: 10px;
  }

  .flp-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  .flp-subtitle {
    font-size: 0.93rem;
    line-height: 1.5;
  }

  .flp-features {
    margin: 14px 0 16px;
    gap: 8px;
  }

  .flp-feature {
    padding: 8px 10px 8px 30px;
    font-size: 0.89rem;
  }

  .flp-proof {
    margin: 10px 0 8px;
  }

  .flp-proof-item {
    font-size: 0.7rem;
    padding: 5px 8px;
  }

  .flp-btn {
    min-height: 42px;
  }
}

@media (pointer: coarse) {
  .flp-close {
    width: 40px;
    height: 40px;
  }

  .flp-btn {
    min-height: 48px;
  }
}
