/*
 * DMN MyMove — design system
 * ----------------------------------------------------------------------------
 * Built on Bootstrap 5 (loaded from CDN in the layouts).
 *
 * Brand inputs sourced from www.dmnlogistics.co.uk and www.dmngroup.co.uk:
 *   primary red #cc0033   ink #191919   bg #f8f8f8   border #e1e1e1
 *   display: Archivo      body: Roboto
 *
 * This stylesheet covers three things:
 *   1. Brand tokens + Bootstrap variable overrides (color, font, radii).
 *   2. The responsive app shell:
 *        mobile/tablet  — top brand bar + content + sticky bottom tab bar
 *        desktop ≥992px — fixed left sidebar + scrolling content
 *   3. A small bridge layer that maps the legacy DMN mobile-template
 *      class names still used in the views (`card-style`, `bg-highlight`,
 *      `color-red-dark`, `font-700`, `input-style`, `btn-full` …) onto the
 *      Bootstrap + brand stack so we don't have to rewrite the markup.
 */

/* ============================================================
 * 1. Tokens
 * ============================================================ */
:root {
  /* Brand */
  --dmn-red:        #cc0033;
  --dmn-red-hover:  #dd1144;
  --dmn-red-active: #aa0011;
  --dmn-ink:        #191919;
  --dmn-ink-soft:   #313131;
  --dmn-muted:      #6c757d;
  --dmn-line:       #e1e1e1;
  --dmn-line-soft:  #eeeeee;
  --dmn-surface:    #ffffff;
  --dmn-app-bg:     #f8f8f8;

  /* Bootstrap 5 overrides via its own custom-property layer */
  --bs-primary:     #cc0033;
  --bs-primary-rgb: 204, 0, 51;
  --bs-link-color:  #cc0033;
  --bs-link-hover-color: #aa0011;
  --bs-body-color:  #191919;
  --bs-body-bg:     #f8f8f8;
  --bs-body-font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --bs-body-font-size: 0.975rem;
  --bs-body-line-height: 1.55;
  --bs-border-color: #e1e1e1;
  --bs-border-radius:    0.5rem;
  --bs-border-radius-sm: 0.35rem;
  --bs-border-radius-lg: 0.85rem;

  /* Layout */
  --dmn-sidebar-w:  264px;
  --dmn-topbar-h:   58px;
  --dmn-tabbar-h:   64px;
  --dmn-content-max: 760px;
}

/* ============================================================
 * 2. Base typography & body
 * ============================================================ */
html, body {
  background: var(--dmn-app-bg);
  color: var(--dmn-ink);
  font-family: var(--bs-body-font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: "Archivo", "Roboto", system-ui, sans-serif;
  font-weight: 700;
  color: var(--dmn-ink);
  letter-spacing: -0.01em;
}
h1, .h1 { font-size: clamp(1.6rem, 2.2vw + 0.8rem, 2.1rem); line-height: 1.2; }
h3, .h3 { font-size: 1.15rem; }
h5, .h5 { font-size: 1rem; }

/* Slim links inside content cards */
.dmn-content a:not(.btn):not(.nav-link) {
  color: var(--dmn-red);
  text-decoration: none;
  border-bottom: 1px solid rgba(204, 0, 51, 0.25);
  transition: color 120ms, border-color 120ms;
}
.dmn-content a:not(.btn):not(.nav-link):hover {
  color: var(--dmn-red-active);
  border-bottom-color: var(--dmn-red-active);
}

/* ============================================================
 * 3. App shell — mobile-first then desktop sidebar
 * ============================================================ */
.dmn-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.dmn-shell > .dmn-content { flex: 1 0 auto; }
.dmn-shell > .dmn-page-footer { flex-shrink: 0; }

/* --- Mobile/tablet top bar ----------------------------------- */
.dmn-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--dmn-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: var(--dmn-surface);
  border-bottom: 1px solid var(--dmn-line);
}
.dmn-topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  color: var(--dmn-ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.dmn-topbar .brand .brand-logo {
  height: 28px;
  width: auto;
  display: block;
}
.dmn-topbar .brand .brand-divider {
  width: 1px;
  height: 22px;
  background: var(--dmn-line);
  margin: 0 0.15rem;
}
.dmn-topbar .brand .brand-title {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dmn-ink);
  letter-spacing: 0.005em;
}
.dmn-topbar .brand .brand-sub {
  font-size: 0.7rem;
  color: var(--dmn-muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dmn-topbar .topbar-icon {
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  color: var(--dmn-ink);
  border-radius: 8px;
  text-decoration: none;
  transition: background 120ms;
}
.dmn-topbar .topbar-icon:hover { background: var(--dmn-line-soft); }

/* --- Content region ----------------------------------------- */
.dmn-content {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--dmn-content-max);
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem;
}
@media (min-width: 768px) {
  .dmn-content { padding: 1.5rem 1.5rem 2rem; }
}

/* --- Mobile bottom tab bar ---------------------------------- */
.dmn-tabbar {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--dmn-tabbar-h);
  background: var(--dmn-surface);
  border-top: 1px solid var(--dmn-line);
  display: flex;
  z-index: 1030;
}
.dmn-tabbar > a, .dmn-tabbar > button { flex: 1 1 0; min-width: 0; }
.dmn-tabbar > a span, .dmn-tabbar > button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dmn-tabbar a, .dmn-tabbar button {
  appearance: none;
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--dmn-muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.25rem;
  transition: color 120ms;
}
.dmn-tabbar i { font-size: 1.05rem; }
.dmn-tabbar a:hover, .dmn-tabbar button:hover { color: var(--dmn-ink); }
.dmn-tabbar a.is-active {
  color: var(--dmn-red);
}
.dmn-tabbar a.is-active::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  height: 2px; width: 32px;
  background: var(--dmn-red);
  border-radius: 0 0 2px 2px;
}
.dmn-tabbar a { position: relative; }

