/* =============================================
   IMPROVED AGENCY — Newsletter Modal
   Dark Glassmorphism · Gold + Emerald accents
   Mobile-first
   ============================================= */

:root {
  --nl-y: #e9cc38;
  --nl-g: #007a5a;
  --nl-g2: #00a37a;
  --nl-bg: rgba(10, 14, 20, 0.97);
  --nl-glass: rgba(255, 255, 255, 0.04);
  --nl-border: rgba(255, 255, 255, 0.08);
  --nl-text: #f0f0ef;
  --nl-muted: rgba(240, 240, 239, 0.55);
  --nl-rad: 20px;
  --nl-shadow: 0 32px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255,255,255,.06);
}

/* Body lock */
.nl-body-lock {
  overflow: hidden;
}

/* ── Overlay ─────────────────────────────── */
#improved-newsletter-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}

#improved-newsletter-modal.nl-modal-open {
  pointer-events: auto;
  opacity: 1;
}

@media (min-width: 600px) {
  #improved-newsletter-modal {
    align-items: center;
  }
}

/* ── Backdrop ─────────────────────────────── */
.nl-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .35s ease;
}
.nl-modal-open .nl-backdrop {
  opacity: 1;
}

/* ── Sheet ─────────────────────────────────── */
.nl-sheet {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;

  background: var(--nl-bg);
  background-image:
    radial-gradient(ellipse at top left, rgba(0, 122, 90, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(233, 204, 56, 0.10) 0%, transparent 55%);
  border: 1px solid var(--nl-border);
  border-radius: var(--nl-rad) var(--nl-rad) 0 0;
  box-shadow: var(--nl-shadow);
  padding: 40px 28px 36px;
  color: var(--nl-text);
  transform: translateY(32px);
  transition: transform .38s cubic-bezier(.22, 1, .36, 1);

  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.nl-modal-open .nl-sheet {
  transform: translateY(0);
}

@media (min-width: 600px) {
  .nl-sheet {
    border-radius: var(--nl-rad);
    padding: 48px 44px 44px;
    transform: translateY(40px) scale(.97);
  }
  .nl-modal-open .nl-sheet {
    transform: translateY(0) scale(1);
  }
}

/* ── Close btn ─────────────────────────────── */
.nl-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--nl-border);
  border-radius: 50%;
  background: var(--nl-glass);
  color: var(--nl-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.nl-close:hover {
  background: rgba(255,255,255,.08);
  color: var(--nl-text);
  transform: rotate(90deg);
}

/* ── Step transitions ─────────────────────── */
.nl-step {
  animation: none;
}
.nl-step-enter {
  animation: nlFadeUp .35s ease forwards;
}

@keyframes nlFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Eyebrow ──────────────────────────────── */
.nl-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--nl-g2);
  margin-bottom: 14px;
}

/* ── Title ─────────────────────────────────── */
.nl-title {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 10px;
  color: var(--nl-text);
}
.nl-title em {
  font-style: normal;
  color: var(--nl-y);
}

/* ── Sub ─────────────────────────────────── */
.nl-sub {
  font-size: .93rem;
  line-height: 1.6;
  color: var(--nl-muted);
  margin: 0 0 22px;
}

/* ── Trust badges ─────────────────────────── */
.nl-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.nl-trust span {
  font-size: .75rem;
  font-weight: 600;
  color: var(--nl-muted);
  background: var(--nl-glass);
  border: 1px solid var(--nl-border);
  border-radius: 40px;
  padding: 4px 11px;
}

/* ── Form ──────────────────────────────────── */
.nl-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nl-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: rgba(255,255,255,.7);
}

.nl-field input {
  background: rgba(255,255,255,.05);
  border: 1.5px solid var(--nl-border);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: .97rem;
  color: var(--nl-text);
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
  font-family: inherit;
}
.nl-field input::placeholder { color: rgba(255,255,255,.28); }
.nl-field input:focus {
  border-color: var(--nl-g);
  background: rgba(0, 122, 90, 0.07);
  box-shadow: 0 0 0 3px rgba(0, 122, 90, 0.18);
}

.nl-opt {
  font-weight: 400;
  font-size: .78rem;
  opacity: .55;
}

.nl-field-err {
  font-size: .8rem;
  font-weight: 500;
  color: #ff6b6b;
  min-height: 1em;
}

/* ── Interests chips ─────────────────────── */
.nl-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.nl-interest-chip {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.nl-interest-chip input { display: none; }
.nl-interest-chip span {
  font-size: .82rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 40px;
  border: 1.5px solid var(--nl-border);
  background: var(--nl-glass);
  color: var(--nl-muted);
  transition: all .18s ease;
}
.nl-interest-chip:hover span {
  border-color: rgba(0, 122, 90, .5);
  color: var(--nl-text);
}
.nl-interest-chip input:checked + span {
  background: rgba(0, 122, 90, 0.2);
  border-color: var(--nl-g);
  color: var(--nl-g2);
}

/* ── Buttons ──────────────────────────────── */
.nl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: .97rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 15px 24px;
  cursor: pointer;
  transition: all .22s ease;
  position: relative;
  overflow: hidden;
}
.nl-btn-primary {
  background: linear-gradient(135deg, var(--nl-g), #005c44);
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 122, 90, 0.35);
}
.nl-btn-primary:hover {
  background: linear-gradient(135deg, #00a37a, var(--nl-g));
  box-shadow: 0 8px 30px rgba(0, 122, 90, 0.5);
  transform: translateY(-1px);
}
.nl-btn-primary:active { transform: translateY(0); }
.nl-btn-ghost {
  background: transparent;
  border: 1.5px solid var(--nl-border);
  color: var(--nl-muted);
  font-size: .88rem;
}
.nl-btn-ghost:hover { border-color: rgba(255,255,255,.2); color: var(--nl-text); }

/* Loading state */
.nl-btn.nl-loading .nl-btn-label { opacity: 0; }
.nl-btn.nl-loading .nl-btn-loader { opacity: 1; }
.nl-btn-loader {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: nlSpin .7s linear infinite;
}
@keyframes nlSpin { to { transform: rotate(360deg); } }

/* ── Consent ──────────────────────────────── */
.nl-consent {
  font-size: .73rem;
  color: rgba(255,255,255,.3);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

/* ── Step 2 specific ─────────────────────── */
.nl-step2-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  animation: nlBounce .5s ease;
}
@keyframes nlBounce {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.nl-step2-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

/* ── Success state ─────────────────────────── */
.nl-step-success {
  text-align: center;
  padding: 20px 0 10px;
}
.nl-success-anim {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.nl-success-check {
  width: 64px;
  height: 64px;
  color: var(--nl-g2);
  animation: nlCheckPop .5s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes nlCheckPop {
  from { transform: scale(0.5) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}
.nl-check-circle {
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: nlDraw .6s ease .1s forwards;
}
.nl-check-tick {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: nlDraw .4s ease .5s forwards;
}
@keyframes nlDraw {
  to { stroke-dashoffset: 0; }
}
