/* Customer order workflow: review step, tracking timeline, PIN cards, account and portal panels.
   Uses the existing storefront/portal tokens (--ink, --green, --coral, --line, --surface, --muted). */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.order-review { border: 1px solid var(--line, #dce5ef); border-radius: 6px; padding: 18px; background: var(--surface, #fff); }
.order-review h2 { margin-top: 0; }
.order-review .ow-review-note { color: var(--muted, #64748b); font-size: 13px; }
.order-review .ow-review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.ow-summary .ow-total { color: var(--ink, #172c49); border-top: 1px solid var(--line, #dce5ef); padding-top: 12px; }
.ow-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 18px 0 0; }
.ow-facts div { min-width: 0; }
.ow-facts dt { color: var(--muted, #64748b); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ow-facts dd { margin: 3px 0 0; color: var(--ink, #172c49); overflow-wrap: anywhere; }
.ow-facts .ow-wide { grid-column: 1 / -1; }

.ow-card { margin-top: 22px; padding: 22px; border: 1px solid var(--line, #dce5ef); border-radius: 8px; background: var(--surface, #fff); box-shadow: var(--shadow, none); text-align: left; }
.ow-card h2 { margin-top: 0; font-size: 18px; }
.ow-status { padding: 14px 16px; border-radius: 6px; background: #eef4ff; color: var(--ink, #172c49); }
.ow-status.is-error { background: #fdecee; color: #8f1d24; }

.ow-timeline { list-style: none; margin: 0; padding: 0; }
.ow-step { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 0 0 18px; }
.ow-step:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line, #dce5ef); }
.ow-step.is-done:not(:last-child)::before { background: var(--green, #164fc7); }
.ow-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line, #dce5ef); background: var(--surface, #fff); box-sizing: border-box; }
.ow-step.is-done .ow-dot { border-color: var(--green, #164fc7); background: var(--green, #164fc7); }
.ow-step.is-current .ow-dot { border-color: var(--green, #164fc7); box-shadow: 0 0 0 4px rgb(22 79 199 / 15%); }
.ow-step.is-blocked .ow-dot { border-color: var(--coral, #e33b42); background: var(--coral, #e33b42); }
.ow-step strong { display: block; color: var(--ink, #172c49); }
.ow-step small { display: block; color: var(--muted, #64748b); margin-top: 2px; }
.ow-step.is-pending strong { color: var(--muted, #64748b); font-weight: 600; }

.ow-pin { margin-top: 22px; padding: 22px; border-radius: 8px; border: 1px dashed var(--line, #dce5ef); background: #f8fbff; text-align: center; }
.ow-pin.is-active { border: 2px solid var(--green, #164fc7); background: #eef4ff; }
.ow-pin h2 { margin: 0 0 8px; font-size: 18px; }
.ow-pin-code { margin: 6px 0; font-size: 40px; font-weight: 800; letter-spacing: .32em; color: var(--green-deep, #0b2e75); font-variant-numeric: tabular-nums; }
.ow-pin-meta { color: var(--muted, #64748b); font-size: 13px; }

.ow-account { max-width: 460px; margin: 0 auto; }
.ow-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; }
.ow-tabs button { min-height: 42px; border: 1px solid var(--line, #dce5ef); border-radius: 4px; background: var(--surface, #fff); color: var(--ink, #172c49); font-weight: 700; cursor: pointer; }
.ow-tabs button[aria-selected="true"] { border-color: var(--green, #164fc7); background: var(--green, #164fc7); color: #fff; }
.ow-form { display: grid; gap: 14px; }
.ow-form label { display: grid; gap: 6px; font-weight: 600; color: var(--ink, #172c49); }
.ow-field-error { color: #b4232b; font-size: 12px; font-weight: 400; min-height: 1em; }
.ow-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ow-orders a { display: flex; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--line, #dce5ef); border-radius: 6px; color: var(--ink, #172c49); text-decoration: none; }
.ow-orders a:hover { border-color: var(--green, #164fc7); }
.ow-orders small { display: block; color: var(--muted, #64748b); }
.button[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* Portal panels (dealer / delivery) */
.ow-portal-list { display: grid; gap: 12px; }
.ow-portal-item { padding: 14px; border: 1px solid var(--line, #dce5ef); border-radius: 6px; display: grid; gap: 8px; }
.ow-portal-item header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ow-portal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ow-portal-actions input { min-height: 38px; }
.ow-portal-pin { font-size: 28px; font-weight: 800; letter-spacing: .28em; color: var(--green-deep, #0b2e75); }

@media (max-width: 640px) {
  .ow-facts { grid-template-columns: 1fr; }
  .ow-pin-code { font-size: 34px; letter-spacing: .24em; }
  .ow-card { padding: 16px; }
}
