/* ============================================================================
   JBT Verification — "Ledger 1884"
   An engraved trade-ledger aesthetic: ivory stock, iron-gall ink, brass rule.
   Nothing here is decorative for its own sake; the visual language is borrowed
   from the credit ledger the institution actually kept.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Archivo:wght@400;500;600;700&display=swap');

:root {
  --paper:        oklch(0.977 0.010 88);
  --paper-sunk:   oklch(0.949 0.014 86);
  --paper-edge:   oklch(0.906 0.018 84);
  --ink:          oklch(0.255 0.032 252);
  --ink-soft:     oklch(0.455 0.028 252);
  --ink-faint:    oklch(0.635 0.020 250);
  --brass:        oklch(0.700 0.118 76);
  --brass-deep:   oklch(0.560 0.104 72);
  --verdigris:    oklch(0.520 0.084 168);
  --vermilion:    oklch(0.560 0.150 32);

  --rule:         color-mix(in oklch, var(--ink) 14%, transparent);
  --rule-strong:  color-mix(in oklch, var(--ink) 30%, transparent);

  --display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --body: 'Archivo', 'Helvetica Neue', sans-serif;

  --step--1: clamp(0.75rem, 0.72rem + 0.15vw, 0.82rem);
  --step-0:  clamp(0.94rem, 0.90rem + 0.20vw, 1.02rem);
  --step-1:  clamp(1.15rem, 1.05rem + 0.45vw, 1.35rem);
  --step-2:  clamp(1.55rem, 1.30rem + 1.10vw, 2.15rem);
  --step-3:  clamp(2.10rem, 1.60rem + 2.20vw, 3.30rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  /* Faint engraved ruling, as on ledger stock. */
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0 31px,
      color-mix(in oklch, var(--ink) 3.5%, transparent) 31px 32px
    );
}

/* ---- Frame ------------------------------------------------------------- */

.sheet {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4.5rem);
  max-width: 68rem;
  margin-inline: auto;
  padding: clamp(1.75rem, 4vw, 4rem) clamp(1.25rem, 4vw, 3rem) 5rem;
}

@media (max-width: 46rem) {
  .sheet { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}

/* ---- Left rail --------------------------------------------------------- */

.rail { position: relative; }

@media (min-width: 46.001rem) {
  .rail { position: sticky; top: clamp(1.75rem, 4vw, 4rem); align-self: start; }
  .rail::after {
    content: '';
    position: absolute;
    inset-block: 0.35rem 0;
    right: calc(clamp(1.5rem, 4vw, 4.5rem) / -2);
    border-right: 1px solid var(--rule);
  }
}

.mark { display: block; }

.mark__eyebrow {
  margin: 0 0 0.7rem;
  font-size: var(--step--1);
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  max-width: 20ch;
}

/*
 * noreferrer matters here, not just noopener: this page's own URL can carry
 * prefilled registrant details, and a Referer header would hand them to
 * jewelersboard.com's web logs.
 */
.mark__link {
  display: inline-block;
  border-radius: 2px;
  transition: opacity 200ms var(--ease);
}

.mark__link:hover { opacity: 0.78; }

.mark__link:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 4px;
}

/* The logo is the mark; nothing competes with it above the step ledger. */
.mark__logo {
  display: block;
  width: clamp(7rem, 9vw, 8.75rem);
  height: auto;
  margin-left: -0.15rem;
}

.rail__note {
  margin-top: 1.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  color: var(--ink-faint);
  max-width: 26ch;
}

/* ---- Step ledger ------------------------------------------------------- */

.ledger { list-style: none; margin: 1.9rem 0 0; padding: 0; }

.ledger li {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--step--1);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 320ms var(--ease);
}

.ledger li span:first-child {
  font-family: var(--display);
  font-size: var(--step-0);
  white-space: nowrap;
}

.ledger li[data-state='active'] { color: var(--ink); font-weight: 600; }
.ledger li[data-state='active'] span:first-child { color: var(--brass-deep); }
.ledger li[data-state='done'] { color: var(--ink-soft); }
.ledger li[data-state='done'] span:first-child::after { content: ' ✓'; color: var(--verdigris); }

@media (max-width: 46rem) {
  .ledger { display: flex; gap: 0.4rem; margin-top: 1.4rem; }
  .ledger li { flex: 1; border-bottom: 2px solid var(--rule); grid-template-columns: 1fr; }
  .ledger li[data-state='active'] { border-bottom-color: var(--brass); }
  .ledger li span:last-child { display: none; }
  .ledger li span:first-child { font-family: var(--body); font-size: var(--step--1); }
}

/* ---- Working area ------------------------------------------------------ */

.stage { min-width: 0; }

