/* REGUP shared UK registration plate control.
   Presentation only: form IDs/names/actions and API endpoints stay unchanged. */
.regup-plate-control {
  --regup-plate-yellow: #ffd51f;
  --regup-plate-blue: #073b9b;
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 68px;
  margin: 0;
  overflow: hidden;
  background: var(--regup-plate-yellow);
  border: 3px solid #111;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.30), 0 7px 18px rgba(15,23,42,.13);
  cursor: text;
  isolation: isolate;
  box-sizing: border-box;
  container-type: inline-size;
}

.regup-plate-control:focus-within {
  border-color: #080808;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.34), 0 0 0 3px rgba(13,110,253,.16), 0 8px 20px rgba(15,23,42,.14);
}

.regup-plate-band {
  position: relative;
  z-index: 2;
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 3px;
  color: #fff;
  background: var(--regup-plate-blue);
  pointer-events: none;
  user-select: none;
  box-sizing: border-box;
}

.regup-plate-band img {
  display: block;
  width: 23px;
  height: 14px;
  max-width: 23px;
  max-height: 14px;
  object-fit: contain;
  margin: 0;
}

.regup-plate-band span {
  display: block;
  color: #fff;
  font: 800 8.5px/1 Arial, Helvetica, sans-serif;
  letter-spacing: .06em;
}

.regup-plate-input {
  position: relative !important;
  z-index: 4 !important;
  flex: 1 1 auto !important;
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 62px !important;
  margin: 0 !important;
  padding: 7px 10px 6px !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #050505 !important;
  caret-color: #050505 !important;
  text-align: center !important;
  text-transform: uppercase !important;
  font-family: 'UKNumberPlate', 'UK Number Plate', 'Charles Wright', 'Arial Narrow', Arial, Helvetica, sans-serif !important;
  font-size: clamp(1.72rem, 7vw, 2.85rem) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: .04em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  -webkit-text-fill-color: #050505 !important;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto !important;
  touch-action: manipulation;
  user-select: text;
  box-sizing: border-box !important;
}

/* Never show the browser's native placeholder. The JS copies its text to the
   soft sample layer below, preventing page-specific placeholder rules from
   making AB12 CDE look like real entered text. */
.regup-plate-input::placeholder {
  color: transparent !important;
  opacity: 0 !important;
  text-shadow: none !important;
}

/* Soft example only when the field is empty. */
.regup-plate-control::after {
  content: attr(data-regup-sample);
  position: absolute;
  z-index: 3;
  left: 58px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
  color: rgba(5,5,5,.25);
  font-family: 'UKNumberPlate', 'UK Number Plate', 'Charles Wright', 'Arial Narrow', Arial, Helvetica, sans-serif;
  font-size: clamp(1.5rem, 6.5vw, 2.45rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .035em;
  text-align: center;
  white-space: nowrap;
  filter: blur(1.35px);
  opacity: 0;
  transition: opacity .14s ease;
}

.regup-plate-control.is-empty::after {
  opacity: .92;
}

.regup-plate-control.is-empty:focus-within::after {
  opacity: .42;
}

/* Size against the component itself rather than viewport width. This stops
   lettering overflowing inside narrow cards while still filling wide plates. */
@supports (font-size: 1cqi) {
  .regup-plate-input {
    font-size: clamp(1.65rem, 12.4cqi, 2.95rem) !important;
  }
  .regup-plate-control::after {
    font-size: clamp(1.45rem, 10.8cqi, 2.42rem);
  }
}

.regup-plate-input:-webkit-autofill,
.regup-plate-input:-webkit-autofill:hover,
.regup-plate-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--regup-plate-yellow) inset !important;
  -webkit-text-fill-color: #050505 !important;
}

.regup-plate-input[readonly] {
  cursor: default;
}

.regup-plate-control.is-invalid {
  border-color: #b42318;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.32), 0 0 0 3px rgba(180,35,24,.12);
}

.regup-plate-control.is-valid {
  border-color: #166534;
}

/* Workshop portal uses the same component but aligns it with form labels. */
.workshop-app .regup-plate-control {
  margin-inline: 0;
}
.workshop-app label .regup-plate-control {
  font-weight: 400;
}

/* Registration shown after lookup uses the same number-plate typography. */
.regup-plate-preview,
.plate-ui,
.rr-confirm-plate {
  font-family: 'UKNumberPlate', 'UK Number Plate', 'Charles Wright', 'Arial Narrow', Arial, Helvetica, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase;
}

/* Compact variant for modals and secondary vehicle confirmation inputs. */
.regup-plate-control.regup-plate-control--compact {
  min-height: 56px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  border-width: 2px;
  border-radius: 7px;
}
.regup-plate-control--compact .regup-plate-band {
  flex-basis: 42px;
  width: 42px;
  min-width: 42px;
}
.regup-plate-control--compact .regup-plate-band img {
  width: 20px;
  height: 13px;
}
.regup-plate-control--compact .regup-plate-input {
  min-height: 52px !important;
  font-size: clamp(1.5rem, 6vw, 2.15rem) !important;
}
.regup-plate-control--compact::after {
  left: 50px;
  right: 8px;
  font-size: clamp(1.35rem, 5.4vw, 1.95rem);
}
@supports (font-size: 1cqi) {
  .regup-plate-control--compact .regup-plate-input {
    font-size: clamp(1.48rem, 11.8cqi, 2.12rem) !important;
  }
  .regup-plate-control--compact::after {
    font-size: clamp(1.32rem, 10.2cqi, 1.9rem);
  }
}

@media (max-width: 575.98px) {
  .regup-plate-control {
    min-height: 60px;
    border-width: 2px;
    border-radius: 7px;
  }
  .regup-plate-band {
    flex-basis: 41px;
    width: 41px;
    min-width: 41px;
  }
  .regup-plate-band img {
    width: 20px;
    height: 13px;
  }
  .regup-plate-band span {
    font-size: 8px;
  }
  .regup-plate-input {
    min-height: 56px !important;
    padding-inline: 6px !important;
    letter-spacing: .03em !important;
  }
  .regup-plate-control::after {
    left: 49px;
    right: 7px;
    letter-spacing: .025em;
    filter: blur(1.4px);
  }
}

@media (max-width: 360px) {
  .regup-plate-input {
    letter-spacing: .02em !important;
  }
  .regup-plate-control::after {
    letter-spacing: .018em;
  }
}