/* --- Desktop sidebar (≥992px) ------------------------------- */
.dmn-sidebar { display: none; }

@media (min-width: 992px) {
  /* Sidebar room is given to the logged-in shell ONLY, not the body —
     so public layouts (auth, public_id) span the full viewport. */
  .dmn-shell {
    padding-left: var(--dmn-sidebar-w);
  }
  .dmn-topbar  { display: none; }
  .dmn-tabbar  { display: none; }

  .dmn-content {
    padding: 2.25rem 2.5rem 3rem;
  }

  .dmn-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--dmn-sidebar-w);
    background: var(--dmn-ink);
    color: rgba(255, 255, 255, 0.85);
    padding: 1.5rem 1rem 1.25rem;
    z-index: 1040;
  }
  .dmn-sidebar .side-brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.5rem 0.5rem 1.75rem;
    color: #fff;
    text-decoration: none;
  }
  .dmn-sidebar .side-brand .brand-img {
    display: block;
    width: 100%;
    max-width: 180px;
    height: auto;
    margin: 0 auto;
  }
  .dmn-sidebar .side-brand .brand-sub {
    display: block;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    text-align: center;
    margin-top: 0.4rem;
  }

  .dmn-sidebar .side-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
  }
  .dmn-sidebar .side-nav a, .dmn-sidebar .side-nav button {
    appearance: none;
    background: transparent;
    border: 0;
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 120ms, color 120ms;
  }
  .dmn-sidebar .side-nav a i, .dmn-sidebar .side-nav button i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.9;
  }
  .dmn-sidebar .side-nav a:hover,
  .dmn-sidebar .side-nav button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
  }
  .dmn-sidebar .side-nav a.is-active {
    background: var(--dmn-red);
    color: #fff;
    box-shadow: 0 2px 12px rgba(204, 0, 51, 0.35);
  }
  .dmn-sidebar .side-nav a.is-active i { opacity: 1; }

  .dmn-sidebar .side-spacer { flex: 1 1 auto; }

  .dmn-sidebar .side-ticket {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0.85rem 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
  }
  .dmn-sidebar .side-ticket .ticket-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.35rem;
  }
  .dmn-sidebar .side-ticket .ticket-value {
    color: #fff;
    font-family: "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
  }
  .dmn-sidebar .side-foot {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.85rem;
    line-height: 1.5;
  }
  .dmn-sidebar .side-foot a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
  }
  .dmn-sidebar .side-foot a:hover { color: #fff; }
}

/* ============================================================
 * 4. Cards (legacy DMN `.card.card-style` mapped to brand)
 * ============================================================ */
