/* Bizmaize Rider app (rider/*.php). Phone-first, works full screen as an installed web app. */
:root {
    --rd-navy: #021A54;
    --rd-navy-2: #0b2f86;
    --rd-orange: #f97316;
    --rd-orange-2: #ea580c;
    --rd-green: #15803d;
    --rd-ink: #0f172a;
    --rd-muted: #64748b;
    --rd-line: #e2e8f0;
    --rd-soft: #f8fafc;
    --rd-bg: #f1f4f9;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    background: var(--rd-bg);
    color: var(--rd-ink);
    font-family: Poppins, system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--rd-navy-2);
}

h1,
h2,
h3 {
    margin: 0 0 10px;
    line-height: 1.25;
}

h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; margin-top: 16px; }

[hidden] {
    display: none !important;
}

/* ---------- Common ---------- */
.rd-card {
    background: #fff;
    border: 1px solid var(--rd-line);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 14px;
}

.rd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid var(--rd-line);
    border-radius: 14px;
    background: #fff;
    color: var(--rd-ink);
    font: 600 15px Poppins, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.rd-btn:disabled {
    opacity: .6;
}

.rd-btn--primary {
    background: var(--rd-orange);
    border-color: var(--rd-orange);
    color: #fff;
}

.rd-btn--primary:active {
    background: var(--rd-orange-2);
}

.rd-btn--block {
    width: 100%;
    min-height: 54px;
    font-size: 16px;
}

.rd-link-btn {
    display: block;
    margin: 12px auto 0;
    border: 0;
    background: none;
    color: #b91c1c;
    font: 500 13.5px Poppins, sans-serif;
    text-decoration: underline;
    cursor: pointer;
}

.rd-muted {
    color: var(--rd-muted);
    font-size: 13px;
    margin: 6px 0 0;
}

.rd-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
}

.rd-ok {
    color: var(--rd-green);
    font-size: 13px;
    font-weight: 600;
}

.rd-note {
    padding: 12px 14px;
    border-radius: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-size: 14px;
    margin-bottom: 14px;
}

.rd-note--warn {
    background: #fff7ed;
    border-color: #fed7aa;
}

.rd-flash {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 12px 16px;
    background: var(--rd-green);
    color: #fff;
    font-size: 14px;
    text-align: center;
}

.rd-flash--error {
    background: #b91c1c;
}

.rd-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eef2f7;
    color: var(--rd-muted);
}

.rd-pill--live { background: #ffedd5; color: #c2410c; }
.rd-pill--success { background: #dcfce7; color: var(--rd-green); }
.rd-pill--failed,
.rd-pill--reversed { background: #fee2e2; color: #b91c1c; }

/* ---------- Forms ---------- */
.rd-form label {
    display: grid;
    gap: 5px;
    margin-bottom: 12px;
    font-size: 13.5px;
    font-weight: 600;
}

.rd-form input,
.rd-form select,
.rd-form textarea,
.rd-sheet textarea {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--rd-line);
    border-radius: 12px;
    background: var(--rd-soft);
    font: 16px Poppins, sans-serif;
    color: var(--rd-ink);
}

.rd-form input:focus,
.rd-form select:focus,
.rd-form textarea:focus {
    outline: 0;
    border-color: var(--rd-orange);
    background: #fff;
}

.rd-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rd-row--tight {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.rd-row--tight label {
    margin: 0;
}

.rd-file input {
    padding: 10px;
    background: #fff;
    font-size: 14px;
}

.rd-apply legend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 700;
}

.rd-apply legend span {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--rd-navy);
    color: #fff;
    font-size: 13px;
}

.rd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.rd-chip {
    display: inline-block !important;
    margin: 0 !important;
}

.rd-chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.rd-chip span {
    display: inline-block;
    padding: 9px 14px;
    border: 1px solid var(--rd-line);
    border-radius: 999px;
    background: #fff;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.rd-chip input:checked + span {
    background: var(--rd-navy);
    border-color: var(--rd-navy);
    color: #fff;
}

.rd-agree {
    display: flex !important;
    gap: 10px;
    align-items: flex-start;
    font-weight: 400 !important;
    font-size: 13.5px !important;
    margin: 4px 0 14px;
}

.rd-agree input {
    width: 20px;
    min-height: 20px;
    margin-top: 2px;
}

.rd-actions {
    display: flex;
    gap: 10px;
}

.rd-actions .rd-btn {
    flex: 1;
}

/* ---------- Auth ---------- */
.rd-authbox {
    width: min(100% - 32px, 440px);
    margin: 0 auto;
    padding: 28px 0 40px;
}

.rd-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.rd-brand img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
}

