/* =====================================================================
   rapido.css - Rapido-inspired redesign layer for the Customer Portal
   Loaded AFTER the base page stylesheets on landing / login / home / book.
   Map-first layouts, chunky touch targets, floating search card and
   bottom sheets. Scoped with body[data-page="..."] so other signed-in
   pages (trips, profile, trip details) keep their existing look.
   ===================================================================== */

:root {
    --rp-yellow: #FFD11A;
    --rp-yellow-600: #F2B705;
    --rp-ink: #101010;
    --rp-ink-soft: #2A2A2A;
    --rp-launch: linear-gradient(120deg, #FFD11A, #FFB300);
    --rp-glow: 0 12px 28px rgba(255, 177, 0, 0.42);
    --rp-card-shadow: 0 18px 46px rgba(7, 19, 64, 0.16);
}

/* =====================================================================
   Shared Rapido primitives
   ===================================================================== */

/* Rounder, chunkier buttons everywhere on the redesigned pages */
.rp-app .ant-btn,
.rp-app .customer-btn,
.rp-app .btn { border-radius: 16px; }

/* Yellow launch button: the single, unmistakable primary action */
.rp-launch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 0 24px;
    border: 0;
    border-radius: 18px;
    background: var(--rp-launch);
    color: var(--rp-ink);
    font: inherit;
    font-weight: 800;
    font-size: 1.0625rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: var(--rp-glow);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.15s ease;
}
.rp-launch:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(255, 177, 0, 0.5); text-decoration: none; }
.rp-launch:active { transform: translateY(0) scale(0.99); }
.rp-launch:disabled { opacity: 0.5; box-shadow: none; cursor: not-allowed; transform: none; }
.rp-launch i { transition: transform 0.2s ease; }
.rp-launch:hover i { transform: translateX(4px); }