.card.card-style {
  background: var(--dmn-surface);
  border: 1px solid var(--dmn-line);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  margin: 0 0 1rem;
  overflow: hidden;
}
.card.card-style > .content {
  padding: 1.25rem 1.25rem;
}
@media (min-width: 768px) {
  .card.card-style > .content { padding: 1.5rem 1.75rem; }
}

/* Cards used as headers (image background with overlay caption) */
.card.card-style[data-card-height] {
  position: relative;
  min-height: 240px;
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  align-items: flex-end;
}
@media (min-width: 768px) {
  .card.card-style[data-card-height] { min-height: 320px; }
}
.card.card-style .card-bottom {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 1.5rem 1.5rem;
}
.card.card-style .card-overlay {
  position: absolute; inset: 0; z-index: 1;
}
.card-overlay.bg-black { background: #000; }
.card-overlay.bg-gradient {
  background: linear-gradient(180deg, transparent 0%, transparent 30%, rgba(0,0,0,0.7) 100%);
}
.opacity-40 { opacity: 0.4 !important; }
.opacity-80 { opacity: 0.8 !important; }

/* ============================================================
 * 5. Buttons (extend Bootstrap + cover legacy DMN classes)
 * ============================================================ */
.btn {
  --bs-btn-padding-y: 0.7rem;
  --bs-btn-padding-x: 1.25rem;
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 8px;
  letter-spacing: 0.02em;
  transition: background 140ms, border-color 140ms, transform 80ms, box-shadow 140ms;
}
.btn:active { transform: translateY(1px); }

.btn-primary,
.btn.bg-highlight,
.btn.bg-red-dark {
  background: var(--dmn-red);
  border-color: var(--dmn-red);
  color: #fff;
}
.btn-primary:hover,
.btn.bg-highlight:hover,
.btn.bg-red-dark:hover {
  background: var(--dmn-red-hover);
  border-color: var(--dmn-red-hover);
  color: #fff;
}
.btn-primary:active,
.btn.bg-highlight:active,
.btn.bg-red-dark:active {
  background: var(--dmn-red-active);
  border-color: var(--dmn-red-active);
}

/* Full-width / block buttons */
.btn-block, .btn-full, .btn.w-100 { width: 100%; display: block; }

/* Outline buttons used by the TBC question Yes/No radios */
.btn-outline-success {
  --bs-btn-color: #198754;
  --bs-btn-border-color: #198754;
  --bs-btn-hover-bg: #198754;
  --bs-btn-hover-border-color: #198754;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #146c43;
  --bs-btn-active-border-color: #146c43;
  --bs-btn-active-color: #fff;
}
.btn-outline-danger {
  --bs-btn-color: #cc0033;
  --bs-btn-border-color: #cc0033;
  --bs-btn-hover-bg: #cc0033;
  --bs-btn-hover-border-color: #cc0033;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #aa0011;
  --bs-btn-active-border-color: #aa0011;
  --bs-btn-active-color: #fff;
}

/* Radio toggle pattern (already shipped by Bootstrap, but ensure the
   `btn-check + label.btn` from the DMN markup reads cleanly) */
.btn-check:checked + .btn-outline-success {
  background: #198754; border-color: #198754; color: #fff;
}
.btn-check:checked + .btn-outline-danger {
  background: var(--dmn-red); border-color: var(--dmn-red); color: #fff;
}

/* Submit/success button used at bottom of TBC form */
.btn.bg-success { background: #198754 !important; border-color: #198754 !important; color: #fff !important; }
.btn.bg-success:hover { background: #146c43 !important; border-color: #146c43 !important; }

/* Legacy DMN size classes -> map onto Bootstrap sizes */
.btn-m { /* default size — handled above */ }
.btn.rounded-xl { border-radius: 14px; }
.btn.rounded-sm { border-radius: 6px; }
.btn.shadow-xl  { box-shadow: 0 8px 24px rgba(204, 0, 51, 0.18); }
.btn.shadow-l   { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }

/* ============================================================
 * 6. Form inputs (replace `.input-style.has-borders`)
 * ============================================================ */
.input-style {
  position: relative;
  display: flex;
  flex-direction: column;   /* label sits above the field */
}
.input-style > label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dmn-muted);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.input-style.has-borders .form-control,
.input-style.has-borders input:not([type="radio"]):not([type="checkbox"]),
.input-style.has-borders textarea,
.input-style.has-borders select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--dmn-line);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  color: var(--dmn-ink);
  transition: border-color 120ms, box-shadow 120ms;
}
.input-style.has-borders .form-control:focus,
.input-style.has-borders input:focus,
.input-style.has-borders textarea:focus,
.input-style.has-borders select:focus {
  outline: 0;
  border-color: var(--dmn-red);
  box-shadow: 0 0 0 3px rgba(204, 0, 51, 0.15);
}
.input-style .form-control::placeholder { color: #adb5bd; }

/* Decorative validation icons that the legacy markup ships with —
   keep them invisible by default so they don't litter the layout. */
.input-style i.disabled { display: none; }

/* Hide the native number-input spinners — type=number is used so mobile
   gets a numeric keypad, but the up/down arrows just clutter the field. */
input[type="number"].form-control,
.input-style.has-borders input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

/* ============================================================
 * 7. Tables (used on the dashboard "Job Information" card)
 * ============================================================ */
.card.card-style table.table {
  margin: 0;
}
.card.card-style table.table th,
.card.card-style table.table td {
  border: 0;
  padding: 0.65rem 0;
  vertical-align: top;
  font-size: 0.95rem;
}
.card.card-style table.table tr + tr th,
.card.card-style table.table tr + tr td {
  border-top: 1px solid var(--dmn-line-soft);
}
.card.card-style table.table th {
  width: 50%;
  color: var(--dmn-muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.card.card-style table.table td {
  color: var(--dmn-ink);
  font-weight: 600;
}

/* ============================================================
 * 8. Page footer (rendered once, sits at the bottom of the shell)
 * ============================================================ */
.dmn-page-footer {
  margin-top: auto;
  padding: 2rem 1.25rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--dmn-line-soft);
  background: var(--dmn-app-bg);
}
.dmn-page-footer .footer-title {
  display: inline-block;
  margin-bottom: 1rem;
  opacity: 0.85;
  transition: opacity 120ms;
}
.dmn-page-footer .footer-title:hover { opacity: 1; }
.dmn-page-footer .footer-title img {
  width: 120px;
  height: auto;
  display: block;
}
.dmn-page-footer .footer-icons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.dmn-page-footer .footer-icons .icon {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--dmn-ink);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 120ms, transform 120ms;
}
.dmn-page-footer .footer-icons .icon:hover {
  background: var(--dmn-red);
  transform: translateY(-1px);
}
.dmn-page-footer .footer-copyright {
  font-size: 0.78rem;
  color: var(--dmn-muted);
  margin: 0 0 0.35rem;
  line-height: 1.5;
}
.dmn-page-footer .footer-links {
  font-size: 0.78rem;
  color: var(--dmn-muted);
  margin: 0;
}
.dmn-page-footer .footer-links a {
  color: var(--dmn-ink-soft);
  text-decoration: none;
  border: 0;
}
.dmn-page-footer .footer-links a:hover { color: var(--dmn-red); }
.dmn-page-footer .footer-links .sep {
  margin: 0 0.5rem;
  color: var(--dmn-line);
}

/* Ensure mobile bottom tabbar doesn't sit on top of the page footer */
@media (max-width: 991.98px) {
  .dmn-page-footer { padding-bottom: calc(var(--dmn-tabbar-h) + 1.25rem); }
}

/* ============================================================
 * 9. Legacy DMN utility classes used in the views
 *    (color-*, font-*, text-uppercase already covered by BS5,
 *     divider, etc.)
 * ============================================================ */
.color-white       { color: #fff !important; }
.color-red-dark    { color: var(--dmn-red) !important; }
.color-highlight   { color: var(--dmn-red) !important; }
.color-orange-light{ color: #f29449 !important; }
.color-green-dark  { color: #198754 !important; }
.color-blue-light  { color: #4dabf7 !important; }
.color-yellow-dark { color: #b88500 !important; }

.font-12 { font-size: 0.75rem !important; }
.font-32 { font-size: 2rem !important; }
.font-600 { font-weight: 600 !important; }
.font-700 { font-weight: 700 !important; }
.font-800 { font-weight: 800 !important; }

.divider {
  height: 1px;
  background: var(--dmn-line);
  border: 0;
  display: block;
}

/* Legacy negative margin shorthands the views use */
.mt-n1 { margin-top: -0.25rem !important; }
.mt-n2 { margin-top: -0.5rem !important; }
.mt-n3 { margin-top: -0.75rem !important; }

/* Tiny preloader spinner that the old layout includes. We can hide it —
   pages render immediately in Rails. */
#preloader { display: none !important; }

/* ============================================================
 * 9b. Bootstrap 4 → 5 shims used in views
 * ============================================================ */
.badge-primary { background: var(--dmn-red); color: #fff; }
.badge-pill    { border-radius: 999px; padding: 0.4em 0.75em; }
.list-group-item {
  border-color: var(--dmn-line-soft);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
}

/* ============================================================
 * 10. Login (auth) layout polish
 * ============================================================ */
.dmn-auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--dmn-app-bg);
}
.dmn-auth .auth-shell {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  flex: 1 0 auto;
}
@media (min-width: 992px) {
  .dmn-auth .auth-shell {
    grid-template-columns: 1.05fr 1fr;
    align-items: stretch;
    padding: 2.5rem;
    gap: 2.5rem;
  }
}
.dmn-auth .auth-hero {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  background:
    linear-gradient(160deg, rgba(25,25,25,0.65) 0%, rgba(204,0,51,0.55) 100%),
    url('https://static.dmnlogistics.co.uk/images/drivers-login-bg.png') center / cover no-repeat,
    var(--dmn-ink);
  color: #fff;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.dmn-auth .auth-hero .hero-body {
  display: flex;
  flex-direction: column;
}
@media (min-width: 992px) {
  .dmn-auth .auth-hero {
    border-radius: 14px;
    padding: 3rem;
    min-height: 480px;
  }
}
.dmn-auth .auth-hero .hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}
.dmn-auth .auth-hero h1 {
  color: #fff;
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.6rem);
  line-height: 1.05;
  margin: 0 0 0.75rem;
  max-width: 18ch;
}
.dmn-auth .auth-hero p {
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0.9;
  margin: 0;
  max-width: 38ch;
}

.dmn-auth .auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2.5rem;
}
@media (min-width: 992px) {
  .dmn-auth .auth-form-wrap { padding: 0; }
}
.dmn-auth .auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--dmn-surface);
  border: 1px solid var(--dmn-line);
  border-radius: 14px;
  padding: 1.75rem;
}
@media (min-width: 992px) {
  .dmn-auth .auth-card { padding: 2.25rem; }
}
.dmn-auth .auth-card .card-logo {
  display: flex;
  justify-content: center;
  margin: 0 0 1.5rem;
  padding: 0.5rem 25% 1.5rem;
  border-bottom: 1px solid var(--dmn-line-soft);
}
.dmn-auth .auth-card .card-logo img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 56px;
  object-fit: contain;
}

