@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap');

:root {
  --purple: #6c2bd9;
  --purple-dark: #5b21b6;
  --ink: #111827;
  --muted: #6b7280;
  --border: #d7d7d7;
  --field-bg: #f3f3f3;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: #ffffff;
}

h1,
h2,
h3 {
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  margin: 0;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.primary-button {
  border: none;
  background: var(--purple);
  color: #ffffff;
  padding: 16px 32px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(108, 43, 217, 0.25);
  width: min(320px, 100%);
}

.primary-button:hover {
  background: var(--purple-dark);
}

.primary-button:disabled {
  opacity: 0.7;
  cursor: wait;
  box-shadow: none;
}

input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  font-size: 1rem;
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  color: var(--ink);
}

input::placeholder {
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  font-size: 0.75rem;
}

input:focus {
  outline: none;
  border-color: var(--purple);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(108, 43, 217, 0.15);
}

.error {
  display: none;
  margin-top: 6px;
  color: var(--error);
  font-size: 0.85rem;
  text-align: left;
}

.show-errors input:invalid {
  border-color: var(--error);
}

.show-errors input:invalid + .error {
  display: block;
}

.form-status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--error);
  text-align: center;
}

/* Lead page */

.lead-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 24px 40px;
  text-align: center;
}

.lead-main h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.15;
  max-width: 860px;
  margin: 0 auto;
}

.template-preview {
  position: relative;
  height: 170px;
  width: min(640px, 92vw);
  margin: 24px auto 36px;
}

.template-sheet {
  position: absolute;
  top: 0;
  height: 100%;
  width: 44%;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 18px 18px;
  align-items: flex-start;
  overflow: hidden;
}

.template-sheet::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
}

.template-line {
  height: 8px;
  width: 100%;
  background: #e5e7eb;
  border-radius: 999px;
}

.template-line.short {
  width: 65%;
}

.template-line.medium {
  width: 82%;
}

.template-preview .sheet-back {
  left: 10%;
  transform: rotate(-6deg) scale(0.96);
  transform-origin: center;
  opacity: 0.95;
}

.template-preview .sheet-front {
  right: 10%;
  transform: rotate(4deg) scale(1);
  transform-origin: center;
  z-index: 2;
}

.step-form {
  max-width: 620px;
  margin: 0 auto 24px;
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.question {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 24px;
}

.question strong {
  font-weight: 800;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.field {
  text-align: left;
}

.step .primary-button {
  margin-top: 10px;
}

.benefits {
  list-style: none;
  padding: 0;
  margin: 16px auto 10px;
  max-width: 560px;
  text-align: left;
}

.benefits li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.benefits .spark {
  color: var(--purple);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

.consent {
  max-width: 720px;
  margin: 16px auto 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
  text-align: left;
}

.floating-badge {
  position: fixed;
  left: 22px;
  bottom: 22px;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
}

/* Viewer page */

.viewer-page {
  background: #ffffff;
}

.viewer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 40px 40px;
}

.viewer-shell {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(240px, 1fr);
  gap: 28px;
  align-items: start;
}

.pdf-panel {
  background: transparent;
  border-radius: 12px;
  padding: 0;
  border: none;
  box-shadow: none;
}

.pdf-frame {
  height: min(78vh, 860px);
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.pdf-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.side-form {
  background: transparent;
  border-radius: 0;
  padding: 0 6px;
  border: none;
  box-shadow: none;
}

.side-form-kicker {
  text-align: center;
  color: var(--purple);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
}

.side-form h3 {
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  margin: 0 0 18px;
}

.side-form label {
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  gap: 6px;
  margin-bottom: 8px;
}

.side-form .required {
  color: var(--purple);
}

.side-form .field-row {
  margin-bottom: 14px;
}

.side-form .primary-button {
  width: 100%;
  margin-top: 10px;
}

.side-consent {
  margin-top: 16px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 980px) {
  .viewer-shell {
    grid-template-columns: 1fr;
  }

  .side-form {
    max-width: 420px;
    margin: 0 auto;
  }

  .pdf-frame {
    height: 68vh;
  }
}

@media (max-width: 720px) {
  .lead-main {
    padding: 32px 18px 32px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .floating-badge {
    width: 44px;
    height: 44px;
    font-size: 0.75rem;
  }

  .viewer-container {
    padding: 0 0 24px;
  }

  .pdf-panel,
  .side-form {
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  .pdf-panel {
    padding: 0;
  }

  .pdf-frame {
    border-radius: 0;
    height: 70vh;
  }

  .side-form {
    padding: 20px 18px 24px;
    margin: 0 auto;
    width: 100%;
    max-width: 420px;
  }
}

@media (max-width: 520px) {
  .lead-main h1 {
    font-size: 2rem;
  }

  .question {
    font-size: 1.4rem;
  }

  .template-preview {
    height: 140px;
  }
}
