/* =====================================================================
   home.css — Customer Portal home (logged-in, booking-app layout)
   Spacing scale: 4 / 8 / 12 / 16 / 24 / 32. Page gutter 16 (phone) / 24.
   ===================================================================== */

/* ---------- shared utilities used by trips/home JS ---------- */
.skeleton {
    display: block; border-radius: var(--radius-8);
    background: linear-gradient(90deg, var(--surface-3) 25%, color-mix(in srgb, var(--surface-3) 60%, #fff) 37%, var(--surface-3) 63%);
    background-size: 400% 100%; animation: ant-shimmer 1.4s ease infinite;
}
@keyframes ant-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-3); color: var(--text-muted); }
.status-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill--info { background: #DCE8FF; color: #0F2F8F; }
.home-active__card .status-pill { background: rgba(255,255,255,.16); color: #fff; }
.status-pill--success { background: var(--success-100); color: #0B6B4B; }
.status-pill--warning { background: var(--warning-100); color: #7A5200; }
.status-pill--error { background: var(--error-100); color: #A32424; }
[data-theme="dark"] .status-pill--info { background: #12246B; color: #BFD4FF; }
[data-theme="dark"] .status-pill--success { background: #0F3B33; color: #7FE3BF; }
[data-theme="dark"] .status-pill--warning { background: #4A3A12; color: #FFD98A; }
[data-theme="dark"] .status-pill--error { background: #4A1D24; color: #FFB4B4; }

/* ---------- layout ---------- */
.hm-container { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 16px; }
.hm-body { display: grid; gap: 32px; padding-bottom: 40px; }
.home-section { display: grid; gap: 16px; }
.home-section[hidden] { display: none; }
.home-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-section__title { margin: 0; color: var(--text); font-size: 1.125rem; font-weight: 800; letter-spacing: -.01em; }
.home-section__link { font-weight: 700; font-size: .875rem; color: var(--link); padding: 4px 0; }

/* ---------- greeting band ---------- */
.hm-hero { position: relative; padding: 24px 0 80px; color: #fff; overflow: hidden; }
.hm-hero__bg {
    position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(520px 280px at 90% 0%, rgba(56,189,248,.32), transparent 70%),
        radial-gradient(420px 280px at 0% 100%, rgba(37,99,235,.45), transparent 70%),
        linear-gradient(160deg, #02061A 0%, #071340 50%, #0E2A85 100%);
}
.hm-hero__bg::after {
    content: ""; position: absolute; width: 320px; height: 320px; right: -120px; top: -140px;
    border-radius: 50%; border: 1px solid rgba(125,211,252,.18);
}
.hm-hero__inner { position: relative; z-index: 1; display: grid; gap: 4px; }
.hm-hero__greet { margin: 0; min-height: 1.5rem; font-size: .9375rem; font-weight: 600; color: var(--sky-300); }
.hm-hero__greet.is-loading { opacity: .5; }
.home-hero__greet-skeleton { width: 8rem; height: 1rem; }
.hm-hero__title { margin: 0; color: #fff; font-size: 1.875rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }

/* ---------- booking card (overlaps the band) ---------- */
.hm-quick {
    position: relative; z-index: 2; margin-top: -56px;
    display: grid; gap: 16px; padding: 20px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 24px;
    box-shadow: 0 20px 48px rgba(7,19,64,.22);
}
[data-theme="dark"] .hm-quick { background: #0B1536; border-color: #1B2B5E; box-shadow: 0 20px 48px rgba(0,0,0,.5); }
.hm-quick__title { margin: 0; font-size: 1rem; font-weight: 800; color: var(--text); }
.hm-quick__grid { display: grid; gap: 16px; }

/* route: timeline rail + two stacked inputs */
.hm-route {
    position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: stretch;
    background: #F1F5FD; border: 1.5px solid #E1E8F8; border-radius: 16px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.hm-route:focus-within { background: #fff; border-color: var(--blue-400); box-shadow: 0 0 0 4px rgba(59,130,246,.16); }
[data-theme="dark"] .hm-route { background: #071033; border-color: #1B2B5E; }
[data-theme="dark"] .hm-route:focus-within { background: #0B1A4A; }
.hm-route__rail { display: flex; flex-direction: column; align-items: center; padding: 28px 0 28px 16px; width: 28px; }
.hm-route__dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.hm-route__dot--from { background: var(--map-pickup); box-shadow: 0 0 0 4px rgba(31,169,122,.18); }
.hm-route__dot--to { background: var(--map-drop); border-radius: 3px; box-shadow: 0 0 0 4px rgba(225,75,75,.16); }
.hm-route__line { flex: 1 1 auto; width: 0; margin: 6px 0; border-left: 2px dotted #9FB2DE; }
[data-theme="dark"] .hm-route__line { border-color: #3A4F86; }
.hm-route__fields { display: grid; padding-right: 64px; }
.hm-input { display: grid; gap: 2px; align-content: center; min-height: 66px; padding: 10px 0 10px 12px; cursor: text; }
.hm-input + .hm-input { border-top: 1px solid #DCE5F8; }
[data-theme="dark"] .hm-input + .hm-input { border-top-color: #1B2B5E; }
.hm-input__label { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #4A5A85; }
[data-theme="dark"] .hm-input__label { color: #A9B8DA; }
.hm-input__control {
    width: 100%; min-height: 24px; padding: 0; border: 0; border-radius: 0; outline: 0; background: transparent;
    font: inherit; font-size: 1rem; font-weight: 700; color: var(--text); text-overflow: ellipsis;
    appearance: none; -webkit-appearance: none;
}
.hm-input__control:focus, .hm-input__control:focus-visible { box-shadow: none; border: 0; }
.hm-input__control::placeholder { color: #7C8BB0; font-weight: 600; }
.hm-swap {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; 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,.12); transition: transform .25s, background .15s;
}
.hm-swap i { transform: rotate(90deg); font-size: .8rem; }
.hm-swap:hover { transform: translateY(-50%) rotate(180deg); background: #EEF3FF; }
[data-theme="dark"] .hm-swap { background: #0B1536; border-color: #243357; }
[data-theme="dark"] .hm-swap:hover { background: #12246B; }

/* when: quick date pills + date/time + CTA */
.hm-when { display: grid; gap: 12px; align-content: start; }
.hm-chiprow { display: flex; gap: 8px; }
.hm-pill {
    min-height: 36px; padding: 0 16px; border-radius: 999px; cursor: pointer;
    border: 1.5px solid #D6E1F8; background: transparent; color: var(--text);
    font: inherit; font-size: .8125rem; font-weight: 700; transition: all .15s;
}
.hm-pill:hover { border-color: var(--blue-400); }
.hm-pill.is-active { background: var(--blue-400); border-color: var(--blue-400); color: #fff; }
[data-theme="dark"] .hm-pill { border-color: #243357; }
[data-theme="dark"] .hm-pill.is-active { background: #2563EB; border-color: #2563EB; }
.hm-when__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hm-field {
    display: flex; align-items: center; gap: 12px; min-height: 60px; min-width: 0; padding: 8px 12px; cursor: pointer;
    background: #F1F5FD; border: 1.5px solid #E1E8F8; border-radius: 16px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.hm-field:hover { border-color: #93B4F5; }
.hm-field:focus-within { background: #fff; border-color: var(--blue-400); box-shadow: 0 0 0 4px rgba(59,130,246,.16); }
[data-theme="dark"] .hm-field { background: #071033; border-color: #1B2B5E; }
[data-theme="dark"] .hm-field:focus-within { background: #0B1A4A; }
.hm-field__icon { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #E1EAFD; color: var(--navy-500); font-size: .875rem; }
[data-theme="dark"] .hm-field__icon { background: #12246B; color: var(--sky-300); }
.hm-field__body { display: grid; flex: 1 1 auto; min-width: 0; }
.hm-field__label { font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #4A5A85; }
[data-theme="dark"] .hm-field__label { color: #A9B8DA; }
.hm-field__input {
    width: 100%; min-height: 24px; padding: 0; border: 0; border-radius: 0; outline: 0; background: transparent;
    font: inherit; font-size: .9375rem; font-weight: 700; color: var(--text); appearance: none; -webkit-appearance: none;
}
.hm-field__input:focus-visible { box-shadow: none; }
.hm-quick__go {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
    min-height: 56px; padding: 0 24px; border: 0; border-radius: 16px; cursor: pointer;
    background: var(--gradient-cta); color: #fff; font: inherit; font-weight: 800; font-size: 1.0625rem;
    box-shadow: var(--shadow-glow); transition: transform .15s, box-shadow .2s;
}
.hm-quick__go:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(37,99,235,.5); }
.hm-quick__go:active { transform: translateY(0) scale(.99); }
.hm-quick__go i { transition: transform .2s; }
.hm-quick__go:hover i { transform: translateX(4px); }

/* ---------- services ---------- */
.hm-services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hm-service {
    display: grid; justify-items: center; align-content: start; gap: 8px; padding: 16px 4px 12px; min-width: 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px; cursor: pointer;
    font: inherit; color: var(--text); text-align: center;
    box-shadow: 0 4px 14px rgba(7,19,64,.06); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.hm-service:hover { transform: translateY(-3px); border-color: var(--blue-400); box-shadow: 0 12px 26px rgba(19,64,184,.16); }
.hm-service__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; font-size: 1.15rem; }
.hm-tone-1 { background: #E1EAFD; color: #1340B8; }
.hm-tone-2 { background: #DCF5EC; color: #0B6B4B; }
.hm-tone-3 { background: #E0F4FE; color: #0369A1; }
.hm-tone-4 { background: #FDF1DB; color: #8A5A00; }
[data-theme="dark"] .hm-tone-1 { background: #12246B; color: #BFD4FF; }
[data-theme="dark"] .hm-tone-2 { background: #0F3B33; color: #7FE3BF; }
[data-theme="dark"] .hm-tone-3 { background: #0C3550; color: #7DD3FC; }
[data-theme="dark"] .hm-tone-4 { background: #4A3A12; color: #FFD98A; }
.hm-service__name { font-family: var(--font-display); font-size: .8125rem; font-weight: 800; line-height: 1.25; color: var(--text); }
.hm-service__desc { display: none; font-size: .75rem; line-height: 1.35; color: var(--text-muted); padding-inline: 8px; }

/* ---------- active trip ---------- */
.home-active__placeholder { height: 148px; border-radius: 20px; }
.home-active__card {
    display: grid; gap: 16px; padding: 20px; border-radius: 20px; color: #fff;
    background: linear-gradient(135deg, var(--navy-950), var(--navy-600));
    border: 1px solid rgba(125,211,252,.22); box-shadow: 0 16px 36px rgba(7,19,64,.35);
}
.home-active__card:hover { text-decoration: none; }
.home-active__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-active__ref { font-size: .8125rem; font-weight: 700; opacity: .8; }
.home-stepper { display: flex; gap: 4px; }
.home-stepper__seg { flex: 1 1 0; height: 6px; border-radius: 999px; background: rgba(255,255,255,.18); }
.home-stepper__seg.is-done { background: linear-gradient(90deg, #3B82F6, var(--sky-300)); }
.home-active__route { display: grid; gap: 12px; }
.home-active__stop { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 700; }
.home-active__pin { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--map-pickup); box-shadow: 0 0 0 4px rgba(31,169,122,.25); }
.home-active__pin--drop { background: var(--map-drop); border-radius: 3px; box-shadow: 0 0 0 4px rgba(225,75,75,.25); }
.home-active__addr { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-active__view { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.14); font-weight: 700; color: var(--sky-300); }

/* ---------- place chips ---------- */
.home-chips { display: flex; gap: 8px; overflow-x: auto; margin-inline: -16px; padding: 4px 16px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.home-chips::-webkit-scrollbar { display: none; }
.home-chip {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; scroll-snap-align: start;
    border: 1.5px solid #D6E1F8; border-radius: 999px; background: var(--surface); color: var(--text);
    font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; transition: all .15s;
}
.home-chip:hover { background: linear-gradient(120deg, var(--navy-600), var(--blue-400)); color: #fff; border-color: transparent; transform: translateY(-2px); }
.home-chip i { color: var(--link); }
.home-chip:hover i { color: #fff; }
[data-theme="dark"] .home-chip { border-color: #243357; }
[data-theme="dark"] .home-chip i, [data-theme="dark"] .home-section__link { color: var(--sky-300); }
#home-places-section[hidden] { display: none; }

/* ---------- recent trips ---------- */
.home-recent { display: grid; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: 0 4px 14px rgba(7,19,64,.06); }
.home-recent__skeleton { height: 72px; border-radius: 0; }
.home-recent__empty { margin: 0; padding: 24px 16px; text-align: center; color: var(--text-muted); }
.home-recent__item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.home-recent__item + .home-recent__item { border-top: 1px solid var(--border); }
.home-recent__link { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; padding: 4px 0; color: var(--text); }
.home-recent__link:hover { text-decoration: none; }
.home-recent__icon { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #E1EAFD; color: var(--navy-500); font-size: .9rem; }
.home-recent__icon[data-token="success"] { background: var(--success-100); color: #0B6B4B; }
.home-recent__icon[data-token="warning"] { background: var(--warning-100); color: #7A5200; }
.home-recent__icon[data-token="error"] { background: var(--error-100); color: #A32424; }
.home-recent__icon[data-token="neutral"] { background: var(--surface-3); color: var(--text-muted); }
[data-theme="dark"] .home-recent__icon { background: #12246B; color: #BFD4FF; }
[data-theme="dark"] .home-recent__icon[data-token="success"] { background: #0F3B33; color: #7FE3BF; }
[data-theme="dark"] .home-recent__icon[data-token="warning"] { background: #4A3A12; color: #FFD98A; }
[data-theme="dark"] .home-recent__icon[data-token="error"] { background: #4A1D24; color: #FFB4B4; }
.home-recent__body { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.home-recent__route { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--text); }
.home-recent__route i { margin: 0 4px; font-size: .7rem; color: var(--link); }
[data-theme="dark"] .home-recent__route i { color: var(--sky-300); }
.home-recent__meta { font-size: .8125rem; color: var(--text-muted); }
.home-recent__side { display: grid; justify-items: end; gap: 6px; flex: 0 0 auto; }
.home-recent__amount { font-weight: 800; white-space: nowrap; color: var(--navy-500); }
[data-theme="dark"] .home-recent__amount { color: var(--sky-300); }
.home-recent__again {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; cursor: pointer;
    border: 1.5px solid #D6E1F8; border-radius: 999px; background: transparent; color: var(--link);
    font: inherit; font-size: .75rem; font-weight: 800; transition: all .15s;
}
.home-recent__again:hover { background: var(--blue-400); border-color: var(--blue-400); color: #fff; }
[data-theme="dark"] .home-recent__again { border-color: #243357; color: var(--sky-300); }

/* ---------- why us ---------- */
.hm-why { display: grid; grid-template-columns: 1fr; gap: 12px; }
.hm-why__item { display: flex; align-items: flex-start; gap: 16px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.hm-why__item > i { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--navy-700), var(--blue-400)); color: #fff; font-size: 1.05rem; }
.hm-why__item h3 { margin: 0 0 2px; font-size: .9375rem; font-weight: 800; color: var(--text); }
.hm-why__item p { margin: 0; font-size: .8125rem; color: var(--text-muted); }

/* ---------- support ---------- */
.hm-support {
    position: relative; overflow: hidden; display: grid; gap: 16px; padding: 24px; border-radius: 24px; color: #fff;
    background: radial-gradient(360px 180px at 100% 0%, rgba(56,189,248,.32), transparent 70%), linear-gradient(135deg, #02061A, #0E2A85);
    box-shadow: 0 16px 36px rgba(7,19,64,.3);
}
.home-support__title { margin: 0; font-size: 1.125rem; font-weight: 800; color: #fff; }
.home-support__sub { margin: 4px 0 0; color: rgba(255,255,255,.85); font-size: .9375rem; }
.home-support__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; width: 100%; }
.hm-support__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 48px; padding: 0 16px; white-space: nowrap;
    border-radius: 14px; background: rgba(255,255,255,.12); border: 1px solid rgba(125,211,252,.3); color: #fff; font-weight: 700; transition: all .15s;
}
.hm-support__btn:hover { background: var(--gradient-cta); border-color: transparent; text-decoration: none; transform: translateY(-2px); }

/* ---------- very small phones ---------- */
@media (max-width: 380px) {
    .hm-hero__title { font-size: 1.625rem; }
    .hm-quick { padding: 16px; }
    .hm-service__name { font-size: .75rem; }
}

/* ---------- tablet & up ---------- */
@media (min-width: 720px) {
    .hm-container { padding-inline: 24px; }
    .hm-body { gap: 40px; padding-bottom: 56px; }
    .hm-hero { padding: 40px 0 96px; }
    .hm-hero__title { font-size: 2.5rem; }
    .hm-quick { margin-top: -64px; padding: 24px; gap: 20px; }
    .hm-quick__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
    .home-section__title { font-size: 1.25rem; }
    .hm-services { gap: 16px; }
    .hm-service { padding: 20px 12px 16px; gap: 8px; }
    .hm-service__desc { display: block; }
    .hm-service__name { font-size: .9375rem; }
    .home-chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
    .hm-why { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .hm-support { grid-template-columns: 1fr auto; align-items: center; padding: 28px 32px; }
    .home-support__actions { display: flex; flex-wrap: nowrap; width: auto; }
    .hm-support__btn { flex: 0 0 auto; }
    .home-recent__item { padding: 12px 24px; }
}
@media (min-width: 1024px) {
    .hm-why { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hm-why__item { flex-direction: column; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .skeleton, .home-recent__skeleton { animation: none; }
    .hm-service, .home-recent__again, .hm-quick__go, .home-chip, .hm-swap, .hm-pill { transition: none; }
}

.hm-quick__hint { margin: 0; font-size: .875rem; line-height: 1.45; color: #3F4D6B; }
[data-theme="dark"] .hm-quick__hint { color: #B9C6E6; }