/* Keep the working area from collapsing to a sliver on the short first step. */
.stage > .panel { min-height: 22rem; }

.panel { display: none; }
.panel[data-active] { display: block; animation: rise 620ms var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.9rem); }
  to   { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass-deep);
  font-weight: 600;
}

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0;
}

h1 { font-size: var(--step-3); line-height: 1.02; }
h2 { font-size: var(--step-2); line-height: 1.1; }

.lede {
  margin: 0.9rem 0 0;
  max-width: 48ch;
  color: var(--ink-soft);
  font-size: var(--step-1);
  line-height: 1.45;
}

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

.field { margin-top: 2.4rem; }

.field label {
  display: block;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.55rem;
}

/* Underlined rather than boxed — a line on a ledger, not a widget. */
.input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--rule-strong);
  background: transparent;
  padding: 0.55rem 0.1rem;
  font: inherit;
  font-size: var(--step-2);
  font-family: var(--display);
  color: var(--ink);
  border-radius: 0;
  transition: border-color 220ms var(--ease);
}

.input::placeholder { color: color-mix(in oklch, var(--ink-faint) 62%, transparent); }
.input:focus { outline: none; border-bottom-color: var(--brass); }
.input:focus-visible { outline: none; }

.input--code {
  font-family: var(--body);
  font-weight: 600;
  letter-spacing: 0.42em;
  max-width: 9ch;
}

.hint { margin: 0.6rem 0 0; font-size: var(--step--1); color: var(--ink-faint); }

.switcher {
  margin-top: 1.4rem;
  font-size: var(--step--1);
  color: var(--ink-faint);
}

.linkish {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--brass);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.linkish:hover { color: var(--brass-deep); }

/* ---- Results as ledger rows -------------------------------------------- */

.results { margin-top: 2rem; border-top: 1px solid var(--rule-strong); }

.results:empty { border-top: 0; }

.row {
  display: grid;
  grid-template-columns: 0.35rem 1fr auto;
  align-items: baseline;
  gap: 0 1rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  padding: 0.95rem 0.75rem 0.95rem 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background-color 200ms var(--ease);
  animation: rise 500ms var(--ease) both;
}

.row::before {
  content: '';
  grid-column: 1;
  align-self: stretch;
  background: var(--brass);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 260ms var(--ease);
}

.row:hover, .row:focus-visible {
  background: color-mix(in oklch, var(--brass) 7%, transparent);
  outline: none;
}
.row:hover::before, .row:focus-visible::before { transform: scaleY(1); }

.row__name {
  grid-column: 2;
  font-family: var(--display);
  font-size: var(--step-1);
  line-height: 1.2;
}

.row__dba {
  grid-column: 2;
  font-size: var(--step--1);
  color: var(--ink-soft);
  font-style: italic;
}
.row__dba::before {
  content: 'd/b/a ';
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85em;
  color: var(--brass-deep);
}