.rd-brand strong {
    display: block;
    font-size: 19px;
    color: var(--rd-navy);
}

.rd-brand span {
    font-size: 13px;
    color: var(--rd-muted);
}

.rd-perks {
    list-style: none;
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--rd-navy);
    color: #fff;
    display: grid;
    gap: 8px;
    font-size: 14px;
}

.rd-perks i {
    width: 22px;
    color: var(--rd-orange);
}

.rd-switch {
    text-align: center;
    font-size: 14px;
}

.rd-status-card {
    text-align: center;
}

.rd-status-card > i {
    font-size: 40px;
    color: var(--rd-orange);
    margin: 8px 0 12px;
}

.rd-status-card p {
    color: var(--rd-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- App shell ---------- */
.rd-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid var(--rd-line);
}

.rd-bar strong {
    flex: 1;
}

.rd-bar__back {
    color: var(--rd-ink);
    font-size: 18px;
}

.rd-bar__link {
    font-size: 13px;
}

.rd-page {
    width: min(100% - 24px, 640px);
    margin: 14px auto 40px;
}

.rd-top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: var(--rd-navy);
    color: #fff;
}

.rd-top__who {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.rd-top__who img,
.rd-top__who > span {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 40px;
}

.rd-top__who > span {
    display: grid;
    place-items: center;
    background: var(--rd-orange);
    font-weight: 700;
}

.rd-top__who strong {
    display: block;
    font-size: 15px;
}

.rd-top__who small {
    font-size: 12px;
    opacity: .8;
}

.rd-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px 0 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font: 600 14px Poppins, sans-serif;
    cursor: pointer;
}

.rd-toggle__knob {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #94a3b8;
    transition: background .2s;
}

.rd-toggle.is-on {
    background: var(--rd-green);
}

.rd-toggle.is-on .rd-toggle__knob {
    background: #fff;
}

.rd-main {
    width: min(100% - 24px, 640px);
    margin: 14px auto 0;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

.rd-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #fff;
    border-top: 1px solid var(--rd-line);
    padding-bottom: env(safe-area-inset-bottom);
}

.rd-tabs a {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 10px 0 9px;
    color: var(--rd-muted);
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
}

.rd-tabs i {
    font-size: 19px;
}

.rd-tabs a.is-active {
    color: var(--rd-orange);
}

.rd-section {
    font-size: 14px;
    color: var(--rd-muted);
    margin: 18px 2px 10px;
}

.rd-gps {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 13.5px;
    margin-bottom: 12px;
}

/* ---------- Jobs ---------- */
.rd-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--rd-muted);
}

.rd-empty > i {
    font-size: 34px;
    color: #cbd5e1;
}

.rd-empty h2 {
    margin: 12px 0 6px;
    color: var(--rd-ink);
}

.rd-empty p {
    margin: 0;
    font-size: 14px;
}

.rd-radar {
    display: block;
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border-radius: 50%;
    background: radial-gradient(circle, var(--rd-orange) 0 9px, transparent 10px);
    position: relative;
}

.rd-radar::before,
.rd-radar::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--rd-orange);
    animation: rd-radar 2s ease-out infinite;
}

.rd-radar::after {
    animation-delay: 1s;
}

@keyframes rd-radar {
    from { transform: scale(.2); opacity: 1; }
    to { transform: scale(1.4); opacity: 0; }
}

.rd-job {
    background: #fff;
    border: 1px solid var(--rd-line);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(2, 26, 84, .05);
}

.rd-job__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

.rd-job__top b {
    font-size: 24px;
    color: var(--rd-green);
}

.rd-job__top span {
    font-size: 13px;
    color: var(--rd-muted);
}

.rd-route {
    display: grid;
    gap: 10px;
    position: relative;
}

