/* ==========================================================================
   The coupon pages — /coupon and /coupon/verify.
   --------------------------------------------------------------------------
   Only what ds-lead.css does not already give. The page wash, the card, the
   fields, the buttons and the footer are all the lead form's; this file adds
   the ticket that shows the issued code, the desk's result panel and its facts
   list.

   Every selector is prefixed `cp-`, and none of them is a tag or a shared
   class, so loading it site-wide cannot reach a page that does not use it.
   ========================================================================== */

/* ---------------- the issued coupon ---------------- */

.cp-done {
  padding: 34px 28px 30px;
  border: 1px solid var(--ds-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 28, 37, 0.04), 0 18px 44px -28px rgba(28, 28, 37, 0.28);
  text-align: center;
}
.cp-done:focus {
  outline: none;
}
.cp-done h1 {
  margin: 18px 0 0;
  font-size: clamp(23px, 4.6vw, 30px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--ds-ink);
}
.cp-done-lede {
  margin: 10px auto 0;
  max-width: 42ch;
  font-size: 15.5px;
  color: var(--ds-muted);
}

/* The stub, echoing the PDF: teal ground, the code large enough to read
   across a counter, and a dashed rule where the paper coupon is torn. */
.cp-ticket {
  position: relative;
  margin: 26px 0 24px;
  padding: 24px 18px 20px;
  border-radius: 14px;
  background: linear-gradient(140deg, #0d7469, #0a564e);
  color: #fff;
  overflow: hidden;
}
.cp-ticket::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.34);
  border-radius: 9px;
  pointer-events: none;
}
.cp-ticket-label {
  position: relative;
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}
.cp-code {
  position: relative;
  margin: 8px 0 0;
  /* Tabular, monospaced and spaced out: this is read aloud and typed by hand,
     so O against 0 and I against 1 have to be separable at a glance. */
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: clamp(24px, 6.4vw, 34px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.15;
  word-break: break-all;
}
.cp-ticket-worth {
  position: relative;
  margin: 12px auto 0;
  max-width: 30ch;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.94);
}
.cp-ticket-holder {
  position: relative;
  margin: 6px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}

.cp-note {
  margin: 20px auto 0;
  max-width: 48ch;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ds-muted);
}
.cp-note-tight {
  margin-top: 12px;
  text-align: left;
}

/* ---------------- the desk's answer ---------------- */

.cp-result {
  margin-top: 22px;
}
.cp-result:focus {
  outline: none;
}

.cp-flag {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--ds-line);
  border-radius: 14px;
  background: #fff;
}
.cp-flag i {
  flex: none;
  margin-top: 2px;
  font-size: 18px;
}
.cp-flag p {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.45;
}

/* Colour is never the only signal — each state also has its own icon and its
   own sentence, because a green tick and an amber tick are the same tick to a
   colour-blind reader and to a phone in direct sun at a stall. */
.cp-flag-ok {
  border-color: rgba(13, 116, 105, 0.34);
  background: rgba(13, 116, 105, 0.07);
  color: #0a564e;
}
.cp-flag-warn {
  border-color: rgba(191, 123, 12, 0.34);
  background: rgba(240, 173, 78, 0.12);
  color: #8a5a06;
}
.cp-flag-bad {
  border-color: rgba(179, 45, 45, 0.32);
  background: rgba(179, 45, 45, 0.08);
  color: #8c2020;
}

.cp-facts {
  margin: 14px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--ds-line);
  border-radius: 14px;
  background: #fff;
}
.cp-facts > div {
  display: flex;
  gap: 14px;
  padding: 9px 0;
}
.cp-facts > div + div {
  border-top: 1px solid var(--ds-line);
}
.cp-facts dt {
  flex: none;
  width: 96px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ds-muted);
}
.cp-facts dd {
  margin: 0;
  font-size: 15px;
  color: var(--ds-ink);
  word-break: break-word;
}
.cp-facts-code {
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ---------------- redeeming ---------------- */

.cp-redeem {
  margin-top: 18px;
  padding: 24px 22px 26px;
  border: 1px solid var(--ds-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 28, 37, 0.04), 0 18px 44px -28px rgba(28, 28, 37, 0.28);
}
.cp-redeem h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ds-ink);
}
.cp-redeem-lede {
  margin: 6px 0 20px;
  font-size: 14px;
  color: var(--ds-muted);
}
.cp-redeem .lf-btn {
  width: 100%;
  margin-top: 6px;
}

/* The one field on either page that is typed in capitals from paper. */
.cp-code-input {
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

@media (max-width: 575px) {
  .cp-done {
    padding: 28px 18px 24px;
  }
  .cp-facts {
    padding: 14px 16px;
  }
  .cp-facts > div {
    flex-direction: column;
    gap: 3px;
  }
  .cp-facts dt {
    width: auto;
  }
  .cp-redeem {
    padding: 20px 16px 22px;
  }
}
