/* Unity Performance: the tuning file service (/files), in the same dark style and red accent as the rest
   of the site (site.css). */

:root {
  --ink: #000;
  --ink-2: #0b0b0d;
  --ink-3: #141418;
  --line: rgba(245, 245, 247, 0.12);
  --line-strong: rgba(245, 245, 247, 0.24);
  --ivory: #f5f5f7;
  --ivory-2: #a1a1a6;
  --muted: #86868b;
  --accent: #ff2d26;
  --accent-bright: #ff6961;
  --accent-fill: #d81b16;
  --accent-fill-hover: #e3201a;
  --on-accent: #fff;
  --link: #2997ff;
  --good: #30d158;
  --warn: #ffb020;
  --bad: #ff6961;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Inter, Roboto, Arial, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 5vw, 48px);
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font: 400 17px/1.47 var(--sans);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 1px solid var(--accent-bright);
  outline-offset: 3px;
}

/* Hidden means hidden, even for elements whose class sets a display. */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ivory);
  color: var(--ink);
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Type ---------- */

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font: 600 17px/1.3 var(--sans);
  letter-spacing: -0.01em;
}

.display,
.title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.display {
  font-size: clamp(52px, 9vw, 124px);
}

.title {
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.06;
}

.display em,
.title em {
  font-style: normal;
  color: var(--accent);
}

.lead {
  max-width: 560px;
  margin: 28px 0 0;
  color: var(--ivory-2);
  font-size: clamp(16px, 1.6vw, 18px);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid var(--line-strong);
  border-radius: 980px;
  background: transparent;
  color: var(--ivory);
  font: 500 16px/1 var(--sans);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.btn:hover {
  border-color: var(--ivory);
}

.btn--primary {
  border-color: var(--accent-fill);
  background: var(--accent-fill);
  color: var(--on-accent);
}

.btn--primary:hover {
  border-color: var(--accent-fill-hover);
  background: var(--accent-fill-hover);
}

.btn--small {
  min-height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--link);
  font: 400 16px/1.4 var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.link:hover {
  text-decoration: underline;
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease);
}

.nav.is-scrolled,
.nav.is-open,
.page-files .nav {
  border-bottom-color: var(--line);
  background: rgba(11, 11, 12, 0.88);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
}

.nav__logo img {
  width: auto;
  height: 40px;
}

.nav__links {
  display: flex;
  gap: 34px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.nav__links a {
  color: var(--ivory-2);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 0.3s;
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--ivory);
}

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 1px;
  margin: 7px auto;
  background: var(--ivory);
  transition: transform 0.4s var(--ease);
}

.nav.is-open .nav__toggle span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav.is-open .nav__toggle span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

@media (max-width: 860px) {
  .nav__toggle {
    display: block;
  }

  .nav__cta {
    display: none;
  }

  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 12px var(--gutter) 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(11, 11, 12, 0.97);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
  }

  .nav.is-open .nav__links {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav__links a {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }
}

.fineprint {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Forms ---------- */

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 24px;
}

.form .full {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span,
.field legend {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.input,
.form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form select,
.form textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ivory);
  font-size: 16px;
  font-weight: 400;
  transition: border-color 0.3s;
}

.form select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 24px;
  background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 6px center / 6px 6px no-repeat,
    linear-gradient(-45deg, transparent 50%, var(--muted) 50%) right 0 center / 6px 6px no-repeat;
  background-size: 6px 6px, 6px 6px;
  background-position: calc(100% - 6px) 50%, 100% 50%;
}

.form select option {
  background: var(--ink-2);
  color: #f2eee6;
}

.form textarea {
  min-height: 96px;
  resize: vertical;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  border-bottom-color: var(--accent);
  outline: none;
}

.form input::placeholder,
.form textarea::placeholder {
  color: rgba(142, 137, 127, 0.7);
}

.form [aria-invalid="true"] {
  border-bottom-color: var(--bad) !important;
}

.form__status {
  min-height: 1.6em;
  margin: 0;
  color: var(--ivory-2);
  font-size: 14px;
}

.form__status.is-error,
.error {
  color: var(--bad);
}

.form__status.is-done {
  color: var(--good);
}