.dmn-auth .auth-card h3 {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
}
.dmn-auth .auth-card p.lead {
  color: var(--dmn-muted);
  font-size: 0.92rem;
  margin: 0 0 1.5rem;
}
.dmn-auth .auth-foot {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--dmn-muted);
  text-align: center;
}

.dmn-auth .auth-verify-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--dmn-line);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--dmn-ink-soft);
}
.dmn-auth .auth-verify-link i { color: var(--dmn-red); }
.dmn-auth .auth-verify-link a {
  color: var(--dmn-red);
  font-weight: 600;
  text-decoration: none;
}
.dmn-auth .auth-verify-link a:hover { text-decoration: underline; }

.dmn-auth .auth-card-footer {
  margin: 1.5rem -1.75rem -1.75rem;
  padding: 1rem 1.5rem;
  background: var(--dmn-app-bg);
  border-top: 1px solid var(--dmn-line-soft);
  font-size: 0.74rem;
  color: var(--dmn-muted);
  text-align: center;
  border-radius: 0 0 14px 14px;
}
@media (min-width: 992px) {
  .dmn-auth .auth-card-footer { margin: 1.75rem -2.25rem -2.25rem; padding: 1rem 2rem; }
}
.dmn-auth .auth-card-footer a {
  color: var(--dmn-ink-soft);
  text-decoration: none;
}
.dmn-auth .auth-card-footer a:hover { color: var(--dmn-red); }
.dmn-auth .auth-card-footer .sep { margin: 0 0.5rem; color: var(--dmn-line); }

