/* ENVOY — order-form.css
   the form frame, the price, the text fields, the stepper

   One part of a stylesheet split across files. The load order in
   index.html is part of the stylesheet — see css/base.css for the map. */

/* ---- the form ---- */

/* The countdown plate's treatment, reused: an ember lit from one corner,
   guttering out to black, with the same generated grain over it. It is the
   one piece of the page's own artwork that can be a container, and putting
   the sale inside it ties the ask back to the clock at the top. Much dimmer
   than the plates themselves — this one has form controls to stay out of
   the way of. */
.order-form,
.order-done {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 2.4vw, 38px) clamp(20px, 2.6vw, 40px);
  border: 1px solid rgba(239, 32, 21, 0.26);
  border-left: 2px solid var(--red);
  background:
    radial-gradient(118% 88% at 84% 0%,
        rgba(238, 30, 18, 0.22) 0%,
        rgba(210, 16, 12, 0.15) 26%,
        rgba(168, 10, 10, 0.09) 48%,
        rgba(52, 2, 4, 0.04) 74%,
        rgba(0, 0, 0, 0) 100%),
    linear-gradient(180deg, rgba(15, 1, 3, 0.93) 0%, rgba(7, 0, 1, 0.95) 100%);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.order-form::after,
.order-done::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
  filter: contrast(320%);
  opacity: 0.2;
  mix-blend-mode: overlay;
}

/* Above the grain, which is a sibling painted after them — the same lift the
   countdown's numerals take. Without it the noise films over the inputs and
   every value in the box reads a shade muddier than the labels. */
.order-form > *,
.order-done > * { position: relative; z-index: 1; }

/* `hidden` is only a `display: none` in the UA sheet, which any of the
   display rules above would quietly outrank. This is what makes the attribute
   mean what it says. */
[hidden] { display: none !important; }

/* ---- price ---- */

.order-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2em 0.8em;
  margin-bottom: clamp(20px, 3vh, 32px);
  padding-bottom: clamp(16px, 2.4vh, 26px);
  border-bottom: 1px solid rgba(239, 32, 21, 0.2);
}

/* The grotesque, tabular, on white — the countdown's numerals. Every figure
   on this page that is a *quantity* is set this way; the Bodoni is for
   lettering. */
.order-price-fig {
  font-family: var(--sans);
  font-size: clamp(34px, 3.6vw, 54px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.015em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.order-price-note {
  font-family: "Cormorant Garamond", "EB Garamond", Garamond, serif;
  font-size: clamp(14px, 1.1vw, 18px);
  color: rgba(243, 228, 226, 0.62);
}

/* ---- fields ---- */

.order-field { margin-bottom: clamp(16px, 2.4vh, 26px); }

/* A <fieldset> brings a border, padding and a min-width of its content that
   nothing else on the page has; it is here for the grouping semantics only. */
fieldset.order-field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.order-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(12px, 1.6vw, 24px);
}

.order-label {
  display: block;
  margin-bottom: 0.62em;
  padding: 0;
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: clamp(9px, 0.78vw, 11px);
  font-weight: 700;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-transform: uppercase;
  color: var(--red);
}

.order-input {
  width: 100%;
  padding: 0.72em 0.85em;
  border: 1px solid rgba(239, 32, 21, 0.3);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(14px, 1.05vw, 16px);
  /* Form controls do not inherit type, and left alone they fall back to the
     platform UI font at whatever size the platform likes — which on a page
     of Bodoni and Courier reads as a hole. */
  line-height: 1.2;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.order-input::placeholder { color: rgba(243, 228, 226, 0.34); }

.order-input:hover { border-color: rgba(239, 32, 21, 0.5); }

.order-input:focus-visible {
  outline: none;
  border-color: var(--red-bright);
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 0 0 1px var(--red-bright);
}

/* The dark plate is the point of the whole box, and a native select paints
   its own light background on Windows and Android unless told otherwise. */
select.order-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 14'%3E%3Cpath d='M2 2 L12 12 L22 2' fill='none' stroke='%23ef2015' stroke-width='2.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85em center;
  background-size: 0.72em auto;
  cursor: pointer;
}

/* The dropdown itself is drawn by the OS, not by this stylesheet — all that
   can be reached is the colour of the list. Set both so the options are not
   dark-on-dark in the one place the page cannot style. */
select.order-input option { background: #0c0001; color: var(--ink); }

/* ---- quantity stepper ---- */

.stepper {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  border: 1px solid rgba(239, 32, 21, 0.3);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.55);
  transition: border-color 0.18s ease;
}

.stepper:focus-within { border-color: var(--red-bright); }

.step {
  padding: 0 0.9em;
  border: 0;
  background: transparent;
  color: var(--red);
  font-family: var(--sans);
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s ease;
}

.step:hover:not(:disabled) { color: var(--red-bright); }

/* At the ends of the range the button is dead rather than gone — a control
   that vanishes moves everything next to it. */
.step:disabled { color: rgba(239, 32, 21, 0.26); cursor: default; }

/* The stepper draws the border; the input inside it must not draw a second
   one. Its own focus ring goes too, because :focus-within above lights the
   whole box, which is the thing the reader is actually looking at. */
.step-num {
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.step-num:focus-visible {
  background: transparent;
  box-shadow: none;
}

/* The native spinners duplicate the two buttons either side of them, and they
   only appear on hover, so the field twitches as the pointer crosses it. */
.step-num::-webkit-outer-spin-button,
.step-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