@media (max-width: 560px) {
  .form {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ---------- */

.footer {
  padding: 72px 0 48px;
}

.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
}

.footer__brand img {
  width: auto;
  height: 44px;
  margin-bottom: 18px;
}

.footer__brand p,
.footer__legal {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links a {
  color: var(--ivory-2);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--ivory);
}

.footer__legal {
  grid-column: 1 / -1;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .footer__inner {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--delay, 0s);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Tuning file service (/files) ---------- */

.portal {
  min-height: 80vh;
  padding: calc(var(--nav-h) + clamp(40px, 7vw, 88px)) 0 clamp(72px, 10vw, 120px);
  border-bottom: 1px solid var(--line);
  outline: none;
}

.portal__loading {
  color: var(--muted);
}

.portal__split {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 56px clamp(40px, 7vw, 104px);
  align-items: start;
}

@media (max-width: 900px) {
  .portal__split {
    grid-template-columns: 1fr;
  }

  .portal__split .auth {
    order: -1;
  }
}

.portal__head {
  margin-bottom: 44px;
}

.portal__head .lead {
  margin-top: 22px;
}

.price-list__title {
  margin: 36px 0 6px;
  color: var(--accent);
  font: 500 11px/1.4 var(--sans);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.price-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.price-list li {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.price-list li span {
  font: 600 21px/1.3 var(--sans);
}

.price-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font: 300 13px/1.5 var(--sans);
}

.price-list b {
  flex: none;
  color: var(--ivory-2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.card {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  background: var(--ink-2);
}

.card__title {
  margin: 0;
  font: 600 clamp(26px, 3vw, 34px)/1.15 var(--sans);
}

.auth .form {
  margin-top: 32px;
}

.auth .fineprint a,
.order__message a {
  color: var(--accent-bright);
}

.tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: none;
  margin-bottom: -1px;
  padding: 14px 0;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 0.3s, border-color 0.3s;
}

.tab:hover {
  color: var(--ivory);
}

.tab[aria-selected="true"],
.tab[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--ivory);
}

.tabs--wide {
  gap: clamp(20px, 4vw, 44px);
  margin-bottom: clamp(32px, 5vw, 56px);
}

.nav__account {
  display: flex;
  align-items: center;
}

.nav__credits {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  color: var(--ivory-2);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav__credits b {
  color: var(--accent-bright);
  font: 600 18px/1 var(--sans);
  letter-spacing: 0;
}

@media (max-width: 860px) {
  .nav__account {
    margin-left: auto;
  }

  .nav__toggle {
    margin-left: 0;
  }
}

.portal__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px 48px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.portal__hello {
  font-size: clamp(40px, 6vw, 72px);
}

.balance {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.balance__value {
  color: var(--accent-bright);
  font: 600 clamp(56px, 8vw, 96px)/0.9 var(--sans);
}

.balance__label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.portal__section + .portal__section {
  margin-top: clamp(56px, 8vw, 88px);
}

.portal__section > .fineprint {
  margin: 12px 0 0;
}

.section-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.empty {
  margin-top: 28px;
  padding: 40px clamp(20px, 4vw, 40px);
  border: 1px dashed var(--line-strong);
  color: var(--ivory-2);
}

.empty p {
  margin: 0 0 16px;
  font: 600 22px/1.4 var(--sans);
}

/* Orders and payments */

.orders,
.purchases {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.order,
.purchase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 32px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.purchase {
  grid-template-columns: 1fr;
}

.order__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.order__car {
  margin: 0 0 6px;
  font: 600 24px/1.25 var(--sans);
}

.order__detail {
  margin: 0;
  color: var(--ivory-2);
  font-size: 14px;
}

.order__message {
  margin: 12px 0 0;
  padding: 12px 16px;
  border-left: 1px solid var(--accent);
  background: rgba(255, 45, 38, 0.06);
  color: var(--ivory);
  font-size: 14px;
}

.order__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px 24px;
}

@media (max-width: 700px) {
  .order {
    grid-template-columns: 1fr;
  }

  .order__actions {
    justify-content: flex-start;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ivory-2);
  letter-spacing: 0.12em;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill--wait {
  color: var(--warn);
}

.pill--work {
  color: #a9c4e6;
}

.pill--done {
  color: var(--good);
}

.pill--stop {
  color: var(--muted);
}

.purchase__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px 24px;
}

.purchase__head .order__meta {
  flex-basis: 100%;
}

.purchase__what {
  margin: 0;
  color: var(--ivory-2);
}

.purchase__what b {
  color: var(--ivory);
  font-weight: 500;
}

.pay {
  display: grid;
  gap: 20px;
  margin-top: 6px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--ink-2);
}

.pay__steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--ivory-2);
}

.pay__steps b {
  color: var(--ivory);
  font-weight: 500;
}

.pay__form {
  display: grid;
  grid-template-columns: minmax(0, 340px) auto;
  gap: 16px 24px;
  align-items: end;
}

.pay__form .form__status {
  grid-column: 1 / -1;
}

.pay__form .btn {
  justify-self: start;
}

.pay__steps .link {
  margin-left: 14px;
}

.pay__form input {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  font-size: 16px;
}

.pay__form input:focus {
  border-bottom-color: var(--accent);
  outline: none;
}

@media (max-width: 560px) {
  .pay__form {
    grid-template-columns: 1fr;
  }
}

/* Credit packs */

.packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  margin-top: 28px;
  border: 1px solid var(--line);
  background: var(--line);
}

.pack {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--ink);
}

