/* ============================================================
   PunchyPass · Pro-intent modal
   Apple-style sheet that captures the lead BEFORE the Auth0 hop.
   Strict reuse of tokens/landing.css primitives — no new colors,
   no new shadows, no new fonts.
   ============================================================ */

/* ─── Overlay ──────────────────────────────────────────────── */
.ppm-overlay {
  position: fixed; inset: 0;
  z-index: 1000;
  background: rgb(0 0 0 / 0.60);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: ppm-overlay-in 240ms var(--ease-standard);
  /* No backdrop-filter here — operator-grade trust beats decorative blur. */
}
@keyframes ppm-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Sheet ────────────────────────────────────────────────── */
.ppm-sheet {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow:
    0 32px 64px -16px rgb(0 0 0 / 0.42),
    0 8px 24px -8px rgb(0 0 0 / 0.30);
  padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-lg);
  color: var(--color-text);
  font-family: var(--font-sans);
  animation: ppm-sheet-in 280ms var(--ease-standard);
}
@keyframes ppm-sheet-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Close button ─────────────────────────────────────────── */
.ppm-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.ppm-close:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}
.ppm-close:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ─── Header copy ──────────────────────────────────────────── */
.ppm-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  line-height: 1.25;
  padding-right: 40px; /* breathing room next to close button */
}
.ppm-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0 0 6px;
}
.ppm-price {
  font-size: 0.95rem;
  color: var(--color-text);
  margin: 0 0 16px;
}
.ppm-price strong {
  font-weight: 600;
}

/* ─── Step indicator (inline, no progress bar) ─────────────── */
.ppm-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin: 0 0 var(--spacing-lg);
}
.ppm-step {
  font-variant-numeric: tabular-nums;
}
.ppm-step--current {
  color: var(--color-text);
  font-weight: 600;
}

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

.ppm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ppm-field__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  /* Sentence-case, NOT uppercase. Avoids compounding the eyebrow-density
     audit hit; this is content the operator reads, not a kicker. */
}
.ppm-field__optional {
  color: var(--color-text-secondary);
  font-weight: 400;
  font-size: 0.8125rem;
}

.ppm-field input {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-height: 44px;
  color: var(--color-text);
  font-family: inherit;
  font-size: 16px; /* 16px prevents iOS Safari zoom on focus */
  width: 100%;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
.ppm-field input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}
.ppm-field input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}
.ppm-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ppm-field--error input {
  border-color: var(--color-error);
}
.ppm-field--error input:focus {
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.24);
}

.ppm-field__msg {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin: 0;
}
.ppm-field__msg--error {
  color: var(--color-error);
}

/* ─── Consent checkboxes ───────────────────────────────────── */
.ppm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-text);
  cursor: pointer;
  padding: 6px 0;
  min-height: 44px; /* touch target */
  align-items: center;
}
.ppm-check input[type="checkbox"] {
  flex: none;
  width: 18px; height: 18px;
  margin: 2px 0 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.ppm-check a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--color-text) 40%, transparent);
  transition: text-decoration-color var(--duration-fast) var(--ease-standard);
}
.ppm-check a:hover {
  text-decoration-color: var(--color-text);
}
.ppm-check__optional {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}
.ppm-check__error {
  margin: -8px 0 0;
  padding-left: 28px;
  font-size: 0.8125rem;
  color: var(--color-error);
}

/* ─── Submit ───────────────────────────────────────────────── */
.ppm-submit {
  width: 100%;
  margin-top: 6px;
  min-height: 52px; /* matches btn--lg from landing.css */
}
.ppm-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ppm-form__error {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-error);
  line-height: 1.45;
}

.ppm-trust {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
  text-align: center;
}

/* ─── Honeypot — visually + AT hidden, but submittable ─────── */
.ppm-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ─── Success state ────────────────────────────────────────── */
.ppm-success {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: color-mix(in srgb, var(--color-success) 8%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  color: var(--color-text);
  animation: ppm-success-in 240ms var(--ease-standard);
}
.ppm-success__check {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
@keyframes ppm-success-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Mobile: bottom sheet ─────────────────────────────────── */
@media (max-width: 560px) {
  .ppm-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .ppm-sheet {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
    animation: ppm-sheet-up 320ms var(--ease-standard);
  }
  @keyframes ppm-sheet-up {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .ppm-title { font-size: 1.25rem; }
}

/* ─── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ppm-overlay,
  .ppm-sheet,
  .ppm-success,
  .ppm-close,
  .ppm-field input {
    animation: none !important;
    transition: none !important;
  }
}
