/*
  The rider's web. The look of the console without its component library: the theme comes from Taxio.UI.Core
  (taxio-theme.css: Slate + Amber, Inter, radius), the components below follow shadcn/ui as BlazorBlueprint draws them.
  Mobile first: the map with a sheet from the bottom and a tab bar; from 960px a side panel next to the map.
*/
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--background);
    color: var(--foreground);
    font: 400 15px/1.5 var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
#app { height: 100%; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---- text ---- */
.rw-muted { color: var(--muted-foreground); }
.rw-strong { font-weight: 600; }
.rw-small { font-size: 0.8125rem; }
.rw-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rw-row { display: flex; gap: 0.5rem; align-items: center; }
.rw-row--between { justify-content: space-between; }
.rw-row--wrap { flex-wrap: wrap; }
.rw-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.rw-stack--sm { gap: 0.375rem; }
.rw-icon { flex: none; }

/* ---- button (shadcn) ---- */
.rw-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    height: 2.75rem; padding: 0 1.125rem; border: 1px solid transparent; border-radius: var(--radius);
    font-size: 0.9375rem; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, opacity .15s, transform .05s;
}
.rw-btn:active:not(:disabled) { transform: translateY(1px); }
.rw-btn:disabled { opacity: 0.5; cursor: default; }
.rw-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.rw-btn--primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.rw-btn--primary:hover:not(:disabled) { background: color-mix(in oklch, var(--primary) 88%, black); }
.rw-btn--outline { background: var(--background); border-color: var(--border); color: var(--foreground); box-shadow: var(--shadow-sm); }
.rw-btn--outline:hover:not(:disabled) { background: var(--accent); }
.rw-btn--ghost { background: transparent; color: var(--foreground); }
.rw-btn--danger-text { background: transparent; color: var(--destructive); }
.rw-btn--ghost:hover:not(:disabled) { background: var(--accent); }
.rw-btn--destructive { background: transparent; color: var(--destructive); border-color: color-mix(in oklch, var(--destructive) 35%, transparent); }
.rw-btn--destructive:hover:not(:disabled) { background: color-mix(in oklch, var(--destructive) 8%, transparent); }
.rw-btn--sm { height: 2.25rem; padding: 0 0.75rem; font-size: 0.875rem; }
.rw-btn--icon { width: 2.5rem; height: 2.5rem; padding: 0; }
.rw-btn--block { width: 100%; }
.rw-link { background: none; border: 0; padding: 0.25rem; color: var(--muted-foreground); font-size: 0.875rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; align-self: center; }
.rw-link:hover { color: var(--foreground); }

/* ---- form ---- */
.rw-form { display: flex; flex-direction: column; gap: 1rem; }
.rw-field { display: flex; flex-direction: column; gap: 0.375rem; }
.rw-label { font-size: 0.875rem; font-weight: 500; }
.rw-toggle { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0 0.75rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; align-self: flex-start; }
.rw-toggle input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 2.5rem; height: 1.5rem; margin: 0; border-radius: 999px; background: var(--input); cursor: pointer; transition: background 0.15s; }
.rw-toggle input::before { content: ""; position: absolute; top: 0.1875rem; left: 0.1875rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform 0.15s; }
.rw-toggle input:checked { background: var(--primary); }
.rw-toggle input:checked::before { transform: translateX(1rem); }
.rw-toggle input:focus-visible { outline: 2px solid var(--ring, var(--primary)); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .rw-toggle input, .rw-toggle input::before { transition: none; } }
.rw-input {
    width: 100%; height: 2.75rem; padding: 0 0.875rem; border: 1px solid var(--input); border-radius: var(--radius);
    background: var(--background); color: var(--foreground); font: inherit; font-size: 1rem; box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .15s;
}
textarea.rw-input { height: auto; padding: 0.625rem 0.875rem; resize: vertical; }
.rw-input::placeholder { color: var(--muted-foreground); }
.rw-input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 30%, transparent); }
.rw-input--code { height: 3.25rem; letter-spacing: 0.4em; font-size: 1.375rem; font-weight: 600; text-align: center; }
.rw-help { font-size: 0.8125rem; color: var(--muted-foreground); }

