/*
 * Onboarding tours (public/js/mh-tour.js): the tour card, spotlight, bottom sheet, top-bar menu and "Take a tour" link.
 * Colours are custom properties. The defaults are Meet Hour's (the dashboard's navy, as .btn-primary / .bg-theme-1);
 * on agency hosts mh-tour.js sets them from the tenant brand (BrandTheme).
 */
:root {
    --mh-tour-band1: #4b6790;
    --mh-tour-band2: #34496b;
    --mh-tour-band-text: #ffffff;
    --mh-tour-accent: #4b6790;
    --mh-tour-accent-text: #ffffff;
    --mh-tour-accent-hover: #3d5577;
    --mh-tour-art: #f0705f;
    --mh-tour-link: #4b6790;
    --mh-tour-ink: #1e293b;
    --mh-tour-muted: #64748b;
    --mh-tour-line: #e2e8f0;
    --mh-tour-surface: #ffffff;
    --mh-tour-body-bg: #ffffff;
    --mh-tour-radius: 18px;
    --mh-tour-shadow: 0 24px 60px rgba(15, 23, 42, .28), 0 4px 12px rgba(15, 23, 42, .10);
}

.mh-tour {
    position: fixed;
    inset: 0;
    /* Above the accessibility widget's button (.asw-menu-btn, z-index 500000), which covered the bottom sheet. */
    z-index: 600000;
    pointer-events: none;
    font-family: inherit;
    line-height: 1.5;
}

.mh-tour *,
.mh-tour *::before,
.mh-tour *::after {
    box-sizing: border-box;
}

.mh-tour [hidden],
.mh-tour-menu [hidden] {
    display: none !important;
}

.mh-tour__blocker {
    position: fixed;
    inset: 0;
    pointer-events: auto;
    background: transparent;
}

.mh-tour--centered .mh-tour__blocker {
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(1.5px);
}

.mh-tour__spot {
    position: fixed;
    display: none;
    border-radius: 14px;
    box-shadow: 0 0 0 3px var(--mh-tour-surface), 0 0 0 6px var(--mh-tour-band1), 0 0 0 9999px rgba(15, 23, 42, .55);
    pointer-events: none;
    transition: left .2s ease, top .2s ease, width .2s ease, height .2s ease;
}

.mh-tour__card {
    position: fixed;
    width: 360px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    overflow: visible;
    background: var(--mh-tour-body-bg);
    color: var(--mh-tour-ink);
    border-radius: var(--mh-tour-radius);
    box-shadow: var(--mh-tour-shadow);
    pointer-events: auto;
    outline: none;
    text-align: start;
    animation: mh-tour-in .2s ease-out;
}

.mh-tour--centered .mh-tour__card {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
    animation: none;
}

@keyframes mh-tour-in {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: none; }
}

/* Arrow (the card's side facing the target). */
.mh-tour__arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    transform: translate(-50%, -50%) rotate(45deg);
    display: none;
}

.mh-tour__card[data-side="bottom"] .mh-tour__arrow { display: block; top: 0; background: var(--mh-tour-band1); }
.mh-tour__card[data-side="top"] .mh-tour__arrow { display: block; top: 100%; background: var(--mh-tour-body-bg); }
.mh-tour__card[data-side="right"] .mh-tour__arrow { display: block; left: 0; background: var(--mh-tour-band2); }
.mh-tour__card[data-side="left"] .mh-tour__arrow { display: block; left: 100%; background: var(--mh-tour-band2); }

/* Brand band: logo, close, the page's illustration and a progress bar. */
.mh-tour__band {
    position: relative;
    overflow: hidden;
    padding: 14px 16px 0;
    border-radius: var(--mh-tour-radius) var(--mh-tour-radius) 0 0;
    background: linear-gradient(160deg, var(--mh-tour-band1) 0%, var(--mh-tour-band2) 100%);
    color: var(--mh-tour-band-text);
}

/* Soft decorative circles, as the dashboard's side menu. */
.mh-tour__band::before,
.mh-tour__band::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: currentColor;
    opacity: .07;
    pointer-events: none;
}