/* ============================================================
 * 10b. Driver ID page
 * ============================================================ */
.your-driver-page .driver-card__body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.your-driver-page .driver-card__photo {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--dmn-line-soft);
  position: relative;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.your-driver-page .driver-card__photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.your-driver-page .driver-card__photo-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--dmn-muted);
  font-size: 2rem;
}
@media (min-width: 768px) {
  .your-driver-page .driver-card__photo {
    width: 128px; height: 128px; flex-basis: 128px;
  }
}
.your-driver-page .driver-card__name {
  font-family: "Archivo", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--dmn-ink);
  margin-bottom: 0.25rem;
}
.your-driver-page .driver-card__code {
  font-size: 0.85rem;
  color: var(--dmn-muted);
}
.your-driver-page .driver-card__code .mono {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-weight: 600;
  color: var(--dmn-ink-soft);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  background: var(--dmn-line-soft);
}

.your-driver-page .driver-card__empty {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--dmn-line-soft);
  border: 1px dashed var(--dmn-line);
  border-radius: 12px;
}
.your-driver-page .driver-card__empty i {
  font-size: 1.75rem;
  color: var(--dmn-muted);
  margin-top: 0.15rem;
}
.your-driver-page .driver-card__empty strong { display: block; margin-bottom: 0.2rem; color: var(--dmn-ink); }
.your-driver-page .driver-card__empty p { color: var(--dmn-muted); font-size: 0.92rem; }