/* ---- alert, badge, card ---- */
.rw-alert { display: flex; gap: 0.625rem; align-items: flex-start; padding: 0.75rem 0.875rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.875rem; background: var(--card); }
.rw-alert .rw-icon { margin-top: 1px; color: var(--muted-foreground); }
.rw-alert--error { border-color: color-mix(in oklch, var(--destructive) 40%, transparent); color: var(--destructive); }
.rw-alert--error .rw-icon { color: var(--destructive); }
.rw-alert--info { background: color-mix(in oklch, var(--primary) 10%, var(--card)); border-color: color-mix(in oklch, var(--primary) 35%, transparent); }
.rw-alert--info .rw-icon { color: color-mix(in oklch, var(--primary) 75%, black); }
.rw-badge { display: inline-flex; align-items: center; gap: 0.25rem; height: 1.375rem; padding: 0 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; background: var(--secondary); color: var(--secondary-foreground); }
.rw-badge--primary { background: color-mix(in oklch, var(--primary) 22%, transparent); color: var(--foreground); }
.rw-badge--success { background: color-mix(in oklch, oklch(0.72 0.17 150) 18%, transparent); color: oklch(0.5 0.13 150); }
.rw-badge--danger { background: color-mix(in oklch, var(--destructive) 14%, transparent); color: var(--destructive); }
.rw-card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow-sm); padding: 1rem; }
.rw-separator { height: 1px; background: var(--border); border: 0; margin: 0; }

.rw-spinner { display: inline-block; width: 1.25rem; height: 1.25rem; border: 2px solid color-mix(in oklch, var(--primary) 30%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: rw-spin .8s linear infinite; vertical-align: middle; }
.rw-spinner--lg { width: 2rem; height: 2rem; border-width: 3px; }
@keyframes rw-spin { to { transform: rotate(360deg); } }
.rw-splash { display: flex; align-items: center; justify-content: center; height: 100%; }

/* ---- shell ---- */
.rw-shell { display: flex; flex-direction: column; height: 100%; }
.rw-top {
    flex: none; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    height: 3.5rem; padding: 0 1rem; padding-top: env(safe-area-inset-top);
    background: var(--background); border-bottom: 1px solid var(--border);
}
.rw-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; text-decoration: none; }
.rw-demo { height: 1.25rem; padding: 0 0.4rem; border-radius: 0.375rem; background: var(--primary); color: var(--primary-foreground); font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.06em; display: inline-flex; align-items: center; }
.rw-main { position: relative; flex: 1; min-height: 0; overflow: auto; }

/* Tabs: the bottom bar on a phone, in the header on a wide screen. */
.rw-tabs { display: none; }
.rw-tabbar {
    flex: none; display: grid; grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border); background: var(--background);
    padding-bottom: env(safe-area-inset-bottom);
}
.rw-tabbar a, .rw-tabs a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem;
    height: 3.5rem; text-decoration: none; color: var(--muted-foreground); font-size: 0.75rem; font-weight: 500;
}
.rw-tabbar a.active, .rw-tabs a.active { color: var(--foreground); }
.rw-tabbar a.active .rw-icon { color: color-mix(in oklch, var(--primary) 85%, black); }
@media (min-width: 960px) {
    .rw-tabbar { display: none; }
    .rw-tabs { display: flex; gap: 0.25rem; }
    .rw-tabs a { flex-direction: row; gap: 0.375rem; height: 2.25rem; padding: 0 0.75rem; border-radius: var(--radius); font-size: 0.875rem; }
    .rw-tabs a:hover { background: var(--accent); color: var(--foreground); }
    .rw-tabs a.active { background: var(--secondary); }
}

/* Pages without the map: one readable column. */
.rw-page { max-width: 36rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; display: flex; flex-direction: column; gap: 1rem; }
.rw-page__head { display: flex; flex-direction: column; gap: 0.25rem; }

/* ---- sign-in ---- */
.rw-auth {
    min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem;
    background: radial-gradient(1200px 600px at 10% -10%, color-mix(in oklch, var(--primary) 18%, transparent), transparent 60%), var(--muted);
}
.rw-auth__card { width: 100%; max-width: 26rem; display: flex; flex-direction: column; gap: 1.25rem; padding: 1.75rem 1.5rem; border-radius: 1rem; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.rw-auth__brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; }
.rw-auth__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.rw-captcha { min-height: 65px; width: 100%; max-width: 100%; overflow: hidden; }
.rw-segmented { display: inline-flex; padding: 0.1875rem; border-radius: var(--radius); background: var(--muted); }
.rw-segmented button { border: 0; background: none; height: 1.875rem; padding: 0 0.75rem; border-radius: calc(var(--radius) - 2px); cursor: pointer; font-size: 0.8125rem; font-weight: 500; color: var(--muted-foreground); }
.rw-segmented button.is-active { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-sm); }

/* ---- dialog ---- */
.rw-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-end; justify-content: center; background: rgb(2 6 23 / 0.5); }
.rw-modal__card { width: 100%; max-width: 28rem; background: var(--card); border-radius: 1rem 1rem 0 0; padding: 1.5rem; padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); }
@media (min-width: 640px) { .rw-modal { align-items: center; } .rw-modal__card { border-radius: 1rem; } }

