/* ==========================================================================
   Bull Ride — driver onboarding (web)
   Mobile-first, app-like: one column, sticky header + progress, primary
   action pinned to the bottom of the screen. From 960px it becomes a
   two-panel layout with a dark brand aside listing the steps.
   Builds on the tokens and form primitives in bullride.css.
   ========================================================================== */

body.ob { background: var(--paper); min-height: 100vh; min-height: 100dvh; }

.ob-shell { min-height: 100vh; min-height: 100dvh; }
.ob-aside { display: none; }
.ob-panel { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* Header ----------------------------------------------------------------- */
.ob-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  height: 56px; padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.ob-top__logo img { height: 26px; width: auto; }
.ob-top__logo .br-logo__word { font-size: 1.05rem; }
.ob-top__count { margin: 0; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.ob-top__count strong { color: var(--ink); }

.ob-progress {
  position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 19;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 0 16px 10px; background: rgba(255,255,255,.94);
}
.ob-progress span { height: 4px; border-radius: 99px; background: var(--line); transition: background-color .3s var(--ease); }
.ob-progress .is-done { background: var(--ink); }
.ob-progress .is-current { background: var(--red); }

/* Content ---------------------------------------------------------------- */
.ob-main {
  flex: 1; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 20px 16px calc(112px + env(safe-area-inset-bottom));
}

.ob-head { margin-bottom: var(--s-6); }
.ob-head__ico {
  width: 48px; height: 48px; border-radius: var(--r-lg);
  display: grid; place-items: center; margin-bottom: var(--s-4);
  background: var(--red-wash); color: var(--red);
}
.ob-title {
  font-size: clamp(1.6rem, 6.4vw, 2.05rem); line-height: 1.08; font-weight: 700;
  letter-spacing: -.03em; margin: 0;
}
.ob-sub { margin: 10px 0 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.55; }
.ob-nowrap { white-space: nowrap; color: var(--ink); }

.ob-verified {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 var(--s-4);
  padding: 5px 10px; border-radius: var(--r-pill);
  background: #F1F8F2; color: #235C2E; font-size: var(--fs-xs); font-weight: 600;
}

.ob-back { margin: -6px 0 var(--s-4); }

/* Forms: bigger targets, 16px text so iOS doesn't zoom on focus ---------- */
.ob-form { gap: var(--s-5); }
.ob .br-form label { font-size: .875rem; }
.ob .br-input { font-size: 16px; min-height: 52px; padding: 13px 14px; border-radius: var(--r-md); }
.ob .br-err { font-size: .8125rem; }
.ob-hint { margin: 0; font-size: .8125rem; color: var(--muted); }
.ob-opt { margin-left: auto; font-weight: 500; color: var(--muted-2); font-size: .75rem; }
.ob-fine { margin: 0; font-size: .8125rem; color: var(--muted); }
.ob-plate { text-transform: uppercase; letter-spacing: .04em; }
.ob-plate::placeholder { text-transform: none; letter-spacing: 0; }

@media (max-width: 559px) {
  .ob .br-form__grid { grid-template-columns: 1fr; }
}

/* Phone: country code fused to the number */
.ob-phone {
  display: flex; min-height: 52px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: #fff;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.ob-phone:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(217,31,38,.13); }
.ob-phone.is-err { border-color: var(--red); background: var(--red-wash); }
.ob-phone input {
  border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink);
  padding: 0 14px; min-width: 0; outline: none;
}
.ob-phone__cc { width: 72px; flex: none; border-right: 1px solid var(--line) !important; font-weight: 600; }
.ob-phone__num { flex: 1; letter-spacing: .02em; }

.ob .ob-otp {
  font-size: 28px; font-weight: 700; letter-spacing: .5em; text-align: center;
  min-height: 64px; padding-left: .5em; font-variant-numeric: tabular-nums;
}

.ob-pass { position: relative; }
.ob-pass .br-input { padding-right: 72px; }
.ob-pass__toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; cursor: pointer; padding: 10px 12px;
  font-size: .8125rem; font-weight: 600; color: var(--muted);
}

/* Plain-language explainer under the number form */
.ob-info { margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }
.ob-info h2 { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.25; letter-spacing: -.02em; color: var(--ink); }
.ob-info h3 { margin: var(--s-5) 0 8px; font-size: .9375rem; color: var(--ink); }
.ob-info p { margin: 0; }
.ob-info ol, .ob-info ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.ob-info p:last-child { margin-top: var(--s-5); }

/* Text buttons */
.ob-textbtn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 10px 2px; cursor: pointer;
  font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--red);
}
.ob-textbtn:hover { color: var(--red-deep); }
.ob-textbtn[disabled] { color: var(--muted-2); cursor: default; }
.ob-textbtn--muted { color: var(--muted); font-weight: 500; }
.ob-row-actions { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-3); }
.ob-restart { margin-top: var(--s-6); text-align: center; }

