/* The public driver registration (/register). Loads after reserve.css and reuses its tokens and rsv-* pieces.
   Phone first: one column, 16px+ inputs (no iOS zoom), 48px+ touch targets, the action bar stays under the thumb. */

.reg-main {
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

.reg-head {
  display: grid;
  gap: 0.5rem;
}

.reg-head h1 {
  margin: 0;
}

.reg-hero .prose {
  max-width: 34rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- progress ------------------------------------------------------------------------------------------------ */
.reg-progress {
  display: grid;
  gap: 0.55rem;
}

.reg-count {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.reg-count b {
  color: var(--gold-bright);
  font-size: 1.35rem;
}

.reg-count span {
  margin-inline-start: auto;
  color: var(--fg);
  font-weight: 600;
}

.reg-bar {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
}

.reg-bar li {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s var(--ease);
}

.reg-bar li.is-done {
  background: var(--gold-deep);
}

.reg-bar li.is-now {
  background: var(--gold-bright);
}

/* ---- the form -------------------------------------------------------------------------------------------------- */
.reg-form {
  display: grid;
  gap: 1rem;
  background: none;
  border: 0;
  padding: 0;
}

.rsv-form select,
.rsv-form input[type="date"] {
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 0.9rem;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font: inherit;
  color-scheme: dark;
}

.rsv-form select:focus-visible,
.rsv-form input[type="date"]:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--focus);
}

.rsv-form input[type="text"],
.rsv-form input[type="tel"] {
  min-height: 52px;
}

.rsv-form input::placeholder {
  color: rgba(196, 184, 161, 0.62);
}

.rsv-form input[aria-invalid="true"] {
  border-color: var(--danger);
}

.reg-form fieldset {
  min-width: 0;
}

.reg-form .rsv-card h2 {
  margin: 0;
}

.rsv-error p {
  margin: 0;
}

.rsv-error p + p {
  margin-top: 0.35rem;
}

.rsv-error:focus {
  outline: none;
  box-shadow: var(--focus);
}

.reg-fix {
  margin: 0;
}

.reg-link {
  text-align: center;
  word-break: break-all;
}

/* the sticky action bar: always within thumb reach */
.reg-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 0.7rem;
  padding: 0.9rem 0 calc(0.9rem + env(safe-area-inset-bottom, 0px));
  margin-top: 0.4rem;
  background: linear-gradient(to bottom, rgba(10, 10, 12, 0), rgba(10, 10, 12, 0.94) 32%);
}

.reg-actions .btn {
  min-height: 56px;
  justify-content: center;
}

.reg-actions .reg-big {
  flex: 1;
}

.reg-big {
  min-height: 56px;
  font-size: 1.05rem;
  width: 100%;
  justify-content: center;
}

/* ---- the first page -------------------------------------------------------------------------------------------- */
.reg-how {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  counter-reset: how;
}

.reg-how li {
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding-inline-start: 2.8rem;
  counter-increment: how;
}

.reg-how li::before {
  content: counter(how);
  position: absolute;
  inset-inline-start: 0;
  top: 0.05rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(180deg, #f5d76e, #c9a227);
}

.reg-how strong {
  color: var(--fg);
  font-size: 1.02rem;
}

.reg-how span {
  color: var(--fg-muted);
  line-height: 1.7;
}

.reg-prep {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.reg-prep li {
  position: relative;
  padding-inline-start: 1.9rem;
  color: var(--fg);
}

.reg-prep li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.32em;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 6px;
  border: 1.5px solid var(--gold);
  background: rgba(212, 175, 55, 0.12);
}

.reg-start {
  position: relative;
}

/* ---- document slots ---------------------------------------------------------------------------------------------- */
.doc-group {
  gap: 0.8rem;
}

.doc-slot {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  align-items: center;
  gap: 0.8rem 0.9rem;
  padding: 0.7rem;
  border: 1.5px dashed rgba(212, 175, 55, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.doc-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.doc-actions .btn {
  position: relative;
  min-height: 52px;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  overflow: hidden;
}

.doc-actions [hidden] {
  display: none;
}

/* with no camera (or no https) the file choice takes the whole row */
.doc-actions:has(.doc-cam[hidden]),
.doc-actions:not(:has(.doc-cam)) {
  grid-template-columns: 1fr;
}

/* the file input covers its button, so tapping the button opens the picker, and it still works without any script */
.doc-file input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 0;
  cursor: pointer;
  padding: 0;
  border: 0;
}

.doc-file:focus-within {
  border-color: var(--gold-bright);
  box-shadow: var(--focus);
}

/* the frame looks like a scanner viewfinder: four corner brackets around the thumbnail */
.doc-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 5.6rem;
  height: 5.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold);
  overflow: hidden;
}

.doc-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 6px;
  pointer-events: none;
  background:
    linear-gradient(var(--gold), var(--gold)) top left / 14px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top left / 2px 14px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top right / 14px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top right / 2px 14px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom left / 14px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom left / 2px 14px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom right / 14px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom right / 2px 14px no-repeat;
}

.doc-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-frame img[hidden] {
  display: none;
}

.doc-slot.is-done {
  border-style: solid;
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.doc-slot.is-done .doc-icon {
  display: none;
}

.doc-slot.is-busy {
  opacity: 0.7;
}

.doc-text {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.doc-text b {
  color: var(--fg);
  font-size: 1.02rem;
}

.doc-text small {
  color: var(--fg-muted);
  font-weight: 400;
  line-height: 1.55;
}

.doc-slot.is-done .doc-state {
  color: var(--gold-bright);
}

.doc-dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.8rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--hairline);
}

.doc-dates label {
  padding-top: 0.5rem;
}