/* ---- home: the map and the sheet ---- */
.rw-home { position: absolute; inset: 0; }
.rw-map { position: absolute; inset: 0; z-index: 0; background: var(--muted); }
/* Calmer OpenStreetMap tiles: less saturated so the route, the pins and the car stand out; dark in the dark theme. */
.rw-map .leaflet-tile-pane { filter: saturate(0.55) contrast(0.95) brightness(1.03); }
.dark .rw-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) saturate(0.35) brightness(0.85) contrast(0.9); }
.rw-map .leaflet-control-attribution { font-size: 10px; background: color-mix(in oklch, var(--background) 75%, transparent); color: var(--muted-foreground); }
.rw-map__pin { position: absolute; left: 50%; top: 50%; z-index: 500; transform: translate(-50%, -100%); pointer-events: none; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.3)); }
.rw-map__pin::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 4px; margin-left: -4px; border-radius: 50%; background: rgb(0 0 0 / 0.35); }
.rw-sheet {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 600;
    max-height: 62%; overflow: auto; overscroll-behavior: contain;
    background: var(--card); border-top-left-radius: 1.25rem; border-top-right-radius: 1.25rem;
    box-shadow: 0 -8px 30px -12px rgb(15 23 42 / 0.35);
    --sheet-pad-bottom: calc(1rem + env(safe-area-inset-bottom));
    padding: 0.5rem 1rem var(--sheet-pad-bottom);
    display: flex; flex-direction: column; gap: 1rem;
}
/* The main button of the sheet stays visible while its list scrolls. */
.rw-sheet__action {
    position: sticky; bottom: calc(-1 * var(--sheet-pad-bottom)); z-index: 1;
    margin-bottom: calc(-1 * var(--sheet-pad-bottom)); padding: 0.75rem 0 var(--sheet-pad-bottom);
    background: linear-gradient(to bottom, transparent, var(--card) 0.75rem);
}
/* A refusal right above the order button keeps its distance from it. */
.rw-sheet__action > .rw-alert { margin: 0.5rem 0 0.75rem; }
.rw-sheet::before { content: ""; align-self: center; width: 2.5rem; height: 0.25rem; border-radius: 999px; background: var(--border); margin-bottom: 0.25rem; flex: none; }
@media (min-width: 960px) {
    .rw-sheet {
        top: 1rem; left: 1rem; bottom: auto; right: auto; width: 26rem; max-height: calc(100% - 2rem);
        border-radius: 1rem; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
        --sheet-pad-bottom: 1.25rem; padding: 1.25rem;
    }
    .rw-sheet::before { display: none; }
}

/* The offer of the ride notifications (web push). */
.rw-push { display: flex; align-items: center; gap: 0.75rem; }
.rw-push__icon { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 999px; background: var(--secondary); color: var(--muted-foreground); }
.rw-push__icon.is-on { background: color-mix(in oklch, var(--primary) 22%, transparent); color: var(--foreground); }
.rw-push__text { flex: 1; min-width: 0; font-size: 0.875rem; }