/* Route rail card: pickup + drop with the connecting timeline */
.rp-route {
    position: relative;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: stretch;
    background: #F3F6FC;
    border: 1.5px solid #E3E9F6;
    border-radius: 18px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.rp-route:focus-within { background: #fff; border-color: var(--blue-400); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16); }
[data-theme="dark"] .rp-route { background: #0A1330; border-color: #1B2B5E; }
[data-theme="dark"] .rp-route:focus-within { background: #0D1838; }
.rp-route__rail { display: flex; flex-direction: column; align-items: center; padding: 26px 0; }
.rp-route__dot { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; }
.rp-route__dot--from { background: var(--map-pickup); box-shadow: 0 0 0 4px rgba(31, 169, 122, 0.18); }
.rp-route__dot--to { background: var(--map-drop); border-radius: 3px; box-shadow: 0 0 0 4px rgba(225, 75, 75, 0.16); }
.rp-route__line { flex: 1 1 auto; width: 0; margin: 6px 0; border-left: 2px dotted #9FB2DE; }
[data-theme="dark"] .rp-route__line { border-color: #3A4F86; }
.rp-route__fields { display: grid; min-width: 0; padding-right: 54px; }
.rp-field { display: grid; gap: 2px; align-content: center; min-height: 68px; padding: 10px 0 10px 12px; cursor: text; }
.rp-field + .rp-field { border-top: 1px solid #DFE7F6; }
[data-theme="dark"] .rp-field + .rp-field { border-top-color: #1B2B5E; }
.rp-field__label { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #4A5A85; }
[data-theme="dark"] .rp-field__label { color: #A9B8DA; }
.rp-field__control {
    width: 100%;
    min-height: 24px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    text-overflow: ellipsis;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.rp-field__control:focus, .rp-field__control:focus-visible { box-shadow: none; border: 0; }
.rp-field__control::placeholder { color: #7C8BB0; font-weight: 600; }
.rp-field__meta { font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-field__pin { width: 12px; height: 12px; }

.rp-swap {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 50%;
    border: 1.5px solid #D3DFFA;
    background: var(--surface);
    color: var(--link);
    box-shadow: 0 4px 12px rgba(7, 19, 64, 0.12);
    transition: transform 0.25s, background 0.15s;
}
.rp-swap i { transform: rotate(90deg); font-size: 0.8rem; }
.rp-swap:hover { transform: translateY(-50%) rotate(180deg); background: #EEF3FF; }
[data-theme="dark"] .rp-swap { background: #0B1536; border-color: #243357; }

/* Quick date pills */
.rp-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-pill {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    cursor: pointer;
    border: 1.5px solid #D6E1F8;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    transition: all 0.15s;
}
.rp-pill:hover { border-color: var(--blue-400); }
.rp-pill.is-active { background: var(--rp-ink); border-color: var(--rp-ink); color: #fff; }
[data-theme="dark"] .rp-pill { border-color: #243357; }

/* Bottom-sheet grabber */
.rp-grabber { display: block; width: 44px; height: 4px; margin: 0 auto 12px; border-radius: 999px; background: #C9D4EA; }
[data-theme="dark"] .rp-grabber { background: #2C3F7A; }

/* =====================================================================
   HOME - map-first search screen
   ===================================================================== */
body[data-page="home"] { background: #E9EFFA; padding-bottom: 0; }
[data-theme="dark"] body[data-page="home"] { background: #050B22; }

.rp-home { position: relative; display: block; }
.rp-home__map {
    position: relative;
    z-index: 0;
    isolation: isolate;
    height: 52vh;
    min-height: 320px;
    max-height: 520px;
    overflow: hidden;
    background: #CFE0F5;
}
.rp-home__map #rp-home-map { position: absolute; inset: 0; pointer-events: none; }
.rp-home__map::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 90px;
    background: linear-gradient(180deg, transparent, #E9EFFA);
    pointer-events: none;
    z-index: 2;
}
[data-theme="dark"] .rp-home__map::after { background: linear-gradient(180deg, transparent, #050B22); }
.rp-home__greet {
    position: absolute;
    top: 12px;
    left: 16px;
    right: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: calc(100% - 32px);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(16, 16, 16, 0.72);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.rp-home__greet i { color: var(--rp-yellow); }
.rp-home__locate {
    position: absolute;
    right: 16px;
    top: 56px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    color: var(--brand);
    box-shadow: var(--shadow-2);
    cursor: pointer;
}
.rp-home__locate.is-busy { animation: rp-spin 1s linear infinite; }
@keyframes rp-spin { to { transform: rotate(360deg); } }

.rp-home__sheet {
    position: relative;
    z-index: 2;
    margin-top: -30px;
    padding: 14px 16px calc(96px + env(safe-area-inset-bottom, 0px));
    background: #E9EFFA;
    border-radius: 28px 28px 0 0;
}
[data-theme="dark"] .rp-home__sheet { background: #050B22; }
.rp-home__title { margin: 4px 4px 14px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }

.rp-search {
    display: grid;
    gap: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--rp-card-shadow);
}
[data-theme="dark"] .rp-search { box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5); }
.rp-search .rp-route { background: #F3F6FC; }
.rp-search__hint { margin: 0; font-size: 0.8125rem; line-height: 1.45; color: var(--text-muted); }

.rp-home__sections { display: grid; gap: 28px; margin-top: 28px; }

/* Reuse the existing home section markup, light restyle */
body[data-page="home"] .home-section__title { font-size: 1.125rem; }
body[data-page="home"] .hm-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) {
    body[data-page="home"] .hm-services { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Desktop: two-column map + search */
@media (min-width: 900px) {
    .rp-home__map { height: 62vh; max-height: 640px; }
    .rp-home__sheet { margin-top: -44px; padding-left: 24px; padding-right: 24px; }
    .rp-home__inner { max-width: 960px; margin: 0 auto; }
}

/* =====================================================================
   BOOK - map-first booking sheet
   ===================================================================== */
body[data-page="book"] {
    background: #E9EFFA;
    padding-bottom: 0;
}
[data-theme="dark"] body[data-page="book"] { background: #050B22; }

body[data-page="book"] .ant-main--book { padding: 0; }
body[data-page="book"] .book-container { max-width: 1120px; margin: 0 auto; padding: 0 0 150px; }

body[data-page="book"] .book-layout { display: flex; flex-direction: column; gap: 0; }

/* Map becomes the hero on phones */
body[data-page="book"] .book-map-col {
    order: -1;
    position: relative;
    top: 0;
    height: 46vh;
    min-height: 300px;
    border-radius: 0 0 28px 28px;
    border: 0;
    box-shadow: 0 18px 40px rgba(7, 19, 64, 0.18);
    overflow: hidden;
    background: #CFE0F5;
}
body[data-page="book"] .book-map-col__expand {
    top: 14px;
    right: 14px;
    background: rgba(16, 16, 16, 0.72);
    color: #fff;
    border: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
body[data-page="book"] .book-map-col.is-expanded { position: fixed; inset: 0; z-index: 65; height: auto; border-radius: 0; }

/* Form becomes the sheet that slides over the map */
body[data-page="book"] .book-form-col {
    position: relative;
    z-index: 2;
    margin-top: -28px;
    padding: 16px 16px 24px;
    background: #E9EFFA;
    border: 0;
    box-shadow: none;
    border-radius: 28px 28px 0 0;
}
[data-theme="dark"] body[data-page="book"] .book-form-col { background: #050B22; }

body[data-page="book"] .book-form {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--rp-card-shadow);
}
[data-theme="dark"] body[data-page="book"] .book-form { box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5); }

body[data-page="book"] .book-progress { background: transparent; border: 0; box-shadow: none; padding: 0 0 12px; margin: 0; }
body[data-page="book"] .book-progress__bar { height: 6px; background: #DCE5F8; }
body[data-page="book"] .book-progress__fill { background: var(--rp-launch); }
body[data-page="book"] .book-progress__meta { font-size: 0.8125rem; }

body[data-page="book"] .book-step__title { font-size: 1.375rem; }
body[data-page="book"] .book-step__sub { margin-bottom: 18px; }

body[data-page="book"] .route-field { min-height: 60px; border-radius: 18px; }
body[data-page="book"] .route-field__map { background: var(--rp-yellow); color: var(--rp-ink); }

/* Action bar: yellow launch button */
body[data-page="book"] .book-actionbar {
    bottom: 64px;
    z-index: 58;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -16px 40px rgba(7, 19, 64, 0.14);
}
body[data-page="book"] .book-actionbar__next {
    background: var(--rp-launch);
    color: var(--rp-ink);
    border: 0;
    border-radius: 16px;
    box-shadow: var(--rp-glow);
    font-weight: 800;
}
body[data-page="book"] .book-actionbar__next * { color: inherit; }
body[data-page="book"] .book-actionbar__next:disabled { box-shadow: none; }

@media (min-width: 900px) {
    body[data-page="book"] .book-container { padding: 24px 24px 120px; }
    body[data-page="book"] .book-layout { flex-direction: row; align-items: flex-start; gap: 32px; }
    body[data-page="book"] .book-form-col { order: 0; flex: 1 1 52%; margin-top: 0; padding: 0; background: transparent; border-radius: 0; }
    body[data-page="book"] .book-map-col {
        order: 0;
        flex: 1 1 48%;
        height: calc(100vh - 160px);
        min-height: 480px;
        max-height: 760px;
        border-radius: 24px;
        position: sticky;
        top: 84px;
        box-shadow: var(--shadow-2);
    }
    body[data-page="book"] .book-actionbar { bottom: 0; }
    body[data-page="book"] .book-actionbar__next { margin-left: auto; min-width: 240px; }
}

/* =====================================================================
   LANDING - Rapido-style hero
   ===================================================================== */
body[data-page="landing"] { background: var(--surface-2); }

.rp-landing-hero {
    position: relative;
    overflow: hidden;
    padding: 36px 0 56px;
    color: #fff;
    background:
        radial-gradient(640px 360px at 88% -10%, rgba(255, 209, 26, 0.22), transparent 66%),
        radial-gradient(560px 380px at 0% 110%, rgba(37, 99, 235, 0.5), transparent 70%),
        linear-gradient(160deg, #02061A 0%, #071340 52%, #0E2A85 100%);
}
.rp-landing-hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 28px;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: center;
}
.rp-landing-hero__title {
    margin: 0 0 12px;
    font-size: clamp(2.1rem, 6.5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: #fff;
}
.rp-landing-hero__lead { margin: 0 0 20px; max-width: 34rem; font-size: 1.0625rem; color: rgba(255, 255, 255, 0.9); }
.rp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1A1400;
    background: var(--rp-yellow);
}
.rp-eyebrow i { color: #1A1400; }

.rp-landing-quick {
    padding: 20px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.98);
    color: #0F172A;
    box-shadow: 0 30px 70px rgba(2, 6, 26, 0.5), 0 0 0 6px rgba(255, 209, 26, 0.14);
}
[data-theme="dark"] .rp-landing-quick { background: #0B1536; color: #E7ECF7; }
.rp-landing-quick__title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 1.15rem; font-weight: 800; color: inherit; }
.rp-landing-quick__title i { color: var(--rp-yellow-600); }

/* =====================================================================
   LOGIN - crisp app-style auth card
   ===================================================================== */
body[data-page="login"] .auth-page {
    background:
        radial-gradient(560px 340px at 100% 0%, rgba(255, 209, 26, 0.16), transparent 62%),
        radial-gradient(620px 420px at 0% 100%, rgba(37, 99, 235, 0.45), transparent 70%),
        linear-gradient(160deg, #02061A 0%, #071340 55%, #0E2A85 100%);
}
body[data-page="login"] .auth-card { border-radius: 26px; }
body[data-page="login"] .auth-card__title { font-size: 1.75rem; }
body[data-page="login"] .auth-submit {
    background: var(--rp-launch);
    color: var(--rp-ink);
    border-radius: 16px;
    box-shadow: var(--rp-glow);
    font-weight: 800;
}
body[data-page="login"] .auth-submit .auth-submit__label { color: inherit; }
body[data-page="login"] .auth-submit .ant-spinner { border-color: rgba(0, 0, 0, 0.25); border-top-color: var(--rp-ink); }

@media (prefers-reduced-motion: reduce) {
    .rp-launch, .rp-pill, .rp-swap { transition: none; }
    .rp-home__locate.is-busy { animation: none; }
}