.row__where {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---- Buttons ----------------------------------------------------------- */

.actions { margin-top: 2.2rem; display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 0.72rem 1.6rem;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 200ms var(--ease), background-color 200ms var(--ease);
}

.btn:hover { background: var(--brass-deep); border-color: var(--brass-deep); transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn--quiet { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--quiet:hover { background: transparent; color: var(--brass-deep); border-color: var(--brass); }

/* ---- Selected company plaque ------------------------------------------- */

.plaque {
  margin-top: 1.9rem;
  padding: 1.1rem 1.3rem;
  background: var(--paper-sunk);
  border-left: 2px solid var(--brass);
}

.plaque__name { font-family: var(--display); font-size: var(--step-1); }
.plaque__where { font-size: var(--step--1); color: var(--ink-soft); letter-spacing: 0.06em; }

/* ---- Messages ---------------------------------------------------------- */

.notice {
  margin-top: 1.4rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--vermilion);
  font-size: var(--step-0);
  color: var(--ink-soft);
  animation: rise 400ms var(--ease) both;
}

.spinner {
  margin-top: 1.6rem;
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- Certificate ------------------------------------------------------- */

.certificate {
  margin-top: 2.2rem;
  position: relative;
  background: var(--paper-sunk);
  border: 1px solid var(--paper-edge);
  padding: clamp(1.6rem, 3.5vw, 2.8rem);
  /* Engine-turned guilloche, the way a share certificate is protected. */
  background-image:
    repeating-linear-gradient(58deg,
      color-mix(in oklch, var(--ink) 4%, transparent) 0 1px,
      transparent 1px 9px),
    repeating-linear-gradient(-58deg,
      color-mix(in oklch, var(--ink) 3%, transparent) 0 1px,
      transparent 1px 9px);
}

.certificate::before {
  content: '';
  position: absolute;
  inset: 0.55rem;
  border: 1px solid var(--rule-strong);
  pointer-events: none;
}

.certificate__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  /* The seal is large enough to read; on a phone it drops below the title
     rather than squeezing it. */
  flex-wrap: wrap;
}

.certificate__head > :first-child { flex: 1 1 12rem; min-width: 0; }

.certificate__title { font-family: var(--display); font-size: var(--step-2); line-height: 1.05; }
.certificate__sub {
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass-deep);
  font-weight: 600;
}

.seal {
  /* Large enough that "THE JEWELERS BOARD OF TRADE" is legible — the point of
     the mark is that the attendee can see who answered. */
  flex: none;
  display: block;
  width: clamp(7rem, 16vw, 10rem);
  height: auto;
  aspect-ratio: 1;
  margin-left: auto;
  animation: stamp 700ms var(--ease) both;
}

@keyframes stamp {
  from { opacity: 0; transform: rotate(-14deg) scale(1.35); }
  to   { opacity: 1; transform: none; }
}

.certificate__body { margin-top: 1.6rem; position: relative; }

.grantee {
  font-family: var(--display);
  font-size: var(--step-2);
  line-height: 1.15;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 0.5rem;
  max-width: 32ch;
}

.facts { display: flex; flex-wrap: wrap; gap: 1.4rem 2.6rem; margin-top: 1.3rem; }
.fact__label {
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.fact__value { font-family: var(--display); font-size: var(--step-1); }

/* Tear-off strip carrying the one-time token. */
.stub {
  margin-top: 1.9rem;
  position: relative;
  padding-top: 1.6rem;
}

.stub::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(-1 * clamp(1.6rem, 3.5vw, 2.8rem));
  right: calc(-1 * clamp(1.6rem, 3.5vw, 2.8rem));
  border-top: 2px dashed var(--rule-strong);
}

.stub__label {
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.token {
  /* Eight characters, set to be read aloud across a trade-show booth and
     retyped without losing your place. */
  margin-top: 0.6rem;
  display: block;
  width: 100%;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  padding: 0.7rem 0.9rem;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.1rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.22em;
  line-height: 1.25;
  text-align: center;
  color: var(--ink);
  text-indent: 0.22em; /* offsets the trailing letter-space, so it reads centred */
}

.countdown { color: var(--vermilion); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Bail-out ---------------------------------------------------------- */

/* A ruled break, the way a ledger separates one account from the next. */
.aside-rule {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--rule-strong);
}

.aside-rule__title { margin-top: 0.35rem; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0 2rem;
}

.grid-2 .field { margin-top: 1.6rem; }

.input--sm {
  font-family: var(--body);
  font-size: var(--step-0);
  border-bottom-width: 1px;
}

.input--state { text-transform: uppercase; letter-spacing: 0.2em; max-width: 5ch; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 2rem;
  max-width: 52ch;
  font-size: var(--step--1);
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1.5;
}

.consent input {
  flex: none;
  margin-top: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--brass-deep);
  cursor: pointer;
}

/* Present in the DOM, absent to anyone with eyes. */
.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

a.btn { text-decoration: none; display: inline-block; }

/* Signals that a value arrived from the registration site rather than the person. */
.prefill-flag {
  color: var(--brass-deep);
  border-left: 2px solid var(--brass);
  padding-left: 0.65rem;
  margin-top: 0.75rem;
}

/* Verification challenge, shown only to a client that exhausted its search
   budget. Sits where the results would be, so it reads as a step rather than
   an error. */
.challenge {
  display: flex;
  justify-content: center;
  padding: 18px 0;
}

/* Confirmation after a listing request reaches JBT. This is the one step where
   the visitor hands something over and gets nothing back, so the
   acknowledgement is a dialog rather than a quiet panel swap. */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 20, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

/* An author `display` beats the browser's own [hidden] rule, so without this
   the dialog would show on load and refuse to close. */
.modal[hidden] { display: none; }

.modal-card {
  background: #fffdf8;
  border-radius: 10px;
  padding: 30px 32px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(28, 25, 20, .28);
}

.modal-card h2 { margin: 0 0 10px; }
.modal-card p { margin: 0 0 14px; }

.sent-summary {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: rgba(28, 25, 20, .04);
  border-radius: 8px;
}
.sent-summary dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .6;
}
.sent-summary dd { margin: 2px 0 10px; font-weight: 600; }
.sent-summary dd:last-child { margin-bottom: 0; }

/* Hint under a field. Quiet enough not to compete with the label, present
   enough that an international registrant sees it before mistyping a number. */
.field-hint {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: .65;
  line-height: 1.35;
}
