/* Accounts and dashboards: customer account, driver dashboard, receipt and the header account link.
   Built on the concept 16 tokens (--navy, --blue, --cloud, --line ...) and components (.btn, .wrap,
   .uotc-f fields) from concept16.css and blocks.css. Logical properties throughout, so the same rules
   serve /ar/ pages. Regions use :where() so a theme rule of ordinary specificity wins. */

:where(.uotc-acc) { font-family: var(--font); color: var(--text); }
:where(.uotc-acc) *, :where(.uotc-acc) *::before, :where(.uotc-acc) *::after { box-sizing: border-box; }
:where(.uotc-acc) :where(h1, h2, h3, p, ul, ol, dl, dd, figure) { margin: 0; }
:where(.uotc-acc) :where(ul, ol) { list-style: none; padding: 0; }
:where(.uotc-acc) :where(button, input, select, textarea) { font: inherit; }
.uotc-acc.alignfull { margin-block: 0; }
/* The theme gives lists and definition lists margins of ordinary specificity; the module's own lists
   are components, so they are reset by class. */
.uotc-acc-journeys, .uotc-acc-jobs, .uotc-acc-counts ul, .uotc-acc-timeline, .uotc-acc-steplist, .uotc-acc-rows, .uotc-rcpt-detail, .uotc-rcpt-meta dl { margin: 0; padding: 0; list-style: none; }
.uotc-acc-rows dt, .uotc-acc-rows dd, .uotc-rcpt-detail dt, .uotc-rcpt-detail dd, .uotc-rcpt-meta dt, .uotc-rcpt-meta dd { margin: 0; }

/* Band: the navy header with the title and the tabs. */
.uotc-acc-band { background: var(--navy); color: var(--white); padding: var(--space-6) 0 0; }
.uotc-acc-band .wrap { display: grid; gap: var(--space-2); }
.uotc-acc-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--on-navy); }
.uotc-acc-title { font-size: clamp(26px, 1.6vw + 18px, 38px); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; color: var(--white); overflow-wrap: anywhere; }
.uotc-acc-lede { max-width: 68ch; font-size: 16px; color: var(--on-navy); }
.uotc-acc-band .wrap > :last-child:not(.uotc-acc-tabs) { margin-bottom: var(--space-6); }

.uotc-acc-tabs { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--space-1); margin-top: var(--space-4); }
.uotc-acc-tab {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--space-4);
  background: transparent; color: var(--white); border: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.uotc-acc-tab:hover { background: rgb(255 255 255 / 0.1); }
.uotc-acc-tab[aria-current="page"] { background: var(--cloud); color: var(--navy); }
.uotc-acc-tab:focus-visible { outline: 2px solid var(--white); outline-offset: -4px; }
.uotc-acc-signout { margin-inline-start: auto; display: flex; }
.uotc-acc-signout .uotc-acc-tab { color: var(--on-navy); font-weight: 500; }

/* Body. */
.uotc-acc-body { background: var(--cloud); padding: var(--space-6) 0 var(--space-8); }
.uotc-acc-body .wrap { display: grid; gap: var(--space-5); }
.uotc-acc-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); min-width: 0; }
.uotc-acc-card h2 { font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1.25; }
.uotc-acc-card h3 { font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.uotc-acc-card > * + * { margin-top: var(--space-3); }
.uotc-acc-narrow { width: 100%; max-width: 560px; }
.uotc-acc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
.uotc-acc-head h2 { font-size: 22px; font-weight: 700; color: var(--navy); }
.uotc-acc-head p { margin-top: var(--space-1); color: var(--muted); }
.uotc-acc-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.uotc-acc-link:hover { color: var(--blue-dark); }
.uotc-acc-link .ico { width: 18px; height: 18px; }
.uotc-acc-back { margin-bottom: calc(-1 * var(--space-3)); }
.uotc-acc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.uotc-acc-switch { color: var(--muted); }
.uotc-acc-paynote { font-size: 14px; color: var(--muted); }
.uotc-acc .btn .ico { width: 18px; height: 18px; }
.uotc-acc .btn[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }
.uotc-acc .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }

