/* ==========================================================================
   LEAD CAPTURE — popup styles
   Absolute Cosmetic Clinic
   --------------------------------------------------------------------------
   Mobile-first, like the rest of the site: this file describes the phone
   layout and one min-width query lifts it for larger screens.

   Written against the design tokens in variables.css, with literal fallbacks
   in case this file is reused on a page that does not load them.
   ========================================================================== */

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 500;              /* above --z-skip (400) — a modal outranks all */
  display: flex;
  align-items: flex-end;     /* phone: sheet rises from the bottom */
  justify-content: center;
}

.lead-modal[hidden] {
  display: none;
}

.lead-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(10, 17, 13, 0.55);
  animation: lead-fade 180ms ease-out;
}

.lead-modal__panel {
  position: relative;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: var(--space-6, 1.5rem);
  padding-bottom: calc(var(--space-6, 1.5rem) + env(safe-area-inset-bottom, 0px));
  background-color: var(--surface, #FFFFFF);
  border-radius: var(--radius-xl, 28px) var(--radius-xl, 28px) 0 0;
  box-shadow: 0 -8px 40px rgba(16, 24, 20, 0.22);
  animation: lead-rise 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.lead-modal__close {
  position: absolute;
  top: var(--space-3, 0.75rem);
  right: var(--space-3, 0.75rem);
  width: 40px;               /* 40px: a comfortable touch target */
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  color: var(--ink-500, #5A6B62);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lead-modal__close:hover {
  background-color: var(--bg, #F7FAF7);
  color: var(--ink-900, #111815);
}

.lead-modal__title {
  margin: 0 var(--space-10, 2.5rem) var(--space-2, 0.5rem) 0;
  font-family: var(--font-heading, inherit);
  font-size: var(--fs-xl, 1.35rem);
  font-weight: var(--fw-bold, 700);
  color: var(--ink-900, #111815);
}

.lead-modal__intro {
  margin: 0 0 var(--space-5, 1.25rem);
  font-size: var(--fs-sm, 0.875rem);
  line-height: 1.55;
  color: var(--ink-500, #5A6B62);
}

/* --------------------------------------------------------------------------
   Fields
   -------------------------------------------------------------------------- */

.lead-field {
  margin-bottom: var(--space-4, 1rem);
}

.lead-field label {
  display: block;
  margin-bottom: var(--space-1, 0.25rem);
  font-size: var(--fs-sm, 0.875rem);
  font-weight: var(--fw-semibold, 600);
  color: var(--ink-700, #2C3A33);
}

.lead-field input[type="text"],
.lead-field input[type="tel"],
.lead-field select {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem var(--space-3, 0.75rem);
  border: 1px solid var(--line-strong, #CBD8D0);
  border-radius: var(--radius-sm, 10px);
  background-color: var(--surface, #FFFFFF);
  color: var(--ink-900, #111815);
  /* 16px minimum, or iOS Safari zooms the page on focus. */
  font-size: 16px;
  font-family: inherit;
}

.lead-field input:focus-visible,
.lead-field select:focus-visible,
.lead-submit:focus-visible,
.lead-modal__close:focus-visible {
  outline: 3px solid var(--green-700, #157A3C);
  outline-offset: 2px;
}

.lead-field.is-invalid input,
.lead-field.is-invalid select {
  border-color: var(--danger, #B42318);
}

.lead-field__error {
  display: block;
  margin-top: var(--space-1, 0.25rem);
  min-height: 1em;           /* reserved, so an error never shifts the layout */
  font-size: var(--fs-xs, 0.8125rem);
  line-height: 1.4;
  color: var(--danger, #B42318);
}

.lead-field--check label {
  display: flex;
  gap: var(--space-2, 0.5rem);
  align-items: flex-start;
  font-weight: var(--fw-regular, 400);
  font-size: var(--fs-sm, 0.875rem);
  line-height: 1.5;
  color: var(--ink-500, #5A6B62);
}

.lead-field--check input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--green-700, #157A3C);
}

/* Honeypot. Off-screen rather than display:none, because some bots skip
   fields that are not rendered at all. Never focusable, never announced. */
.lead-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Submit + status
   -------------------------------------------------------------------------- */

.lead-submit {
  width: 100%;
  min-height: 52px;
  margin-top: var(--space-2, 0.5rem);
  border: 0;
  border-radius: var(--radius-pill, 999px);
  background-color: var(--green-700, #157A3C);
  color: #FFFFFF;
  font-family: inherit;
  font-size: var(--fs-base, 1rem);
  font-weight: var(--fw-semibold, 600);
  cursor: pointer;
  transition: background-color 180ms ease, opacity 180ms ease;
}

.lead-submit:hover:not(:disabled) {
  background-color: var(--green-800, #0F5C2D);
}

.lead-submit:disabled {
  opacity: 0.65;
  cursor: progress;
}

.lead-status {
  margin: var(--space-3, 0.75rem) 0 0;
  min-height: 1em;
  font-size: var(--fs-sm, 0.875rem);
  line-height: 1.5;
  text-align: center;
}

.lead-status.is-ok    { color: var(--green-700, #157A3C); font-weight: 600; }
.lead-status.is-error { color: var(--danger, #B42318); }

.lead-skip {
  margin-top: var(--space-2, 0.5rem);
  border: 1px solid var(--line-strong, #CBD8D0);
  border-radius: var(--radius-pill, 999px);
  padding: 0.5rem var(--space-4, 1rem);
  background-color: transparent;
  color: var(--ink-700, #2C3A33);
  font: inherit;
  font-size: var(--fs-sm, 0.875rem);
  cursor: pointer;
}

/* Stops the page behind the modal scrolling under the sheet on iOS. */
body.lead-locked {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   ≥ 560px — centred dialog rather than a bottom sheet
   -------------------------------------------------------------------------- */

@media (min-width: 560px) {

  .lead-modal {
    align-items: center;
    padding: var(--space-6, 1.5rem);
  }

  .lead-modal__panel {
    width: 440px;
    max-height: 88vh;
    border-radius: var(--radius-xl, 28px);
    padding: var(--space-8, 2rem);
    animation-name: lead-zoom;
  }
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@keyframes lead-fade { from { opacity: 0; } }
@keyframes lead-rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes lead-zoom { from { transform: scale(0.97); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {

  .lead-modal__backdrop,
  .lead-modal__panel {
    animation: none;
  }
}
