/* ==========================================================================
   Clae Pest Control — signup.css (owned by task 05)

   Three jobs, and nothing else: the sign-up flow's own markup (the
   progress rail, the quote cards, the e-signature block), the .doc*
   agreement-document rules (AgreementRenderer builds the markup as a
   frozen HTML string — this file only frames and styles it, never
   rebuilds it), and @media print. Everything else on these pages —
   .card, .btn, .field, .chip, .calendar, .pay-page — is reused straight
   from base.css/portal.css per PLAN.md §7; nothing is redefined here.
   ========================================================================== */

/* -----------------------------------------------------------------------
   1. Signup progress rail — <ol class="signup-rail"><li class="signup-
      rail__step is-done|is-current">
   ----------------------------------------------------------------------- */

.signup-rail-wrap {
  background: var(--clae-sand);
  border-bottom: var(--clae-hairline-rule);
}

.signup-rail {
  display: flex;
  gap: var(--clae-gap-lg);
  padding-block: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.signup-rail::-webkit-scrollbar { display: none; }

.signup-rail__step {
  font: 400 12px / 1 var(--clae-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--clae-stone);
  white-space: nowrap;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.signup-rail__step.is-done { color: var(--clae-ink); }
.signup-rail__step.is-done a { text-decoration: underline; text-underline-offset: 3px; }
.signup-rail__step.is-current { color: var(--clae-ink); border-bottom-color: var(--clae-ink); font-weight: 500; }

/* -----------------------------------------------------------------------
   2. Quote cards — step 2, one .quote-card per plan
   ----------------------------------------------------------------------- */

.quote-card { display: flex; flex-direction: column; gap: var(--clae-gap-sm); }
.quote-card.is-recommended { border-color: var(--clae-ink); border-width: 2px; }

.quote-card__money {
  padding-block: 10px;
  border-top: 1px solid var(--clae-sand);
}
.quote-card__money:first-of-type { border-top: none; padding-top: 0; }

/* -----------------------------------------------------------------------
   3. The e-signature block — step 3
   ----------------------------------------------------------------------- */

.sign { margin-top: var(--clae-gap-lg); }

/* Shared by the live typed-name input during signing (step 3) and the
   read-only recorded name shown afterward (agreements#show and the
   public link) — same visual treatment either way, so it reads as an
   actual signature. */
.sign__name {
  font: italic 500 28px / 1.3 var(--clae-font-sans);
}
input.sign__name { padding-block: 14px; }

/* -----------------------------------------------------------------------
   4. Agreement page actions — the "copy a share link" disclosure
   ----------------------------------------------------------------------- */

.agreement-share summary {
  list-style: none;
  cursor: pointer;
}
.agreement-share summary::-webkit-details-marker { display: none; }
.agreement-share[open] { flex-basis: 100%; }
.agreement-share__body { margin-top: 10px; max-width: 480px; }
.agreement-share__body input { margin-top: 6px; }

.doc__fingerprint { font-family: var(--clae-font-mono); }

/* -----------------------------------------------------------------------
   5. The document — .doc, built by AgreementRenderer as a frozen HTML
      string. Framed to look like paper, not a web page.
   ----------------------------------------------------------------------- */

.doc-frame {
  background: var(--clae-sand);
  padding: 32px 16px;
  border-radius: var(--clae-radius-card);
}
.doc-frame + .doc-frame { margin-top: var(--clae-gap-lg); }

.doc {
  max-width: 760px;
  margin-inline: auto;
  background: var(--clae-paper);
  border: 1px solid var(--clae-sand);
  border-radius: var(--clae-radius-card);
  padding: 48px 40px;
  line-height: 1.7;
}

.doc__head {
  text-align: center;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--clae-sand);
}
.doc__kicker {
  font: 400 12px / 1 var(--clae-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--clae-bark);
  margin: 0 0 10px;
}
.doc__company { font: 500 26px / 1.2 var(--clae-font-sans); margin: 0 0 10px; }
.doc__meta { font-size: 13px; color: var(--clae-stone); margin: 2px 0; }

.doc__section { margin-bottom: 32px; }
.doc__section:last-child { margin-bottom: 0; }
.doc__section p { margin: 0; }

.doc__bar {
  background: var(--clae-sand);
  font: 400 12px / 1 var(--clae-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  margin: 0 0 14px;
  border-radius: var(--clae-radius-sm);
}

.doc__pairs {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 6px 16px;
}
.doc__pairs dt { color: var(--clae-stone); font-size: 13px; }
.doc__pairs dd { margin: 0; }

.doc__pests {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.doc__pests li {
  border: 1px solid var(--clae-ink);
  border-radius: var(--clae-radius-pill);
  padding: 6px 14px;
  font-size: 13px;
  text-align: center;
}

.doc__calendar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.doc__month {
  border: 1px solid var(--clae-sand);
  border-radius: var(--clae-radius-sm);
  padding: 10px 6px;
  text-align: center;
}
.doc__month-name {
  display: block;
  font: 400 11px / 1 var(--clae-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--clae-stone);
}
.doc__month-price { display: block; font-weight: 500; margin-top: 6px; min-height: 1.2em; }
.doc__month.is-billed { background: var(--clae-night); border-color: var(--clae-night); color: var(--clae-paper); }
.doc__month.is-billed .doc__month-name { color: var(--clae-periwinkle); }

.doc__money {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--clae-gap-lg);
}

.doc__table { width: 100%; border-collapse: collapse; }
.doc__table td { padding: 6px 0; }
.doc__table td:last-child { text-align: right; }
.doc__table tr.doc__total td {
  border-top: 1px solid var(--clae-ink);
  font-weight: 500;
  padding-top: 10px;
}

.doc__clauses { counter-reset: clause; list-style: none; margin: 0; padding: 0; }
.doc__clauses li {
  counter-increment: clause;
  position: relative;
  padding-left: 28px;
}
.doc__clauses li + li { margin-top: 18px; }
.doc__clauses li::before {
  content: counter(clause) ".";
  position: absolute;
  left: 0;
  font: 400 13px / 1.7 var(--clae-font-mono);
  color: var(--clae-bark);
}
.doc__clauses li strong { display: block; margin-bottom: 4px; }

.doc__fine { font-size: 12px; color: var(--clae-stone); margin-top: 10px; }

/* -----------------------------------------------------------------------
   6. Responsive — same rule as the rest of the app: one column under 760,
      and .doc__money stacks a little earlier, at 700, per spec.
   ----------------------------------------------------------------------- */

@media (max-width: 760px) {
  .doc { padding: 32px 20px; }
  .doc-frame { padding: 20px 10px; }
}

@media (max-width: 700px) {
  .doc__money { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  .doc__calendar { grid-template-columns: repeat(3, 1fr); }

  /* The 150px label column plus an address or a long email is wider than a
     390px phone once .wrap, .doc-frame and .doc have taken their padding, and
     a contract that scrolls sideways reads as broken. Stack the pairs and let
     a long unbroken value wrap rather than push the page. */
  .doc__pairs { grid-template-columns: 1fr; gap: 0; }
  .doc__pairs dt { margin-top: 10px; }
  .doc__pairs dt:first-child { margin-top: 0; }
  .doc__pairs dd { overflow-wrap: anywhere; }
  .doc__meta { overflow-wrap: anywhere; }
}

/* -----------------------------------------------------------------------
   7. Print — the agreement has to read as a contract on paper.
   ----------------------------------------------------------------------- */

@page { margin: 18mm; }

@media print {
  .site-head, .site-nav, .site-foot, .signup-rail-wrap, .btn, .banner, .agreement-share {
    display: none !important;
  }

  body { background: #fff; }

  .doc-frame { background: none; padding: 0; }

  .doc {
    max-width: none;
    width: 100%;
    margin: 0;
    background: #fff;
    border: none;
    border-radius: 0;
    padding: 0;
    color: #000;
  }

  .doc__bar {
    background: none;
    border-bottom: 1px solid #000;
    border-radius: 0;
    padding: 4px 0;
    color: #000;
  }

  .doc__section, .doc__clauses li { page-break-inside: avoid; }

  .doc__month { border-color: #000; }
  .doc__month.is-billed { background: none; color: #000; border: 1px solid #000; }
  .doc__month.is-billed .doc__month-name { color: #000; }
  .doc__pests li { border-color: #000; }
  .doc__table tr.doc__total td { border-top-color: #000; }
  .doc__clauses li::before { color: #000; }
}