.your-driver-page .explainer-head .explainer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--dmn-ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
}
.your-driver-page .explainer-head .explainer-pill i { color: var(--dmn-red); }
.your-driver-page .explainer-head h3 {
  font-family: "Archivo", sans-serif;
  font-size: 1.35rem;
  line-height: 1.2;
}

.your-driver-page .how-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.your-driver-page .how-list li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.your-driver-page .how-list .how-num {
  flex: 0 0 32px;
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  background: var(--dmn-red);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  font-family: "Archivo", sans-serif;
  font-size: 0.95rem;
}
.your-driver-page .how-list li > div { padding-top: 0.2rem; font-size: 0.95rem; }
.your-driver-page .how-list strong { display: block; margin-bottom: 0.15rem; }

.your-driver-page .callout {
  border: 0;
}
.your-driver-page .callout > .content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.your-driver-page .callout__icon {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(204, 0, 51, 0.10);
  color: var(--dmn-red);
  font-size: 1.2rem;
}
.your-driver-page .callout--warn {
  background: #fff7f8;
  border: 1px solid #f5d3da;
}
.your-driver-page .callout h3 {
  font-family: "Archivo", sans-serif;
  font-size: 1.1rem;
}

.your-driver-page .faq {
  border-top: 1px solid var(--dmn-line-soft);
}
.your-driver-page .faq:first-of-type { border-top: 0; }
.your-driver-page .faq__q {
  appearance: none;
  background: transparent;
  border: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  text-align: left;
  padding: 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--dmn-ink);
  cursor: pointer;
}
.your-driver-page .faq__q i {
  color: var(--dmn-muted);
  transition: transform 180ms;
  font-size: 0.85rem;
}
.your-driver-page .faq__q[aria-expanded="true"] i { transform: rotate(180deg); }
.your-driver-page .faq__a p {
  margin: 0 0 1rem;
  color: var(--dmn-ink-soft);
  font-size: 0.94rem;
}

/* ============================================================
 * 11. Small inline-error chip used on the login form
 * ============================================================ */
.input-style em.color-red-dark {
  display: block;
  margin-top: 0.35rem;
  font-style: normal;
  font-size: 0.78rem;
  color: var(--dmn-red);
}

/* Bootstrap drops a small visual gap; let the cards breathe on mobile */
@media (max-width: 575.98px) {
  .card.card-style > .content { padding: 1rem 1rem; }
  h1, .h1 { font-size: 1.4rem; }
}

/* ============================================================
 * 12. Digital Driver ID — public layout + ID card + verify form
 *
 * Used by /verify-driver, /driver-id/:code and /mivis-driver-id/:code.
 * All three render under the `public_id` layout. No login, no nav.
 * ============================================================ */