/* Messages. */
.uotc-acc-note { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); font-weight: 600; border-inline-start: 4px solid; }
.uotc-acc-note--good { background: var(--blue-soft); color: var(--navy); border-color: var(--blue); }
.uotc-acc-note--bad { background: #FDECEA; color: #8A1C12; border-color: #B42318; }
.uotc-acc-note--warn { background: #FBF1DC; color: #5C430B; border-color: #B7862B; display: grid; gap: var(--space-3); font-weight: 500; }

/* Forms (fields reuse .uotc-f from the quote form). */
.uotc-acc-form { display: grid; gap: var(--space-4); }
.uotc-acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.uotc-acc-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); align-items: start; }
.uotc-acc-forms .uotc-acc-grid { grid-template-columns: 1fr; }
.uotc-acc .uotc-f input[readonly] { background: var(--cloud); }

/* Status chips. */
.uotc-acc-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--line-soft); color: var(--text); }
.uotc-acc-pill--new { background: #FBF1DC; color: #5C430B; }
.uotc-acc-pill--quoted { background: var(--blue-soft); color: var(--blue-dark); }
.uotc-acc-pill--confirmed { background: var(--navy); color: var(--white); }
.uotc-acc-pill--completed { background: #E3F1E6; color: #1E5A2C; }
.uotc-acc-pill--cancelled { background: #F7E7E5; color: #8A2C22; }

/* Journey cards. */
.uotc-acc-journeys, .uotc-acc-jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-4); }
.uotc-acc-journey, .uotc-acc-job { display: flex; flex-direction: column; gap: var(--space-2); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); min-width: 0; }
.uotc-acc-job.is-today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.uotc-acc-journey-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.uotc-acc-ref { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.uotc-acc-today { color: var(--blue); }
.uotc-acc-journey h3 { font-size: 17px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.uotc-acc-journey h3 a { color: var(--navy); text-decoration: none; }
.uotc-acc-journey h3 a:hover { text-decoration: underline; }
.uotc-acc-when, .uotc-acc-job-when { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-size: 14px; color: var(--muted); }
.uotc-acc-job-when { font-size: 16px; font-weight: 700; color: var(--text); }
.uotc-acc-dot { display: inline-block; width: 4px; height: 4px; margin: 0 var(--space-2); border-radius: 50%; background: var(--line); }
.uotc-acc-journey-foot { margin-top: auto; padding-top: var(--space-2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.uotc-acc-fare strong { display: block; font-size: 20px; font-weight: 700; color: var(--text); }
.uotc-acc-fare--none { font-size: 15px; font-weight: 600; color: var(--muted); }

/* Overview. */
.uotc-acc-overview { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.uotc-acc-next { display: flex; flex-direction: column; gap: var(--space-2); }
.uotc-acc-next > * + * { margin-top: 0; }
.uotc-acc-next-title { font-size: 20px; font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.uotc-acc-next-driver { font-weight: 600; }
.uotc-acc-counts ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.uotc-acc-count a {
  display: flex; flex-direction: column; gap: 2px; min-height: 84px; padding: var(--space-3) var(--space-4);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none;
}
.uotc-acc-count a:hover { border-color: var(--blue); }
.uotc-acc-count strong { font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.uotc-acc-count span { font-size: 14px; color: var(--muted); }
.uotc-acc-count--confirmed a { border-inline-start: 4px solid var(--navy); }
.uotc-acc-count--new a { border-inline-start: 4px solid #B7862B; }
.uotc-acc-count--quoted a { border-inline-start: 4px solid var(--blue); }
.uotc-acc-empty { display: grid; gap: var(--space-3); justify-items: start; }

/* A journey in full. */
.uotc-acc-detail { display: grid; gap: var(--space-5); }
.uotc-acc-detail-head h2 { font-size: clamp(20px, 1vw + 16px, 26px); overflow-wrap: anywhere; }
.uotc-acc-status-text { color: var(--muted); }
.uotc-acc-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line-soft); }
.uotc-acc-total > span:first-child { font-size: 14px; color: var(--muted); }
.uotc-acc-total .uotc-acc-fare strong { font-size: 26px; }
.uotc-acc-detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.uotc-acc-detail-main { display: grid; gap: var(--space-5); min-width: 0; }
.uotc-acc-rows { display: grid; }
.uotc-acc-rows > div { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--line-soft); }
.uotc-acc-rows > div:last-child { border-bottom: 0; }
.uotc-acc-rows dt { font-size: 14px; color: var(--muted); }
.uotc-acc-rows dd { font-weight: 600; overflow-wrap: anywhere; }
.uotc-acc-rows dd a { color: var(--blue); }
.uotc-acc-rows--tight > div { padding: 4px 0; border-bottom: 0; grid-template-columns: minmax(80px, 30%) minmax(0, 1fr); }
.uotc-acc-driver { border-color: var(--navy); box-shadow: inset 0 4px 0 var(--navy); }

/* Timeline. */
.uotc-acc-timeline { display: grid; gap: 0; }
.uotc-acc-ev { position: relative; display: grid; gap: 2px; padding-block: 0 var(--space-4); padding-inline-start: 24px; }
.uotc-acc-ev::before { content: ""; position: absolute; inset-inline-start: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.uotc-acc-ev::after { content: ""; position: absolute; inset-inline-start: 8px; top: 18px; bottom: 2px; width: 2px; background: var(--line); }
.uotc-acc-ev:last-child { padding-bottom: 0; }
.uotc-acc-ev:last-child::after { display: none; }
.uotc-acc-ev--cancelled::before { background: #B42318; }
.uotc-acc-ev--completed::before, .uotc-acc-ev--job_completed::before { background: #1E5A2C; }
.uotc-acc-ev-text { font-weight: 600; }
.uotc-acc-ev time { font-size: 13px; color: var(--muted); }

/* Driver dashboard. */
.uotc-acc-avail { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.uotc-acc-avail-state { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; }
.uotc-acc-avail-state::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.uotc-acc-avail-state--on::before { background: #2E8540; }
.uotc-acc-steplist { display: grid; gap: var(--space-2); }
.uotc-acc-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 2px var(--space-3); color: var(--muted); }
.uotc-acc-step time { grid-column: 2; font-size: 13px; }
.uotc-acc-step-mark { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 50%; background: var(--white); }
.uotc-acc-step-mark .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.uotc-acc-step.is-done { color: var(--text); }
.uotc-acc-step.is-done .uotc-acc-step-mark { background: var(--blue); border-color: var(--blue); color: var(--white); }
.uotc-acc-step.is-next .uotc-acc-step-mark { border-color: var(--blue); }
.uotc-acc-step.is-next .uotc-acc-step-text { color: var(--navy); font-weight: 700; }
.uotc-acc-stepform .btn { width: 100%; min-height: 56px; font-size: 17px; }

/* Header account link. */
.uotc-acc-menu { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.uotc-acc-menu-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; color: inherit; }
.uotc-acc-menu-link:hover span { text-decoration: underline; }
.uotc-acc-menu-link .ico { width: 18px; height: 18px; }
.uotc-acc-menu-link[aria-current="page"] span { text-decoration: underline; text-underline-offset: 4px; }

/* Quote form: the account links under the thank you. */
.uotc-acc-track { color: var(--text); }
.uotc-acc-track-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

/* Editor preview. */
.uotc-acc-preview .uotc-acc-card { border-style: dashed; }

/* Receipt. */
.uotc-rcpt-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.uotc-rcpt-do { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.uotc-rcpt { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 48px); display: grid; gap: var(--space-5); max-width: 860px; width: 100%; }
.uotc-rcpt h1 { font-size: 30px; font-weight: 700; color: var(--navy); }
.uotc-rcpt h2 { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; margin-bottom: var(--space-1); }
.uotc-rcpt-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-5); padding-bottom: var(--space-4); border-bottom: 2px solid var(--navy); }
.uotc-rcpt-brand { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.uotc-rcpt-mark { justify-self: start; margin-bottom: var(--space-2) !important; padding: 6px 12px; background: var(--navy); color: var(--white); font-size: 17px; font-weight: 700; border-radius: var(--radius-in); }
.uotc-rcpt-meta { display: grid; gap: var(--space-2); text-align: end; }
.uotc-rcpt-meta dl { display: grid; gap: 4px; }
.uotc-rcpt-meta dl div { display: flex; justify-content: flex-end; gap: var(--space-3); font-size: 14px; }
.uotc-rcpt-meta dt { color: var(--muted); }
.uotc-rcpt-meta dd { font-weight: 700; }
.uotc-rcpt-pill { padding: 2px 8px; border-radius: 4px; background: var(--blue-soft); color: var(--blue-dark); }
.uotc-rcpt-pill--due { background: #FBF1DC; color: #7A5A12; }
.uotc-rcpt-pill--void { background: #F7E7E5; color: #8A2C22; }
.uotc-rcpt-to p { font-weight: 600; }
.uotc-rcpt-lines { width: 100%; border-collapse: collapse; }
.uotc-rcpt-lines th, .uotc-rcpt-lines td { padding: var(--space-3) 0; text-align: start; vertical-align: top; }
.uotc-rcpt-lines thead th { font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--navy); }
.uotc-rcpt-lines tbody td { border-bottom: 1px solid var(--line); }
.uotc-rcpt-lines .num { text-align: end; white-space: nowrap; font-weight: 700; padding-inline-start: var(--space-4); }
.uotc-rcpt-lines tbody strong { display: block; font-size: 17px; margin-bottom: var(--space-2); }
.uotc-rcpt-lines tfoot th, .uotc-rcpt-lines tfoot td { font-size: 20px; font-weight: 700; }
.uotc-rcpt-detail { display: grid; gap: 4px; font-size: 14px; }
.uotc-rcpt-detail div { display: grid; grid-template-columns: minmax(90px, 30%) minmax(0, 1fr); gap: var(--space-3); }
.uotc-rcpt-detail dt { color: var(--muted); }
.uotc-rcpt-note { display: grid; gap: var(--space-2); padding: var(--space-4); background: var(--cloud); border-radius: var(--radius-sm); font-size: 14px; }
.uotc-rcpt-sign { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); font-size: 13px; color: var(--muted); }
.uotc-rcpt-sign div { display: grid; gap: var(--space-1); }
.uotc-rcpt-rule { display: block; height: 36px; border-bottom: 1px solid var(--line); }
.uotc-rcpt-foot { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: var(--space-3); }

@media (max-width: 900px) {
  .uotc-acc-overview, .uotc-acc-detail-grid, .uotc-acc-forms { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .uotc-acc-band { padding-top: var(--space-5); }
  .uotc-acc-tabs { gap: 0; margin-inline: calc(-1 * var(--space-4)); padding-inline: var(--space-2); }
  .uotc-acc-tab { padding: 0 var(--space-3); font-size: 14px; }
  .uotc-acc-body { padding: var(--space-4) 0 var(--space-7); }
  .uotc-acc-card { padding: var(--space-4); }
  .uotc-acc-grid { grid-template-columns: minmax(0, 1fr); }
  .uotc-acc-rows > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .uotc-acc-actions .btn { flex: 1 1 auto; }
  .uotc-rcpt-meta { text-align: start; }
  .uotc-rcpt-meta dl div { justify-content: flex-start; }
  .uotc-rcpt-sign { grid-template-columns: 1fr; gap: var(--space-4); }
}

@media print {
  body * { visibility: hidden; }
  .uotc-rcpt, .uotc-rcpt * { visibility: visible; }
  .uotc-rcpt { position: absolute; inset: 0 0 auto 0; border: 0; padding: 0; max-width: none; }
  .uotc-acc-body { background: none; }
}