.pack p {
  margin: 0;
}

.pack__name {
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.pack__credits {
  margin-top: 18px !important;
  color: var(--ivory-2);
}

.pack__credits b {
  margin-right: 8px;
  color: var(--ivory);
  font: 600 64px/1 var(--sans);
}

.pack__price {
  margin-top: 18px !important;
  font: 600 26px/1.2 var(--sans);
}

.pack__each {
  color: var(--muted);
  font-size: 13px;
}

.pack__buy {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

/* New file form */

/* New file form: tuning file and vehicle side by side, then tuning and service, with a bar at the
   bottom showing the total and what's still missing. */
.order-form {
  display: grid;
  gap: 18px;
  margin-top: 8px;
}

.new-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 960px) {
  .new-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  min-width: 0;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--ink-2);
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font: 600 22px/1.2 var(--sans);
  letter-spacing: -0.02em;
}

.panel__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 45, 38, 0.14);
  color: var(--accent);
  font-size: 14px;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 12px;
  color: var(--ivory);
  font-size: 15px;
  font-weight: 600;
}

.group-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.group-row .group-title {
  flex: 1;
}

.options-toggle {
  margin-top: 10px;
  border-color: var(--accent-fill);
  color: var(--ivory);
}

.options-list {
  display: grid;
  gap: 12px;
}

.options-picked {
  margin: 0;
  color: var(--ivory-2);
  font-size: 14px;
}

.group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  /* Labels of different lengths still leave the boxes in line. */
  align-items: end;
}

.fields--1 {
  grid-template-columns: 1fr;
}

.fields--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.fields .full {
  grid-column: span 2;
}

@media (max-width: 760px) {
  .fields,
  .fields--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fields--3 .field:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .fields,
  .fields--3 {
    grid-template-columns: 1fr;
  }

  .fields .full {
    grid-column: auto;
  }
}

.order-form .field > span {
  color: var(--ivory);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
}

.order-form .field > span small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.field__hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.order-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.order-form select,
.order-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #000;
  color: var(--ivory);
  font-size: 16px;
  transition: border-color 0.2s;
}

.order-form select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2386868b' stroke-width='1.5'/%3E%3C/svg%3E") right 14px center / 10px 6px no-repeat;
}

.order-form select option {
  background: #0b0b0d;
}

.order-form textarea {
  min-height: 110px;
  resize: vertical;
}

.order-form input:focus,
.order-form select:focus,
.order-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.order-form input::placeholder,
.order-form textarea::placeholder {
  color: #5f5f66;
}

.file-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ivory-2);
  font-size: 14px;
}