/* ---- photo tips and the "documents at the office" option ---- */
.reg-tips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.reg-tips li {
  position: relative;
  padding-inline-start: 1.8rem;
  color: var(--fg);
  line-height: 1.65;
}

.reg-tips li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.42em;
  width: 1rem;
  height: 0.55rem;
  border-inline-start: 2.5px solid var(--gold-bright);
  border-bottom: 2.5px solid var(--gold-bright);
  transform: rotate(-45deg);
}

.reg-req {
  margin-inline-start: 0.5rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(245, 215, 110, 0.16);
  color: var(--gold-bright);
  font-size: 0.8rem;
  font-weight: 600;
  vertical-align: middle;
}

.reg-office-opt .rsv-agree {
  align-items: flex-start;
}

.reg-office-opt small {
  color: var(--fg-muted);
  font-weight: 400;
  line-height: 1.6;
}

#docs-wrap[hidden] {
  display: none;
}

.reg-missing.is-office {
  color: var(--gold-bright);
}

/* ---- review ---------------------------------------------------------------------------------------------------------- */
.reg-sum-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.reg-sum-head a,
.reg-problems a {
  color: var(--gold-bright);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.3rem;
}

.reg-problems {
  border-color: rgba(220, 38, 38, 0.6);
}

.reg-problems ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

.reg-problems li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--hairline);
}

.reg-problems li:last-child {
  border-bottom: 0;
}

.reg-problems li a {
  flex: none;
}

.reg-thumbs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.reg-thumbs li {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
}

.reg-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reg-missing {
  color: #fca5a5;
  font-size: 0.85rem;
}

/* ---- after sending: the card -------------------------------------------------------------------------------------- */
.reg-done {
  justify-items: start;
}

.reg-check {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  color: var(--ink);
  background: linear-gradient(180deg, #f5d76e, #c9a227);
  box-shadow: var(--shadow-gold);
}

.reg-card-fig {
  margin: 0;
}

.reg-card-fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  background: #121110;
}

.reg-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.reg-card-actions .btn {
  flex: 1 1 10rem;
  min-height: 52px;
  justify-content: center;
}

.reg-card-actions .reg-big {
  flex-basis: 100%;
}

/* ---- help: phone, company accounts, office ------------------------------------------------------------------- */
.reg-help {
  margin-top: 0.5rem;
}

.reg-help-actions {
  display: grid;
  gap: 0.6rem;
}

.reg-help-actions .btn,
.reg-office .btn {
  min-height: 52px;
  justify-content: center;
  gap: 0.55rem;
}

.reg-socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reg-socials a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--gold-bright);
  text-decoration: none;
}

.reg-socials a:hover {
  background: rgba(212, 175, 55, 0.12);
}

.reg-office {
  display: grid;
  gap: 0.8rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
}

.reg-office div {
  display: grid;
  gap: 0.15rem;
}

.reg-office span {
  color: var(--fg-muted);
  line-height: 1.6;
}

@media (min-width: 34rem) {
  .reg-help-actions {
    grid-template-columns: 1fr 1fr;
  }

  .reg-office {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .reg-thumbs {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .doc-slot,
  .reg-bar li {
    transition: none;
  }
}

/* ---- the camera screen (doc-scan.js) -------------------------------------------------------------------------------- */
html.scan-open {
  overflow: hidden;
}

.scan {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  color: #fff;
  display: grid;
}

.scan[hidden] {
  display: none;
}

.scan-video,
.scan-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scan-video {
  object-fit: contain;  /* the whole frame is shown, so the document you see is the document that is captured */
}

.scan-video.is-mirror {
  transform: scaleX(-1);
}

.scan-tip {
  position: absolute;
  z-index: 3;
  top: max(1rem, env(safe-area-inset-top));
  inset-inline: 1rem;
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100% - 2rem);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: var(--gold-bright);
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
}

.scan-bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;  /* the shutter stays in the middle whatever the side buttons say */
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
}

.scan-bar .scan-btn:first-child {
  justify-self: start;
}

.scan-torch {
  justify-self: end;
  min-width: 0;
}

/* shape chips and the size slider, above the shutter */
.scan-tools {
  position: absolute;
  inset-inline: 0;
  bottom: calc(7.2rem + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  display: grid;
  gap: 0.55rem;
  padding: 0 1rem;
}

.scan-tools[hidden] {
  display: none;
}

.scan-formats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.scan-chip {
  min-height: 40px;
  padding: 0 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.scan-chip[aria-pressed="true"] {
  background: linear-gradient(180deg, #f5d76e, #c9a227);
  border-color: transparent;
  color: var(--ink);
}

.scan-size {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.9rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
}

.scan-size input {
  flex: 1;
  min-height: 36px;
  accent-color: var(--gold-bright);
}

.scan-torch[aria-pressed="true"] {
  background: linear-gradient(180deg, #f5d76e, #c9a227);
  color: var(--ink);
}

.scan-review .scan-bar {
  grid-template-columns: 1fr 1fr;
}

.scan-review .scan-bar .scan-btn {
  justify-self: stretch;
}

.scan-btn {
  min-width: 6rem;
  min-height: 52px;
  padding: 0 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.scan-use {
  background: linear-gradient(180deg, #f5d76e, #c9a227);
  border-color: transparent;
  color: var(--ink);
}

.scan-shutter {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: linear-gradient(180deg, #f5d76e, #c9a227);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.12s var(--ease);
}

.scan-shutter:active {
  transform: scale(0.92);
}

.scan-btn:focus-visible,
.scan-shutter:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.scan-review {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0a0a0c;
  padding: 4.5rem 0.8rem 7rem;
}

.scan-review[hidden] {
  display: none;
}

.scan-result {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .scan-shutter {
    transition: none;
  }
}