.rd-route > div {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.rd-route i {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eef2ff;
    color: var(--rd-navy-2);
    font-size: 13px;
}

.rd-route > div + div i {
    background: #dcfce7;
    color: var(--rd-green);
}

.rd-route span {
    display: grid;
}

.rd-route strong {
    font-size: 14.5px;
}

.rd-route small {
    font-size: 12.5px;
    color: var(--rd-muted);
}

.rd-job .rd-btn--block {
    margin-top: 12px;
}

.rd-active {
    background: #fff;
    border: 2px solid var(--rd-orange);
    border-radius: 20px;
    padding: 14px;
    margin-bottom: 8px;
}

.rd-active__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.rd-active__head b {
    font-size: 20px;
    color: var(--rd-green);
}

.rd-map {
    height: 200px;
    border-radius: 14px;
    overflow: hidden;
    background: #e8edf5;
    z-index: 0;
}

.rd-pin {
    display: grid !important;
    place-items: center;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
    border: 3px solid #fff;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .3);
}

.rd-pin.is-pickup { background: var(--rd-navy-2); }
.rd-pin.is-drop { background: var(--rd-green); }
.rd-pin.is-me { background: var(--rd-orange); }

.rd-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    list-style: none;
    margin: 12px 0;
    padding: 0;
    counter-reset: step;
}

.rd-steps li {
    padding-top: 8px;
    border-top: 4px solid var(--rd-line);
    font-size: 11px;
    color: var(--rd-muted);
    text-align: center;
}

.rd-steps li.is-done {
    border-color: var(--rd-green);
}

.rd-steps li.is-now {
    border-color: var(--rd-orange);
    color: var(--rd-ink);
    font-weight: 700;
}

.rd-stop {
    display: grid;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--rd-soft);
    margin-bottom: 10px;
}

.rd-stop span {
    font-size: 13.5px;
    color: var(--rd-muted);
}

.rd-active__tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

/* ---------- Bottom sheet ---------- */
.rd-sheet {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    background: rgba(15, 23, 42, .5);
}

.rd-sheet__panel {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    background: #fff;
}

.rd-sheet__panel p {
    color: var(--rd-muted);
    font-size: 14px;
}

.rd-code-input {
    display: block;
    width: 100%;
    height: 70px;
    margin: 6px 0 14px;
    border: 2px solid var(--rd-line);
    border-radius: 16px;
    text-align: center;
    font: 700 36px Poppins, sans-serif;
    letter-spacing: 16px;
    padding-left: 16px;
}

.rd-code-input:focus {
    outline: 0;
    border-color: var(--rd-orange);
}

.rd-sheet textarea {
    margin-bottom: 14px;
}

.rd-toast {
    position: fixed;
    left: 50%;
    bottom: calc(84px + env(safe-area-inset-bottom));
    z-index: 70;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--rd-ink);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .25);
}

.rd-toast.is-bad {
    background: #b91c1c;
}

/* ---------- Earnings ---------- */
.rd-wallet {
    padding: 20px;
    margin-bottom: 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--rd-navy), var(--rd-navy-2));
    color: #fff;
}

.rd-wallet > span {
    font-size: 13px;
    opacity: .8;
}

.rd-wallet > strong {
    display: block;
    margin: 4px 0 14px;
    font-size: 32px;
}

.rd-wallet__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.rd-wallet__stats div {
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
}

.rd-wallet__stats small {
    display: block;
    font-size: 11px;
    opacity: .8;
}

.rd-wallet__stats b {
    font-size: 15px;
}

.rd-ledger {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rd-ledger li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.rd-ledger li > div {
    flex: 1;
    min-width: 0;
    display: grid;
}

.rd-ledger strong {
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-ledger small {
    font-size: 12px;
    color: var(--rd-muted);
}

.rd-ledger__icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #dcfce7;
    color: var(--rd-green);
}

.rd-ledger__icon.is-out {
    background: #eef2ff;
    color: var(--rd-navy-2);
}

.rd-ledger b.is-in { color: var(--rd-green); }
.rd-ledger b.is-out { color: var(--rd-ink); }

/* ---------- Account ---------- */
.rd-profile {
    text-align: center;
}

.rd-profile img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
}

.rd-profile p {
    margin: 0 0 12px;
    color: var(--rd-muted);
}

.rd-profile__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.rd-profile__stats div {
    display: grid;
    padding: 10px;
    border-radius: 12px;
    background: var(--rd-soft);
}

.rd-profile__stats small {
    font-size: 11.5px;
    color: var(--rd-muted);
}

.rd-links {
    display: grid;
    padding: 6px 18px;
}

.rd-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: none;
    color: var(--rd-ink);
    font: 500 15px Poppins, sans-serif;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.rd-link:last-child {
    border-bottom: 0;
}

.rd-link i {
    width: 22px;
    color: var(--rd-navy-2);
}

.rd-tip {
    font-size: 13px;
    color: var(--rd-muted);
    padding: 0 4px;
}

@media (min-width: 700px) {
    .rd-main {
        margin-top: 22px;
    }
}

@media (max-width: 380px) {
    .rd-row {
        grid-template-columns: 1fr;
    }
}
