/* The rider's web: mobile first, no framework. The brand's colors come from Taxio.UI.Core (taxio-core.css). */
:root {
    --rw-navy: var(--taxio-navy);
    --rw-amber: var(--taxio-amber);
    --rw-bg: #f5f7fa;
    --rw-card: #ffffff;
    --rw-text: #0f172a;
    --rw-muted: #64748b;
    --rw-border: #e2e8f0;
    --rw-danger: #b91c1c;
    --rw-radius: 14px;
    --rw-shadow: 0 -4px 24px rgba(15, 23, 42, .12);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --rw-bg: #0b1220;
        --rw-card: #111a2e;
        --rw-text: #e2e8f0;
        --rw-muted: #94a3b8;
        --rw-border: #1f2a44;
        --rw-danger: #f87171;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--rw-bg);
    color: var(--rw-text);
    font: 400 1rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}
#app { height: 100%; }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; }
p { margin: 0 0 .5rem; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.rw-muted { color: var(--rw-muted); }
.rw-strong { font-weight: 600; }
.rw-small { font-size: .875rem; }
.rw-h2 { font-size: 1.125rem; margin: 0; }
.rw-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.rw-row--between { justify-content: space-between; }
.rw-stack { display: flex; flex-direction: column; gap: .5rem; }

/* ---- shell ---- */
.rw-shell { display: flex; flex-direction: column; height: 100%; }
.rw-top {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    height: 52px; padding: 0 12px; padding-top: env(safe-area-inset-top);
    background: var(--rw-navy); color: #fff; flex: none;
}
.rw-brand { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; text-decoration: none; }
.rw-nav { display: flex; gap: 2px; }
.rw-demo-badge { margin-left: .35rem; padding: .05rem .4rem; border-radius: 6px; background: var(--rw-amber); color: #1a1300; font-size: .7rem; font-weight: 800; letter-spacing: .05em; }
.rw-nav a { padding: .35rem .6rem; border-radius: 999px; text-decoration: none; font-size: .875rem; opacity: .8; }
.rw-nav a.active { background: rgba(255, 255, 255, .15); opacity: 1; }
.rw-main { position: relative; flex: 1; min-height: 0; overflow: auto; }
.rw-page { max-width: 640px; margin: 0 auto; padding: 16px; }

/* ---- controls ---- */
.rw-form { display: flex; flex-direction: column; gap: .5rem; }
.rw-label { font-size: .875rem; color: var(--rw-muted); }
.rw-input {
    width: 100%; padding: .75rem .875rem; border: 1px solid var(--rw-border); border-radius: 10px;
    background: var(--rw-card); color: var(--rw-text); font: inherit; font-size: 1rem;
}
.rw-input:focus { outline: 2px solid var(--rw-amber); outline-offset: 0; border-color: transparent; }
.rw-input--code { letter-spacing: .3em; font-size: 1.25rem; text-align: center; }
.rw-button {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 48px; padding: .6rem 1.1rem; border: 0; border-radius: 12px;
    background: var(--rw-amber); color: #1a1300; font-weight: 600; cursor: pointer;
}
.rw-button:disabled { opacity: .55; cursor: default; }
.rw-button--ghost { background: transparent; color: var(--rw-text); border: 1px solid var(--rw-border); }
.rw-button--block { width: 100%; }
.rw-link { background: none; border: 0; padding: .4rem 0; color: var(--rw-muted); text-decoration: underline; cursor: pointer; align-self: center; }
.rw-icon-button { border: 0; background: none; font-size: 1.4rem; width: 44px; height: 44px; cursor: pointer; }
.rw-note { padding: .6rem .75rem; border-radius: 10px; background: color-mix(in srgb, var(--rw-amber) 18%, transparent); font-size: .9rem; }
.rw-note--error { background: color-mix(in srgb, var(--rw-danger) 14%, transparent); color: var(--rw-danger); }
.rw-pill { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--rw-amber) 25%, transparent); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.rw-card { background: var(--rw-card); border: 1px solid var(--rw-border); border-radius: var(--rw-radius); padding: 14px; margin-bottom: 12px; }
.rw-lang { align-self: center; display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--rw-muted) 15%, transparent); }
.rw-lang button { border: 0; background: none; padding: .3rem .8rem; border-radius: 999px; cursor: pointer; font-size: .875rem; }
.rw-lang button.is-active { background: var(--rw-card); font-weight: 600; }

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