.dmn-publicid {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--dmn-app-bg);
}
.dmn-publicid .publicid-bar {
  background: var(--dmn-ink);
  color: #fff;
  border-bottom: 3px solid var(--dmn-red);
}
.dmn-publicid .publicid-bar__inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.dmn-publicid .publicid-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.dmn-publicid .publicid-bar__logo {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.dmn-publicid .publicid-bar__sub {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  border-left: 1px solid rgba(255,255,255,0.18);
  padding-left: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dmn-publicid .publicid-bar__nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 120ms, border-color 120ms;
}
.dmn-publicid .publicid-bar__nav a:hover {
  background: var(--dmn-red);
  border-color: var(--dmn-red);
}
.dmn-publicid .publicid-bar__nav a i { font-size: 0.78rem; }
@media (max-width: 480px) {
  .dmn-publicid .publicid-bar__sub { display: none; }
  .dmn-publicid .publicid-bar__nav a span { display: none; }
  .dmn-publicid .publicid-bar__nav a { padding: 0.55rem 0.7rem; }
}
.dmn-publicid .publicid-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}
@media (min-width: 768px) {
  .dmn-publicid .publicid-main { padding: 2.25rem 1.5rem 2.5rem; }
}

/* ---- ID card -------------------------------------------------- */
.id-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--dmn-line);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 1.25rem;
  position: relative;
}
.id-card__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  background: var(--dmn-ink);
  color: #fff;
  border-bottom: 3px solid var(--dmn-red);
}
.id-card__head-logo {
  height: 26px;
  width: auto;
  display: block;
}
.id-card__head-divider {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.2);
}
.id-card__head-title {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  flex: 1 1 auto;
}

.id-card__photo {
  position: relative;
  background: #1d1d1d;
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
}
.id-card__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.id-card__photo-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.4);
  font-size: 4rem;
}

/* Large DMN logo watermarked across the centre of the photo. Recoloured
   to the same faded white as the date text so the two watermarks read as
   one cohesive treatment. brightness(0)+invert(1) turns the dark-on-trans
   PNG into white-on-trans for any input colour.
   Selector specificity beats the `.id-card__photo img` rule above so the
   watermark logo isn't stretched + cropped like the driver headshot. */
.id-card__photo img.id-card__logo-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  width: 60%;
  max-width: 240px;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: brightness(0) invert(1);
  opacity: 0.42;
  mix-blend-mode: screen;
}

/* Diagonal repeating watermark across the photo. Today's date is composited
   server-side into an SVG pattern so a stale screenshot is immediately
   obvious — yesterday's watermark text gives the screenshot away. */
.id-card__watermark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.id-card__meta {
  padding: 1.1rem 1.25rem 0.5rem;
}
.id-card__name {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--dmn-ink);
  margin-bottom: 0.25rem;
}
.id-card__code {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--dmn-muted);
  font-size: 0.85rem;
}
.id-card__code .label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
}
.id-card__code .mono {
  font-family: "Roboto Mono", monospace;
  font-weight: 600;
  color: var(--dmn-ink-soft);
  background: var(--dmn-line-soft);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.id-card__validity {
  padding: 0.75rem 1.25rem 1.1rem;
}
.id-card__validity .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.id-card.is-valid .id-card__validity .badge {
  background: #e7f6ec;
  color: #146c43;
  border: 1px solid #b3e0c2;
}
.id-card.is-valid .id-card__validity .badge i { color: #198754; }
.id-card.is-invalid .id-card__validity .badge {
  background: #fdecee;
  color: #8b0a20;
  border: 1px solid #f3c5cd;
}
.id-card.is-invalid .id-card__validity .badge i { color: var(--dmn-red); }

.id-card__missing {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--dmn-muted);
}
.id-card__missing i {
  display: block;
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--dmn-line);
}

.id-card__foot {
  padding: 0.9rem 1.25rem;
  background: var(--dmn-app-bg);
  border-top: 1px solid var(--dmn-line-soft);
  font-size: 0.78rem;
  color: var(--dmn-muted);
  line-height: 1.45;
  text-align: center;
}

/* ---- MiVis driver-app variant ------------------------------- */
.id-card--mivis {
  border-radius: 22px;
  margin: 0 auto;
}
.id-card--mivis .id-card__photo {
  aspect-ratio: 4 / 5;
}
.id-card--mivis .id-card__name { font-size: 1.7rem; }
.id-card__qr {
  padding: 0.75rem 1.25rem 1.25rem;
  text-align: center;
  border-top: 1px solid var(--dmn-line-soft);
}
.id-card__qr svg {
  width: 180px; height: 180px;
  display: block;
  margin: 0 auto 0.5rem;
}
.id-card__qr-caption {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dmn-muted);
}