/* An in-page question with two answers (instead of the browser's confirm window). */
.rw-confirm { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.875rem; border-radius: calc(var(--radius) + 2px); border: 1px solid color-mix(in oklch, var(--primary) 45%, transparent); background: color-mix(in oklch, var(--primary) 10%, var(--card)); }
.rw-confirm__text { display: flex; gap: 0.625rem; align-items: flex-start; font-size: 0.875rem; }
.rw-confirm__text .rw-icon { flex: none; margin-top: 1px; color: color-mix(in oklch, var(--primary) 75%, black); }
.rw-confirm__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.rw-confirm--danger { border-color: color-mix(in oklch, var(--destructive) 40%, transparent); background: color-mix(in oklch, var(--destructive) 7%, var(--card)); }
.rw-confirm--danger .rw-confirm__text .rw-icon { color: var(--destructive); }
.rw-btn--danger { background: var(--destructive); color: #fff; }
.rw-btn--danger:hover:not(:disabled) { background: color-mix(in oklch, var(--destructive) 88%, black); }

/* The stops of the trip: A and B joined by a line, like the app. */
.rw-trip { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--background); }
.rw-trip::before { content: ""; position: absolute; left: 1.4375rem; top: 2.25rem; bottom: 2.25rem; border-left: 2px dotted var(--border); }
.rw-trip__stop { display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 3.5rem; padding: 0.5rem 0.875rem; background: none; border: 0; text-align: left; cursor: pointer; }
.rw-trip__stop + .rw-trip__stop { border-top: 1px solid var(--border); }
.rw-trip__stop:hover { background: var(--accent); }
.rw-trip__stop:first-child { border-radius: calc(var(--radius) + 2px) calc(var(--radius) + 2px) 0 0; }
.rw-trip__stop:last-child { border-radius: 0 0 calc(var(--radius) + 2px) calc(var(--radius) + 2px); }
.rw-trip__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rw-trip__value { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-trip__value.is-empty { color: var(--muted-foreground); font-weight: 400; }
.rw-stop-dot { flex: none; display: inline-flex; width: 1.25rem; height: 1.25rem; align-items: center; justify-content: center; z-index: 1; }
.rw-stop-dot--pickup::before { content: ""; width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 3px solid var(--foreground); background: var(--background); }
.rw-stop-dot--destination::before { content: ""; width: 0.75rem; height: 0.75rem; border-radius: 3px; background: var(--primary); box-shadow: 0 0 0 2px color-mix(in oklch, var(--primary) 35%, transparent); }

/* ---- search ---- */
.rw-search { position: absolute; inset: 0; z-index: 900; background: var(--background); display: flex; flex-direction: column; }
@media (min-width: 960px) { .rw-search { inset: 1rem auto auto 1rem; width: 26rem; max-height: calc(100% - 2rem); border-radius: 1rem; border: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: hidden; } }
.rw-search__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; padding: 0.625rem; border-bottom: 1px solid var(--border); }
/* What is searched for ("Kam idete?", "Kde bývate?") beside the back button, the field below it. */
.rw-search__title { flex: 1; margin: 0; font-size: 1rem; font-weight: 600; }
.rw-search__title + .rw-input { flex: 1 1 100%; }
.rw-list { list-style: none; margin: 0; padding: 0.25rem 0; overflow: auto; }
.rw-list__item { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.75rem 1rem; border: 0; background: none; text-align: left; cursor: pointer; }
.rw-list__item:hover { background: var(--accent); }
.rw-list__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--secondary); color: var(--muted-foreground); }
.rw-list__text { display: flex; flex-direction: column; min-width: 0; }
.rw-list__note { padding: 0.75rem 1rem; }

/* ---- taxi services ---- */
.rw-options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.rw-option { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.75rem; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--background); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.rw-option:hover { border-color: color-mix(in oklch, var(--primary) 50%, var(--border)); }
.rw-option.is-selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 0 0 4px color-mix(in oklch, var(--primary) 18%, transparent); }
.rw-option__logo { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: var(--radius); background: color-mix(in oklch, var(--primary) 18%, var(--secondary)); color: var(--foreground); }
.rw-option__main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; flex: 1; }
.rw-option__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.625rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.rw-option__meta span { display: inline-flex; align-items: center; gap: 0.25rem; }
.rw-option__note { font-size: 0.8125rem; color: var(--muted-foreground); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; text-align: left; }
.rw-option__side { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.125rem; }
.rw-price { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }

/* ---- the ride ---- */
.rw-status { display: flex; align-items: center; gap: 0.75rem; }
.rw-status__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: color-mix(in oklch, var(--primary) 20%, transparent); color: var(--foreground); }
.rw-status__icon--pulse { animation: rw-pulse 1.6s ease-in-out infinite; }
@keyframes rw-pulse { 50% { box-shadow: 0 0 0 10px color-mix(in oklch, var(--primary) 0%, transparent); background: color-mix(in oklch, var(--primary) 35%, transparent); } }
.rw-driver { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border-radius: calc(var(--radius) + 2px); background: var(--muted); }
.rw-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); font-weight: 700; }
.rw-plate { display: inline-flex; align-items: center; height: 1.5rem; padding: 0 0.5rem; border: 1.5px solid var(--foreground); border-radius: 0.3rem; font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.04em; background: var(--background); }
.rw-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.rw-stops li { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
.rw-stars { display: flex; gap: 0.25rem; justify-content: center; }
.rw-star { border: 0; background: none; padding: 0.125rem; cursor: pointer; color: var(--border); transition: transform .1s, color .1s; }
.rw-star:hover { transform: scale(1.1); }
.rw-star.is-on { color: var(--taxio-star); }
.rw-star.is-on svg { fill: currentColor; }

/* ---- history ---- */
.rw-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }

/* ---- map markers (Leaflet divIcons) ---- */
.rw-marker { background: none; border: 0; }
.rw-marker svg { display: block; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 0.3)); }
.rw-car { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); border: 3px solid #fff; box-shadow: 0 4px 10px rgb(0 0 0 / 0.3); }

.rw-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000; padding: 0.75rem 1rem; background: #fef3c7; color: #78350f; }
.rw-error-ui .reload { margin-left: 0.5rem; }