.mh-tour__band::before { width: 180px; height: 180px; top: -90px; inset-inline-end: -60px; }
.mh-tour__band::after { width: 120px; height: 120px; bottom: -70px; inset-inline-start: -40px; }

.mh-tour__head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 30px;
}

.mh-tour__brand {
    display: inline-flex;
    align-items: center;
    max-width: 70%;
    height: 28px;
}

.mh-tour__brand--chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2px 6px rgba(15, 23, 42, .12);
}

.mh-tour__brand img {
    display: block;
    max-width: 100%;
    max-height: 22px;
    width: auto;
    height: auto;
}

.mh-tour__brand--chip img { max-height: 18px; }

.mh-tour__brand-name {
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    color: var(--mh-tour-band1);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mh-tour__art {
    position: relative;
    z-index: 1;
    padding: 6px 0 12px;
}

.mh-tour__art svg {
    display: block;
    width: 100%;
    max-width: 250px;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .22));
}

.mh-i-bg rect { fill: currentColor; opacity: .22; }
.mh-i-card { fill: #ffffff; }
.mh-i-raise { filter: drop-shadow(0 4px 6px rgba(15, 23, 42, .18)); }
.mh-i-soft { fill: #e6ebf3; }
.mh-i-line { fill: #cdd6e4; }
.mh-i-field { fill: #ffffff; stroke: #cdd6e4; stroke-width: 2; }
.mh-i-accent { fill: var(--mh-tour-art); }
.mh-i-brand { fill: var(--mh-tour-band1); }
.mh-i-stroke { fill: none; stroke: var(--mh-tour-art); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mh-i-thin { stroke: #cdd6e4; stroke-width: 2; }
.mh-i-mark { fill: none; stroke: #ffffff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mh-i-bold { stroke-width: 5; }
.mh-i-hand { fill: #ffffff; stroke: #334155; stroke-width: 2; stroke-linejoin: round; }

.mh-tour__close {
    flex: none;
    width: 30px;
    height: 30px;
    margin-inline-start: auto;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: inherit;
    font-size: 20px;
    line-height: 30px;
    cursor: pointer;
    transition: background-color .15s;
}

.mh-tour__close:hover,
.mh-tour__close:focus-visible {
    background: rgba(255, 255, 255, .30);
}

.mh-tour__progress {
    position: relative;
    z-index: 1;
    height: 4px;
    margin: 0 -16px;
    background: rgba(255, 255, 255, .22);
}

.mh-tour__progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--mh-tour-art);
    border-start-end-radius: 4px;
    border-end-end-radius: 4px;
    transition: width .25s ease;
}

/* Kept for scripts that look for them; the progress bar replaced the dots. */
.mh-tour__dots { display: none; }
.mh-tour__dot.is-active { opacity: 1; }

/* Text and buttons. */
.mh-tour__body {
    padding: 16px 20px 18px;
    border-radius: 0 0 var(--mh-tour-radius) var(--mh-tour-radius);
}

.mh-tour__sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.mh-tour__count {
    display: inline-block;
    margin: 0 0 6px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #eef2f8;
    color: var(--mh-tour-link);
    font-size: 11.5px;
    font-weight: 600;
}

.mh-tour__count:empty { display: none; }

.mh-tour__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--mh-tour-ink);
}

.mh-tour__text {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--mh-tour-muted);
    white-space: pre-line;
}

.mh-tour__footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.mh-tour__actions,
.mh-tour__confirm-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.mh-tour__actions { flex: 1 1 auto; justify-content: flex-end; }
.mh-tour__actions > .mh-tour__btn--text { margin-inline-end: auto; }

.mh-tour__confirm-actions > .mh-tour__btn {
    flex: 1 1 0;
    /* A label never breaks inside its button (long translations): the button grows, the row wraps. */
    min-width: fit-content;
}

.mh-tour__confirm-text {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--mh-tour-ink);
}

.mh-tour__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}

.mh-tour__btn--outline {
    background: var(--mh-tour-surface);
    color: var(--mh-tour-ink);
    border: 1px solid var(--mh-tour-line);
}

.mh-tour__btn--outline:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.mh-tour__btn--text {
    min-height: 32px;
    padding: 6px 4px;
    background: transparent;
    border: 0;
    color: var(--mh-tour-muted);
    font-weight: 500;
}

.mh-tour__btn--text:hover { color: var(--mh-tour-ink); text-decoration: underline; }

.mh-tour__btn--primary {
    background: var(--mh-tour-accent);
    color: var(--mh-tour-accent-text);
    border: 1px solid var(--mh-tour-accent);
    box-shadow: 0 6px 14px -6px var(--mh-tour-accent);
}

.mh-tour__btn--primary:hover {
    background: var(--mh-tour-accent-hover);
    border-color: var(--mh-tour-accent-hover);
}

.mh-tour__btn:focus-visible,
.mh-tour__mute input:focus-visible + span,
.mh-tour-menu__button:focus-visible,
.mh-tour-menu__item:focus-visible,
.mh-tour-link:focus-visible {
    outline: 3px solid var(--mh-tour-link);
    outline-offset: 2px;
}

/* "Don't show tours again". */
.mh-tour__mute {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px -20px -18px;
    padding: 10px 20px;
    border-top: 1px solid var(--mh-tour-line);
    border-radius: 0 0 var(--mh-tour-radius) var(--mh-tour-radius);
    background: #f8fafc;
    font-size: 13px;
    color: var(--mh-tour-muted);
    cursor: pointer;
    user-select: none;
}

.mh-tour__mute input {
    width: 16px;
    height: 16px;
    margin: 0;
    border-radius: 4px;
    accent-color: var(--mh-tour-accent);
    cursor: pointer;
}

/* Small screens: a bottom sheet. */
.mh-tour--sheet .mh-tour__card {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    max-height: 75vh;
    overflow-y: auto;
    border-radius: 22px 22px 0 0;
    transform: none;
    animation: mh-tour-up .2s ease-out;
}

.mh-tour--sheet .mh-tour__band { border-radius: 22px 22px 0 0; }
.mh-tour--sheet .mh-tour__art svg { max-width: 200px; }
.mh-tour--sheet .mh-tour__body { border-radius: 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
.mh-tour--sheet .mh-tour__mute { border-radius: 0; margin-bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.mh-tour--sheet .mh-tour__arrow { display: none !important; }

@keyframes mh-tour-up {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .mh-tour__card,
    .mh-tour__spot,
    .mh-tour__progress span { animation: none !important; transition: none !important; }
}

/* Top-bar menu. */
.mh-tour-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.mh-tour-menu--light { margin-inline-end: .75rem; }

.mh-tour-menu__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
}

.mh-tour-menu__button:hover,
.mh-tour-menu__button[aria-expanded="true"] {
    background: rgba(100, 116, 139, .14);
}

.mh-tour-menu--light .mh-tour-menu__button { color: #ffffff; }
.mh-tour-menu--light .mh-tour-menu__button:hover,
.mh-tour-menu--light .mh-tour-menu__button[aria-expanded="true"] { background: rgba(255, 255, 255, .18); }

.mh-tour-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 100040;
    width: 300px;
    max-width: calc(100vw - 24px);
    padding: 6px;
    background: var(--mh-tour-surface);
    color: var(--mh-tour-ink);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    text-align: start;
    font-size: 14px;
    line-height: 1.4;
}

.mh-tour-menu__panel[hidden] { display: none; }

.mh-tour-menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}

.mh-tour-menu__item:hover:not([disabled]),
.mh-tour-menu__item:focus-visible { background: #f1f5f9; color: inherit; }
.mh-tour-menu__item[disabled] { cursor: default; color: #94a3b8; }
.mh-tour-menu__item--strong { font-weight: 600; color: var(--mh-tour-link); }

.mh-tour-menu__label {
    padding: 10px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #64748b;
}

.mh-tour-menu__list { max-height: 260px; overflow-y: auto; }
.mh-tour-menu__empty { padding: 6px 10px; color: #94a3b8; }
.mh-tour-menu__check { flex: none; color: #16a34a; font-weight: 700; }
.mh-tour-menu__sep { height: 1px; margin: 6px 4px; background: #e2e8f0; }
.mh-tour-menu__note { padding: 0 10px; font-size: 12px; color: #16a34a; }
.mh-tour-menu__note:empty { display: none; }

.mh-tour-menu__toggle { position: relative; }
.mh-tour-menu__toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.mh-tour-menu__switch {
    position: relative;
    flex: none;
    width: 34px;
    height: 20px;
    border-radius: 10px;
    background: #cbd5e1;
    transition: background-color .15s;
}

.mh-tour-menu__switch::after {
    content: "";
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform .15s;
}

.mh-tour-menu__toggle input:checked + .mh-tour-menu__switch { background: var(--mh-tour-accent); }
.mh-tour-menu__toggle input:checked + .mh-tour-menu__switch::after { transform: translateX(14px); }
[dir="rtl"] .mh-tour-menu__toggle input:checked + .mh-tour-menu__switch::after { transform: translateX(-14px); }
.mh-tour-menu__toggle input:focus-visible + .mh-tour-menu__switch { outline: 3px solid var(--mh-tour-link); outline-offset: 2px; }

/* "Take a tour" link on public pages. */
.mh-tour-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--mh-tour-link);
    text-decoration: none;
    cursor: pointer;
}

.mh-tour-link:hover { text-decoration: underline; }
.mh-tour-link[hidden] { display: none; }
.mh-tour-link--light { color: #ffffff; }

/* The tours button in the site's blue header (plans, checkout): after the account menu, never on top of it. */
.mh-tour-menu--header {
    flex: none;
    margin-inline-start: 24px;
    position: relative;
    z-index: 2;
}

/* Below 992px the header's menu button (.mobile-nav-toggle) is fixed at the right edge: keep clear of it. */
@media (max-width: 991.98px) {
    .mh-tour-menu--header { margin-inline-start: auto; margin-inline-end: 44px; }
}

/* The accessibility widget's floating button sits in its own top-level layer and covered the tour's bottom sheet on
   phones; it steps aside only while a tour card is open. */
html.mh-tour-open .asw-menu-btn,
html.mh-tour-open .asw-container { visibility: hidden !important; }

/* Phones: a compact bottom sheet (about a third of the screen instead of half). Small picture beside the head,
   tighter text and buttons, the "Don't show again" row folded into the footer. */
.mh-tour--sheet .mh-tour__card { max-height: 46vh; border-radius: 18px 18px 0 0; }
.mh-tour--sheet .mh-tour__band { padding: 8px 12px 0; border-radius: 18px 18px 0 0; }
.mh-tour--sheet .mh-tour__band::before { width: 110px; height: 110px; top: -60px; }
.mh-tour--sheet .mh-tour__band::after { display: none; }
.mh-tour--sheet .mh-tour__head { min-height: 26px; }
.mh-tour--sheet .mh-tour__brand { height: 20px; }
.mh-tour--sheet .mh-tour__brand img { max-height: 16px; }
.mh-tour--sheet .mh-tour__close { width: 26px; height: 26px; line-height: 26px; font-size: 18px; }
.mh-tour--sheet .mh-tour__art { padding: 0 0 6px; }
.mh-tour--sheet .mh-tour__art svg { max-width: 120px; max-height: 58px; filter: none; }
.mh-tour--sheet .mh-tour__progress { margin: 0 -12px; height: 3px; }
.mh-tour--sheet .mh-tour__body { padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
.mh-tour--sheet .mh-tour__count { margin-bottom: 4px; font-size: 11px; padding: 1px 8px; }
.mh-tour--sheet .mh-tour__title { font-size: 15px; margin-bottom: 2px; }
.mh-tour--sheet .mh-tour__text { font-size: 13px; margin-bottom: 10px; }
.mh-tour--sheet .mh-tour__btn { min-height: 34px; padding: 6px 14px; font-size: 13.5px; border-radius: 9px; }
.mh-tour--sheet .mh-tour__btn--text { padding: 4px 2px; }
.mh-tour--sheet .mh-tour__mute { margin: 8px -16px calc(-10px - env(safe-area-inset-bottom, 0px)); padding: 7px 16px calc(7px + env(safe-area-inset-bottom, 0px)); font-size: 12px; }
/* Very short screens (landscape phones): no picture at all. */
@media (max-height: 560px) {
    .mh-tour--sheet .mh-tour__art { display: none; }
}