/* ---- sign-in ---- */
.rw-auth { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--rw-navy); }
.rw-auth__card { width: 100%; max-width: 420px; background: var(--rw-card); border-radius: 20px; padding: 24px 20px; display: flex; flex-direction: column; gap: .75rem; }
.rw-auth__brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.25rem; }
.rw-captcha { min-height: 65px; max-width: 100%; overflow: hidden; }

/* ---- modal ---- */
.rw-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-end; justify-content: center; background: rgba(2, 6, 23, .55); }
.rw-modal__card { width: 100%; max-width: 480px; background: var(--rw-card); border-radius: 20px 20px 0 0; padding: 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .rw-modal { align-items: center; } .rw-modal__card { border-radius: 20px; } }

/* ---- home: the map with a sheet ---- */
.rw-home { position: absolute; inset: 0; }
.rw-map { position: absolute; inset: 0; z-index: 0; background: #dfe7ef; }
.rw-map__crosshair { position: absolute; left: 50%; top: 50%; z-index: 500; transform: translate(-50%, -100%); font-size: 2rem; pointer-events: none; }
.rw-sheet {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 600;
    max-height: 62%; overflow: auto; background: var(--rw-card);
    border-radius: 20px 20px 0 0; box-shadow: var(--rw-shadow);
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: .75rem;
}
.rw-sheet--compact { max-height: none; }
@media (min-width: 900px) {
    .rw-sheet { left: 16px; right: auto; top: 16px; bottom: auto; width: 400px; max-height: calc(100% - 32px); border-radius: 20px; }
}
.rw-where { display: flex; flex-direction: column; border: 1px solid var(--rw-border); border-radius: 12px; overflow: hidden; }
.rw-where__field { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; background: none; border: 0; text-align: left; cursor: pointer; }
.rw-where__field + .rw-where__field { border-top: 1px solid var(--rw-border); }
.rw-where__text { display: flex; flex-direction: column; min-width: 0; }
.rw-where__text > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-dot { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: .75rem; font-weight: 700; color: #fff; }
.rw-dot--pickup { background: var(--rw-navy); }
.rw-dot--destination { background: #e11d48; }

/* ---- search ---- */
.rw-search { position: absolute; inset: 0; z-index: 900; background: var(--rw-card); display: flex; flex-direction: column; }
.rw-search__bar { display: flex; align-items: center; gap: .25rem; padding: 8px; border-bottom: 1px solid var(--rw-border); }
.rw-search__input { border: 0; }
.rw-list { list-style: none; margin: 0; padding: 0; overflow: auto; }
.rw-list__item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: .8rem 1rem; border: 0; border-bottom: 1px solid var(--rw-border); background: none; text-align: left; cursor: pointer; }
.rw-list__note { padding: .8rem 1rem; }

/* ---- taxi services ---- */
.rw-choice { display: flex; flex-direction: column; gap: .5rem; }
.rw-options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.rw-option { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; padding: .7rem .8rem; border: 1px solid var(--rw-border); border-radius: 12px; background: none; text-align: left; cursor: pointer; }
.rw-option.is-selected { border-color: var(--rw-amber); box-shadow: 0 0 0 2px var(--rw-amber) inset; }
.rw-option__main { display: flex; flex-direction: column; min-width: 0; }
.rw-option__side { flex: none; text-align: right; }

/* ---- the ride ---- */
.rw-ride, .rw-end { display: flex; flex-direction: column; gap: .6rem; }
.rw-ride__status { display: flex; align-items: center; gap: .5rem; }
.rw-driver { display: flex; align-items: center; gap: .75rem; padding: .6rem; border-radius: 12px; background: color-mix(in srgb, var(--rw-muted) 10%, transparent); }
.rw-avatar { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--rw-amber); font-size: 1.2rem; }
.rw-driver__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.rw-trip { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.rw-trip li { display: flex; align-items: center; gap: .5rem; }
.rw-stars { display: flex; gap: .25rem; }
.rw-star { border: 0; background: none; font-size: 2rem; color: var(--rw-border); cursor: pointer; padding: 0 .1rem; }
.rw-star.is-on { color: var(--rw-amber); }

/* ---- history ---- */
.rw-history { list-style: none; margin: 0; padding: 0; }
.rw-status { font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--rw-muted) 15%, transparent); }
.rw-status--completed { background: color-mix(in srgb, #16a34a 18%, transparent); color: #15803d; }

/* ---- map pins ---- */
.rw-pin span { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); color: #fff; font: 700 12px system-ui, sans-serif; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.rw-pin--pickup span { background: var(--rw-navy); }
.rw-pin--destination span { background: #e11d48; }
.rw-car span { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); font-size: 20px; }

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