/* Bottom action bar: pinned on phones, inline from 560px ---------------- */
.ob-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(16,17,18,.06);
}
.ob-cta__note { margin: 0 0 6px; text-align: center; font-size: .8125rem; color: var(--muted); }
.ob-cta--stack .ob-textbtn { justify-content: center; }
.ob-btn { width: 100%; min-height: 52px; font-size: 1rem; border-radius: var(--r-md); }
.ob-btn--sec { min-height: 48px; font-size: var(--fs-sm); }
.ob-btn.is-busy { opacity: .7; pointer-events: none; }

@media (min-width: 560px) {
  .ob-main { padding-bottom: var(--s-8); }
  .ob-cta {
    position: static; padding: 0; border: 0; box-shadow: none; background: none;
    margin-top: var(--s-3);
  }
}

/* Toasts ----------------------------------------------------------------- */
.ob-toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-md); margin-bottom: var(--s-5);
  font-size: var(--fs-sm); border: 1px solid;
}
.ob-toast svg { flex: none; margin-top: 2px; }
.ob-toast--ok  { background: #F1F8F2; border-color: #CBE5CF; color: #235C2E; }
.ob-toast--err { background: var(--red-wash); border-color: #F3C9CB; color: var(--red-ink); }

/* Vehicle type cards ----------------------------------------------------- */
.ob-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.ob-fieldset legend { font-size: .875rem; font-weight: 600; padding: 0; margin-bottom: 10px; }
.ob-choices { display: grid; gap: 10px; }
.ob-choice, .br-form label.ob-choice { position: relative; cursor: pointer; display: block; }
.br-form label.ob-choice svg { color: inherit; }
.ob-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ob-choice__card {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; min-height: 72px;
  border: 1.5px solid var(--line); border-radius: var(--r-lg); background: #fff;
  transition: border-color .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.ob-choice:hover .ob-choice__card { border-color: #CFCCC6; }
.ob-choice input:focus-visible + .ob-choice__card { box-shadow: 0 0 0 3px rgba(217,31,38,.2); }
.ob-choice input:checked + .ob-choice__card { border-color: var(--red); background: #FFF8F8; }
.ob-choice__img {
  width: 56px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-md); background: var(--paper-2); color: var(--ink); overflow: hidden;
}
.ob-choice__img img { width: 100%; height: 100%; object-fit: contain; }
.ob-choice__text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.ob-choice__name { font-weight: 700; letter-spacing: -.01em; }
.ob-choice__meta { font-size: .8125rem; color: var(--muted); }
.ob-choice__tick {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px solid var(--line); color: transparent;
  transition: all .18s var(--ease);
}
.ob-choice input:checked + .ob-choice__card .ob-choice__tick { background: var(--red); border-color: var(--red); color: #fff; }

/* Documents -------------------------------------------------------------- */
.ob-docs { display: grid; gap: 12px; }
.ob-doc {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff;
  padding: 14px; scroll-margin-top: 90px;
}
.ob-doc--ok   { border-color: #CBE5CF; }
.ob-doc--err  { border-color: #F3C9CB; }
.ob-doc__hd { display: flex; align-items: center; gap: 12px; }
.ob-doc__ico {
  width: 40px; height: 40px; flex: none; border-radius: var(--r-md);
  display: grid; place-items: center; background: var(--paper-2); color: var(--ink);
}
.ob-doc__title { flex: 1; min-width: 0; }
.ob-doc__title h2 { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.ob-doc__title p { margin: 1px 0 0; font-size: .8125rem; color: var(--muted); }
.ob-doc__view { display: inline-block; margin-top: 10px; font-size: var(--fs-sm); font-weight: 600; color: var(--red); }
.ob-doc__body { margin-top: 6px; }
.ob-doc__body > summary { list-style: none; }
.ob-doc__body > summary::-webkit-details-marker { display: none; }
.ob-doc__body[open] > summary { display: none; }
.ob-doc__form { gap: var(--s-4); margin-top: 8px; }

.ob-chip {
  flex: none; font-size: .75rem; font-weight: 600; padding: 4px 9px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.ob-chip--ok   { background: #F1F8F2; color: #235C2E; }
.ob-chip--wait { background: #FFF6E5; color: #7A4B00; }
.ob-chip--err  { background: var(--red-wash); color: var(--red-ink); }

.ob-drop, .br-form label.ob-drop {
  position: relative; display: block; cursor: pointer;
  border: 1.5px dashed #CFCCC6; border-radius: var(--r-lg); background: var(--paper-2);
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.ob-drop:hover, .ob-drop:focus-within { border-color: var(--red); background: #FFF8F8; }
.ob-drop.is-err { border-color: var(--red); background: var(--red-wash); }
.ob-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ob-drop__empty {
  display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: 22px 16px; color: var(--muted); font-size: .8125rem;
}
.ob-drop__empty svg { color: var(--red); margin-bottom: 4px; }
.ob-drop__empty strong { color: var(--ink); font-size: var(--fs-sm); }
.ob-drop__picked { display: flex; align-items: center; gap: 12px; padding: 12px; }
.ob-drop__picked[hidden], .ob-drop [hidden], .br-err[hidden] { display: none; }
.ob-drop__picked img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-md); flex: none; }
.ob-drop__name { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-drop__change { font-size: .8125rem; color: var(--red); font-weight: 600; flex: none; }

/* Done ------------------------------------------------------------------- */
.ob-done { text-align: center; padding-top: var(--s-5); margin-bottom: var(--s-7); }
.ob-done__badge {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto var(--s-5);
  display: grid; place-items: center; background: var(--red); color: #fff;
  box-shadow: 0 12px 32px rgba(217,31,38,.28);
  animation: ob-pop .5s var(--ease-out) both;
}
@keyframes ob-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.ob-done .ob-sub { max-width: 40ch; margin-inline: auto; }

.ob-next { list-style: none; margin: 0 0 var(--s-6); padding: 0; display: grid; gap: 4px; }
.ob-next li {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px;
  border-radius: var(--r-lg); background: var(--paper-2);
}
.ob-next__n {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: #fff;
  font-size: .8125rem; font-weight: 700;
}
.ob-next div { display: grid; gap: 2px; font-size: var(--fs-sm); }
.ob-next div span { color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }

/* Desktop: brand aside + form panel ------------------------------------- */
@media (min-width: 960px) {
  body.ob { background: var(--paper-2); }
  .ob-shell { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; }
  .ob-aside {
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    background: var(--ink); color: #fff; padding: 40px 44px;
  }
  .ob-aside__logo img { height: 30px; width: auto; }
  .ob-aside__logo .br-logo__word { color: #fff; }
  .ob-aside__eyebrow { margin: 56px 0 12px; color: var(--muted-dark); }
  .ob-aside__title { margin: 0; font-size: 2.3rem; line-height: 1.02; font-weight: 700; letter-spacing: -.035em; }
  .ob-aside__foot { margin: auto 0 0; padding-top: 24px; border-top: 1px solid var(--ink-3); font-size: .8125rem; color: var(--muted-dark); }
  .ob-aside__foot strong { color: #fff; }

  .ob-steps { list-style: none; margin: 44px 0 0; padding: 0; display: grid; gap: 4px; }
  .ob-steps__item { display: flex; gap: 14px; align-items: center; padding: 10px 0; color: var(--muted-dark); }
  .ob-steps__dot {
    width: 30px; height: 30px; flex: none; border-radius: 50%;
    display: grid; place-items: center; font-size: .8125rem; font-weight: 700;
    border: 1.5px solid var(--ink-3);
  }
  .ob-steps__name { display: block; font-weight: 600; color: inherit; }
  .ob-steps__sub { display: block; font-size: .8125rem; color: #6E747A; }
  .ob-steps__item.is-done { color: #fff; }
  .ob-steps__item.is-done .ob-steps__dot { background: #fff; color: var(--ink); border-color: #fff; }
  .ob-steps__item.is-current { color: #fff; }
  .ob-steps__item.is-current .ob-steps__dot { background: var(--red); border-color: var(--red); color: #fff; }

  .ob-panel { min-height: 100vh; }
  .ob-top { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0 40px; height: 72px; }
  .ob-top__logo { visibility: hidden; }
  .ob-progress { background: transparent; padding: 0 40px; position: static; }
  .ob-main {
    max-width: 600px; margin: 32px auto 64px; padding: 40px 44px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
    flex: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ob-done__badge { animation: none; }
}
