/* ============================================================
   Openzer \u2014 consent banner + lead form
   ============================================================ */

/* ---------- Consent banner ---------- */
.consent-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10000;
  display: flex; justify-content: center;
  padding: 16px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .28s ease-out, transform .28s ease-out;
}
.consent-banner.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.consent-inner {
  width: min(940px, 100%);
  padding: 22px 22px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  background: linear-gradient(180deg, rgba(20,8,12,0.92) 0%, rgba(12,5,8,0.92) 100%);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
}
.consent-copy .consent-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--text);
}
.consent-copy p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 62ch;
}
.consent-copy a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.consent-copy a:hover { text-decoration-color: var(--accent-2); }

.consent-cats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.consent-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.consent-row:hover { border-color: var(--line-2); }
.consent-row strong { font-family: var(--display); font-weight: 500; font-size: 13.5px; }
.consent-row .dim { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.consent-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 32px; height: 18px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line-2);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
  margin-top: 2px;
}
.consent-row input[type="checkbox"]::after {
  content: '';
  position: absolute; top: 1px; left: 1px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  transition: transform .2s ease-out, background .2s;
}
.consent-row input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.consent-row input[type="checkbox"]:checked::after { transform: translateX(14px); }
.consent-row input[type="checkbox"]:disabled { opacity: 0.55; cursor: not-allowed; }

.consent-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.consent-actions .btn { padding: 11px 18px; font-size: 13.5px; }
.consent-actions .consent-customize {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 11px 12px;
}
.consent-actions .consent-customize:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--line);
  color: var(--text);
}

@media (max-width: 720px) {
  .consent-inner {
    grid-template-columns: 1fr;
    padding: 18px;
  }
  .consent-cats {
    grid-template-columns: 1fr;
  }
  .consent-actions {
    justify-content: stretch;
  }
  .consent-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- Cal.com blocked state (Marketing not consented) ---------- */
.cal-embed.cal-blocked {
  display: grid; place-items: center;
  min-height: 360px;
}
.cal-embed.cal-blocked .cal-loading {
  position: relative; inset: auto;
  opacity: 1;
  pointer-events: auto;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  letter-spacing: normal;
  text-transform: none;
  font-size: 14px;
  color: var(--text);
  padding: 32px;
  max-width: 480px;
}
.cal-embed.cal-blocked .cal-loading .pulse,
.cal-embed.cal-blocked .cal-loading span:first-child { display: none; }
.cal-embed.cal-blocked .cal-loading .lock {
  width: 48px; height: 48px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(139,26,74,0.14);
  border: 1px solid rgba(139,26,74,0.30);
  color: var(--accent-2);
  margin: 0 auto;
}
.cal-embed.cal-blocked .cal-loading .lock svg { display: block; }
.cal-embed.cal-blocked .cal-loading > div {
  color: var(--muted);
  line-height: 1.55;
  max-width: 36ch;
}
.cal-embed.cal-blocked .cal-enable {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.cal-embed.cal-blocked .cal-enable:hover {
  background: rgba(139,26,74,0.18);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.cal-embed.cal-blocked .cal-direct {
  font-size: 12.5px; color: var(--muted);
  border-bottom: 1px dashed var(--line-2); padding-bottom: 2px;
}
.cal-embed.cal-blocked .cal-direct:hover { color: var(--text); border-color: var(--accent-2); }

/* ---------- Lead-capture form ---------- */
.lead-form,
.lead-success {
  margin-top: 36px;
  padding: 28px;
  border-radius: 22px;
  text-align: left;
}
.lead-form-head {
  margin-bottom: 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.lead-form-head h3 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(18px, 1.6vw, 22px);
  letter-spacing: -0.01em;
  color: var(--text);
}
.lead-form-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.lead-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.lead-field { display: flex; flex-direction: column; gap: 6px; }
.lead-field-wide { grid-column: 1 / -1; }
.lead-field label {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.lead-field input,
.lead-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  transition: border-color .2s, background .2s, box-shadow .2s;
  font-family: var(--sans);
}
.lead-field textarea { resize: vertical; min-height: 110px; }
.lead-field input:focus,
.lead-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,0.05);
  box-shadow: 0 0 0 4px rgba(139,26,74,0.18);
}
.lead-field.invalid input,
.lead-field.invalid textarea {
  border-color: #e7536f;
  box-shadow: 0 0 0 4px rgba(231,83,111,0.12);
}
.lead-err {
  font-size: 11.5px;
  color: #e7536f;
  min-height: 14px;
  letter-spacing: 0.02em;
}

.lead-honey {
  position: absolute;
  left: -10000px;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lead-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.lead-status {
  font-size: 13px;
  color: var(--muted);
}
.lead-status.err { color: #e7536f; }

#leadSubmit { min-width: 180px; justify-content: center; position: relative; }
#leadSubmit[disabled] { opacity: 0.7; cursor: progress; }
#leadSubmit .lead-spinner {
  display: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  animation: leadSpin 0.8s linear infinite;
}
#leadSubmit.loading .lead-submit-label,
#leadSubmit.loading .arrow { opacity: 0.5; }
#leadSubmit.loading .lead-spinner { display: inline-block; }
@keyframes leadSpin { to { transform: rotate(360deg); } }

/* Success */
.lead-success {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: linear-gradient(180deg, rgba(139,26,74,0.10), rgba(255,255,255,0.01));
}
.lead-success-icon {
  width: 44px; height: 44px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(139,26,74,0.18);
  border: 1px solid rgba(139,26,74,0.40);
  color: var(--accent-2);
  flex-shrink: 0;
}
.lead-success h3 {
  font-family: var(--display); font-weight: 500;
  font-size: 18px; letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.lead-success p {
  color: var(--muted); font-size: 14px; line-height: 1.55;
}
.lead-success a {
  color: var(--text); border-bottom: 1px dashed var(--line-2);
}
.lead-success a:hover { color: var(--accent-2); border-color: var(--accent-2); }

@media (max-width: 720px) {
  .lead-grid { grid-template-columns: 1fr; }
  .lead-actions { flex-direction: column; align-items: stretch; }
  #leadSubmit { width: 100%; }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .consent-banner,
  .consent-banner.open { transition: none; transform: none; }
  #leadSubmit .lead-spinner { animation-duration: 1.6s; }
}
