/* =====================================================================
   Neo styling pack: components (0.9.0)
   A 22nd-century, semi-cyberpunk take on the tile look. Loaded after the
   base style.css and this pack's tokens.css when platform.look = 'neo'.
   LEARN: Shape language, in one sentence: corners are cut at 45 degrees,
   LEARN: anything small leans (tags, chips, the row flags, heading markers),
   LEARN: and panels are white plates with a fine frame and corner brackets.
   LEARN: Colours come only from tokens (tokens.css and the base), so the
   LEARN: same rules work in light and dark.
   LEARN: Cut corners use clip-path, which also hides anything drawn outside
   LEARN: the shape, including the usual focus ring. Every cut-corner thing
   LEARN: therefore draws its focus ring inside (white then black, visible on
   LEARN: any colour), so keyboard users can always see where they are.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Shapes
   --------------------------------------------------------------------- */
.tile, .flash, .live, .brandbar .call {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
button, .button { clip-path: polygon(var(--cut-btn) 0, 100% 0, 100% calc(100% - var(--cut-btn)), calc(100% - var(--cut-btn)) 100%, 0 100%, 0 var(--cut-btn)); }
button.link { clip-path: none; }
.tag, .chip, .status { clip-path: polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%); padding-left: .55rem; padding-right: .55rem; white-space: nowrap; }
.count { clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
button:focus-visible, .button:focus-visible, .tile:focus-visible, .brandbar .call:focus-visible, header.top .product:focus-visible {
  outline: none; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 6px #000;
}

/* ---------------------------------------------------------------------
   2. Type: the angular face for headings, numbers and buttons
   --------------------------------------------------------------------- */
h1, h2, legend, .tile .n, .quote .price, .quote-result .price, td.time, header.top .product, .brandbar .brandname, button, .button, .readout {
  font-family: var(--display);
}
h1 { font-weight: 600; letter-spacing: -.025em; font-size: 2.5rem; }
body.public h1 { font-weight: 600; font-size: 3rem; }
body:not(.public) main h2, body:not(.public) legend { text-transform: none; }   /* LEARN: this face reads better in sentence case */
/* LEARN: A short leaning bar before each section heading, at the same angle as the tags. */
main h2, legend { display: flex; align-items: center; gap: .55rem; font-weight: 600; letter-spacing: -.01em; }
main h2::before, legend::before { content: ""; flex: none; width: 10px; height: .8em; background: var(--wire-ink); transform: skewX(-20deg); }
h2.inline { display: inline-flex; }
summary h2.inline::before { display: none; }
button, .button { letter-spacing: .02em; font-weight: 600; }
td.time { font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; }
.quote .price, .quote-result .price { font-weight: 600; letter-spacing: -.04em; }

/* ---------------------------------------------------------------------
   3. The office page: dot grid, frosted night bar
   --------------------------------------------------------------------- */
body { background: var(--page) radial-gradient(circle, var(--grid) 1px, transparent 1.4px) 0 0 / 22px 22px; }
body.public { background: var(--page); }   /* LEARN: no dot grid on customer pages: calmer on a phone */
header.top { background: var(--night-glass); -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4); border-bottom: 0; box-shadow: 0 2px 0 var(--wire); }
header.top nav a:not(.product) { position: relative; color: var(--on-night); }
header.top nav a:not(.product):hover, header.top nav a[aria-current=page] { color: #fff; }
/* LEARN: The menu underline slides in on hover, leaning like everything else; the current page keeps it. */
header.top nav a:not(.product)::after { content: ""; position: absolute; left: .55rem; right: .55rem; bottom: 0; height: 3px; background: var(--wire);
  transform: scaleX(0) skewX(-30deg); transform-origin: left; transition: transform .18s ease-out; }
header.top nav a:not(.product):hover::after, header.top nav a[aria-current=page]::after { transform: scaleX(1) skewX(-30deg); }
header.top .who { color: var(--on-night); }
header.top button.link { color: var(--wire); }
header.top .product { gap: .55rem; align-items: center; background: #000; padding-right: 1.6rem; letter-spacing: .03em;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }   /* LEARN: the office name tile ends in a slant */

/* ---------------------------------------------------------------------
   4. Plates: panels and fieldsets
   LEARN: White plate, 1px frame, a drawn line where the corner is cut, loch
   LEARN: brackets at two corners and a short tab on the top edge. All drawn
   LEARN: with backgrounds and inset shadows, which clip-path can't cut off.
   --------------------------------------------------------------------- */
.panel, fieldset {
  --cut: 14px;
  position: relative; padding-top: .8rem;
  background:
    linear-gradient(var(--wire-ink), var(--wire-ink)) left top / var(--bracket) 2px no-repeat,
    linear-gradient(var(--wire-ink), var(--wire-ink)) left top / 2px var(--bracket) no-repeat,
    linear-gradient(var(--wire-ink), var(--wire-ink)) right bottom / var(--bracket) 2px no-repeat,
    linear-gradient(var(--wire-ink), var(--wire-ink)) right bottom / 2px var(--bracket) no-repeat,
    linear-gradient(to bottom left, transparent calc(50% - 1px), var(--frame) calc(50% - 1px), var(--frame) calc(50% + .5px), transparent calc(50% + .5px)) right top / var(--cut) var(--cut) no-repeat,
    var(--plate);
  box-shadow: inset 0 0 0 1px var(--frame);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.panel::before, fieldset::before { content: ""; position: absolute; left: 24px; top: 0; width: 5rem; height: 3px; background: var(--wire-ink);
  clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 100%, 0 100%); }
.panel.danger { box-shadow: inset 0 0 0 1px var(--frame), inset 5px 0 0 var(--bad); }
.panel.danger::before { background: var(--bad); }
.panel.telegram { box-shadow: inset 0 0 0 1px var(--frame), inset 5px 0 0 #229ed9; }
.panel.telegram::before { background: #229ed9; }
fieldset fieldset { background: var(--plate-inner); box-shadow: inset 0 0 0 1px var(--hairline); }
fieldset fieldset::before { display: none; }
table.board, table.history, table.pricing, table.thread { background: var(--plate); box-shadow: 0 0 0 1px var(--frame); }
table.board th, table.history th, table.pricing th, table.thread th { font-family: var(--display); font-weight: 600; text-transform: none; border-bottom-color: var(--wire-ink); }
/* LEARN: The stage edge on each board row becomes a slanted flag. */
table.board td:first-child { box-shadow: none; position: relative; }
table.board td:first-child::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 7px; background: var(--edge, transparent);
  clip-path: polygon(0 0, 100% 4px, 100% calc(100% - 4px), 0 100%); }

/* ---------------------------------------------------------------------
   5. Fields: underlined, bottom-right corner notched
   --------------------------------------------------------------------- */
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea {
  border-width: 0 0 2px; border-color: var(--muted); background: var(--plate-inner);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut-field)), calc(100% - var(--cut-field)) 100%, 0 100%);
}
input:not([type=checkbox]):not([type=radio]):not([type=color]):focus, select:focus, textarea:focus { background: var(--field); box-shadow: inset 0 -2px 0 var(--accent); }
input:not([type=checkbox]):not([type=radio]):not([type=color]):focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; box-shadow: inset 0 0 0 2px var(--focus), inset 0 -4px 0 var(--accent); }