/* MiVis page strips the bar/footer since it lives inside the driver app
   webview — but we still load the layout, so just hide them when the page
   carries the --mivis modifier. */
.publicid-page--mivis ~ .dmn-page-footer,
body:has(.publicid-page--mivis) .publicid-bar,
body:has(.publicid-page--mivis) .dmn-page-footer { display: none; }
body:has(.publicid-page--mivis) .publicid-main { padding: 1rem; max-width: 420px; }

/* ---- Reg-confirmed banner shown when arriving from /verify-driver --- */
.reg-confirmed {
  background: #fff;
  border: 1px solid var(--dmn-line);
  border-top: 3px solid #198754;
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.4rem;
  margin-bottom: 1rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}
.reg-confirmed__head {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--dmn-ink);
  margin-bottom: 0.85rem;
}
.reg-confirmed__head i { color: #198754; font-size: 1.1rem; }
.reg-confirmed__foot {
  font-size: 0.9rem;
  color: var(--dmn-ink-soft);
  margin-top: 0.8rem;
}
.reg-confirmed__foot strong { color: var(--dmn-ink); white-space: nowrap; }

/* UK-style number plate. The Charles Wright typeface isn't free so we
   approximate with Archivo Black at high tracking — close enough to read
   as a plate at a glance. */
.numberplate {
  display: inline-block;
  background: #fbe10b;          /* rear plate yellow */
  color: #111;
  border: 2px solid #111;
  border-radius: 7px;
  padding: 0.35rem 1rem;
  box-shadow: inset 0 0 0 2px #fbe10b,
              inset 0 -3px 0 rgba(0,0,0,0.18),
              0 2px 6px rgba(0,0,0,0.15);
}
.numberplate--front { background: #fff; }
.numberplate .plate-text {
  font-family: "Archivo Black", "Archivo", "Roboto", sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 6vw + 0.5rem, 2.4rem);
  letter-spacing: 0.06em;
  line-height: 1;
  display: inline-block;
}
@media (min-width: 768px) {
  .numberplate { padding: 0.4rem 1.15rem; }
}

/* ---- Public page actions / help block ----------------------- */
.publicid-actions {
  text-align: center;
  margin: 0.75rem 0 1.25rem;
}
.publicid-actions .btn {
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  border-radius: 999px;
}
.publicid-help {
  background: #fff;
  border: 1px solid var(--dmn-line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  font-size: 0.88rem;
  color: var(--dmn-ink-soft);
  line-height: 1.55;
}
.publicid-help strong { color: var(--dmn-red); display: block; margin-bottom: 0.2rem; }

/* ---- Verify-driver page ------------------------------------- */
.verify-driver-page .verify-driver-card {
  background: #fff;
  border: 1px solid var(--dmn-line);
  border-radius: 16px;
  padding: 1.75rem;
}
@media (min-width: 768px) {
  .verify-driver-page .verify-driver-card { padding: 2.25rem; }
}
.verify-driver-page h1 {
  font-family: "Archivo", sans-serif;
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}
.verify-driver-page .lead {
  font-size: 0.95rem;
  color: var(--dmn-ink-soft);
  margin-bottom: 1.5rem;
}
.verify-driver-page .verify-driver-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--dmn-muted);
  margin-bottom: 0.5rem;
}
.verify-driver-page .verify-driver-input {
  width: 100%;
  background: #fffbe8;
  border: 2px solid var(--dmn-ink);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  font-family: "Roboto Mono", monospace;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dmn-ink);
  transition: border-color 120ms, box-shadow 120ms;
}
.verify-driver-page .verify-driver-input:focus {
  outline: 0;
  border-color: var(--dmn-red);
  box-shadow: 0 0 0 3px rgba(204,0,51,0.15);
}
.verify-driver-page .verify-driver-input::placeholder {
  color: rgba(25,25,25,0.25);
}
.verify-driver-page .verify-driver-error {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: #fdecee;
  color: #8b0a20;
  border: 1px solid #f3c5cd;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.verify-driver-page .verify-driver-error i { color: var(--dmn-red); margin-top: 2px; }
.verify-driver-page .verify-driver-foot {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--dmn-line-soft);
  font-size: 0.85rem;
  color: var(--dmn-muted);
}
.verify-driver-page .verify-driver-foot p { margin-bottom: 0.5rem; }
.verify-driver-page .verify-driver-foot strong { color: var(--dmn-ink); }