.file-status__name {
  overflow: hidden;
  color: var(--good);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-status__size {
  flex: none;
  color: var(--muted);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.segmented__option {
  position: relative;
  cursor: pointer;
}

.segmented__option input {
  position: absolute;
  opacity: 0;
}

.segmented__option span {
  display: block;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--ivory-2);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}

.segmented__option input:checked + span {
  background: var(--accent-fill);
  color: var(--on-accent);
}

.segmented__option input:focus-visible + span {
  outline: 2px solid var(--accent-bright);
}

.vehicle-search {
  position: relative;
}

.vehicle-search input[type="search"] {
  padding-left: 38px !important;
  background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 13px center / 16px 16px no-repeat !important;
}

.vehicle-results {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.vehicle-result {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink-3);
  color: var(--ivory);
  text-align: left;
  cursor: pointer;
}

.vehicle-result:hover,
.vehicle-result:focus-visible {
  border-color: var(--accent);
}

.vehicle-result small,
.vehicle-results__none {
  color: var(--muted);
  font-size: 13px;
}

.vehicle-results__none {
  margin: 0;
}

.vehicle-chosen {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-left: 2px solid var(--good);
  background: rgba(48, 209, 88, 0.08);
  color: var(--ivory-2);
  font-size: 14px;
}

.vehicle-chosen b {
  color: var(--ivory);
}

.with-unit {
  position: relative;
  display: block;
}

.with-unit span {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  font-size: 14px;
  transform: translateY(-50%);
}

.extras {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.extras li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}

.extras li span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.extras small {
  color: var(--muted);
}

.confirm {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  color: var(--ivory);
  font-size: 15px;
  cursor: pointer;
}

.confirm input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent-fill);
}

.left {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 176, 32, 0.12);
}

.left.is-done {
  background: rgba(48, 209, 88, 0.1);
}

.left__title {
  color: var(--ivory);
  font-size: 14px;
  font-weight: 600;
}

.left__chip {
  flex: none;
  width: auto;
  padding: 4px 12px;
  border: 1px solid rgba(255, 176, 32, 0.6);
  border-radius: 980px;
  background: none;
  color: #ffd27a;
  font-size: 13px;
  cursor: pointer;
}

.left__chip:hover {
  background: rgba(255, 176, 32, 0.16);
}

@media (max-width: 700px) {
  .left__chip {
    display: none;
  }
}

.drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}

.drop:hover,
.drop.is-over,
.drop:focus-within {
  border-color: var(--accent);
  background: rgba(255, 45, 38, 0.05);
}

.drop.is-done {
  border-style: solid;
  border-color: rgba(143, 199, 154, 0.5);
}

.drop__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent-bright);
  font-size: 20px;
}

.drop.is-done .drop__icon {
  border-color: rgba(143, 199, 154, 0.5);
  color: var(--good);
}

.drop__text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.drop--tall {
  flex-direction: column;
  justify-content: center;
  min-height: 190px;
  text-align: center;
}

.drop--tall .drop__text b {
  white-space: normal;
}

.drop__text b {
  overflow: hidden;
  font: 600 21px/1.3 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop__text small {
  color: var(--muted);
  font-size: 13px;
}

.drop__progress {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
}

.drop__bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s linear;
}

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.choices__label {
  margin: 24px 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.choice {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
  border-radius: 12px;
}

.choice:hover {
  border-color: var(--line-strong);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: rgba(255, 45, 38, 0.06);
}

.choice input {
  width: 16px;
  height: 16px;
  margin: 4px 0 0;
  accent-color: var(--accent);
}

.choice__body {
  display: grid;
  gap: 4px;
}

.choice__name {
  font: 600 19px/1.3 var(--sans);
}

.choice__body small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.choice__cost {
  grid-column: 2;
  color: var(--accent-bright);
  font: 600 15px/1.2 var(--sans);
}

.summary {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  padding: 14px clamp(14px, 2vw, 20px);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(17, 17, 19, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* On a phone the total sits at the end of the form instead of covering it. */
@media (max-width: 700px) {
  .summary {
    position: static;
  }

  .summary .btn {
    width: 100%;
  }
}

.summary > div:first-child {
  display: grid;
  gap: 2px;
}

.summary__label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.summary__total {
  font: 600 30px/1.1 var(--sans);
}

.summary__after {
  color: var(--ivory-2);
  font-size: 13px;
}

/* Credit history */

.table-wrap {
  margin-top: 24px;
  overflow-x: auto;
}

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ledger th,
.ledger td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.ledger th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.ledger .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ledger .plus {
  color: var(--good);
}

.ledger .minus {
  color: var(--ivory-2);
}

/* Toasts */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--accent);
  background: #17171a;
  color: var(--ivory);
  font-size: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.5s var(--ease);
}

.toast--error {
  border-left-color: var(--bad);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