/* ---------------------------------------------------------------------
   6. Buttons
   LEARN: Main buttons: a lighter band sweeps across on hover. Second-choice
   LEARN: buttons are solid light grey with a black underline (an outline
   LEARN: would lose its frame at the cut corners).
   --------------------------------------------------------------------- */
button:not(.ghost):not(.link), .button:not(.ghost) { background-size: 250% 100%; background-position: 100% 0; transition: background-position .35s ease-out;
  background-image: linear-gradient(115deg, var(--btn-dark) 0 40%, var(--sweep) 50%, var(--btn) 60% 100%); }
button:not(.ghost):not(.link):hover, .button:not(.ghost):hover { background-position: 0 0; }
button.danger:not(.ghost):not(.link) { background-image: linear-gradient(115deg, #8e2222 0 40%, #c94848 50%, var(--bad) 60% 100%); }
button.ghost, .button.ghost { background: var(--ghost); border-color: var(--ghost); color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); }
button.ghost:hover, .button.ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--surface); }
button.ghost:focus-visible, .button.ghost:focus-visible { box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 6px #000; }

/* ---------------------------------------------------------------------
   7. Board tiles
   --------------------------------------------------------------------- */
.tile { --cut: 16px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); transition: transform .15s ease-out; }   /* LEARN: a fine inner edge makes the colour look cut, not painted */
.tile:hover { transform: translate(0, -3px); filter: none; }
.tile .n { font-weight: 600; font-size: 3.1rem; letter-spacing: -.04em; }
.tile .sub { font: 500 .8125rem/1.2 var(--display); opacity: .92; margin-top: auto; padding-bottom: .15rem; }
.tile .ic { position: absolute; right: .6rem; bottom: .6rem; width: 26px; height: 26px; opacity: .85; }
.tile::after { content: ""; position: absolute; right: 18px; top: .7rem; width: 26px; height: 2px; background: var(--tile-line); transform: skewX(-45deg); }
.tile.zero { background: repeating-linear-gradient(-45deg, var(--zero-a) 0 6px, var(--zero-b) 6px 12px); }
/* LEARN: The tiles appear with a wipe along the diagonal, as if being cut out. */
@keyframes tile-in { from { opacity: 0; clip-path: polygon(0 0, 0 0, 0 0, 0 0, 0 0, 0 0); } to { opacity: 1; } }
/* LEARN: The one thing that moves on its own: the "live" diamond by the drivers online, because it means the app is connected. */
p.online::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: .45rem; background: var(--st-pob); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: live 1.6s ease-in-out infinite; vertical-align: 1px; }
@keyframes live { 50% { opacity: .25; } }

/* ---------------------------------------------------------------------
   8. Customer pages
   --------------------------------------------------------------------- */
.brandbar { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25);
  background: linear-gradient(115deg, var(--brand, var(--accent)) 0%, var(--brand, var(--accent)) 55%, color-mix(in srgb, var(--brand, var(--accent)) 65%, #000) 55.2%, color-mix(in srgb, var(--brand, var(--accent)) 75%, #000) 100%); }
.brandbar .brandname { font-weight: 500; letter-spacing: .01em; }
body.public legend { font-weight: 600; }
body.public button:not(.ghost):not(.link), body.public .button:not(.ghost) {
  background-image: linear-gradient(115deg, color-mix(in srgb, var(--brand, var(--accent)) 80%, #000) 0 40%, color-mix(in srgb, var(--brand, var(--accent)) 85%, #fff) 50%, var(--brand, var(--accent)) 60% 100%); }
body.public button.ghost, body.public .button.ghost { background: var(--ghost); border-color: var(--ghost); }
.public-form .check:has(> input[type=radio]) { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
.panel.car .reg { clip-path: none; }
/* LEARN: The passenger's status tile: the stage colour with fine diagonal shading. */
body.public .panel.live { box-shadow: none;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .06) 0 2px, transparent 2px 9px), linear-gradient(135deg, var(--c) 0%, color-mix(in srgb, var(--c) 72%, #000) 100%); }
body.public .panel.live::before { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tile, header.top nav a:not(.product)::after, button, .button { animation: none; transition: none; }
  p.online::before { animation: none; }
}

/* ---- 0.9.0: display switch and readouts on the night bar and plates ---- */
header.top .mode-switch button { color: var(--on-night); }
header.top .mode-switch button[aria-pressed=true] { color: #fff; box-shadow: inset 0 -2px 0 var(--wire); }
.readout { font-family: var(--display); letter-spacing: .01em; }
header.top nav a:not(.product)::after { left: .42rem; right: .42rem; }
