/*
 * How It Works (resources/views/frontend/pages/how-it-works.blade.php).
 *
 * Hand-written: the public site's Tailwind bundle is purged from an old build. Colours follow
 * the site tokens in space-detail.css, including its booking-mode accents (day / hour / month).
 */

.hiw {
    --hiw-ink: #0f172a;
    --hiw-ink-2: #334155;
    --hiw-muted: #475569;
    --hiw-line: #e2e8f0;
    --hiw-soft: #f8fafc;
    --hiw-brand: #2563eb;
    --hiw-brand-ink: #1d4ed8;
    --hiw-brand-soft: #eff6ff;
    --hiw-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --hiw-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -14px rgba(15, 23, 42, 0.18);
    --hiw-shadow-lift: 0 2px 4px rgba(15, 23, 42, 0.05), 0 22px 44px -18px rgba(15, 23, 42, 0.28);

    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--hiw-ink);
}

.hiw-wrap {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .hiw-wrap {
        padding: 0 1.5rem;
    }
}

.hiw-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hiw-hero {
    position: relative;
    overflow: hidden;
    padding: 136px 0 84px;
    text-align: center;
    background:
        radial-gradient(55% 80% at 12% 0%, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0) 60%),
        radial-gradient(45% 70% at 92% 8%, rgba(13, 148, 136, 0.12), rgba(13, 148, 136, 0) 60%),
        linear-gradient(180deg, #f5f9ff 0%, #ffffff 100%);
}

.hiw-hero .hiw-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hiw-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--hiw-brand-ink);
    font-size: 13px;
    font-weight: 600;
    animation: hiw-rise 0.6s var(--hiw-ease) both;
}

.hiw-hero__title {
    max-width: 46rem;
    margin: 18px 0 0;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: clamp(2rem, 1.25rem + 3vw, 3.25rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
    text-wrap: balance;
    animation: hiw-rise 0.6s var(--hiw-ease) 0.06s both;
}

.hiw-hero__lead {
    max-width: 40rem;
    margin: 18px 0 0;
    color: var(--hiw-muted);
    font-size: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
    line-height: 1.65;
    text-wrap: pretty;
    animation: hiw-rise 0.6s var(--hiw-ease) 0.12s both;
}

.hiw-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
    animation: hiw-rise 0.6s var(--hiw-ease) 0.18s both;
}

/* ── Buttons and links ────────────────────────────────────────────────── */

.hiw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition:
        transform 0.2s var(--hiw-ease),
        box-shadow 0.2s var(--hiw-ease),
        background-color 0.2s var(--hiw-ease),
        border-color 0.2s var(--hiw-ease),
        color 0.2s var(--hiw-ease);
}

.hiw-btn svg,
.hiw-link svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s var(--hiw-ease);
}

.hiw-btn:hover {
    transform: translateY(-1px);
}

.hiw-btn:hover svg,
.hiw-link:hover svg {
    transform: translateX(3px);
}

.hiw-btn:active {
    transform: scale(0.97);
    transition-duration: 0.09s;
}

.hiw-btn:focus-visible,
.hiw-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4);
}

.hiw-btn--primary {
    background: var(--hiw-brand);
    color: #fff;
    box-shadow: 0 8px 20px -10px rgba(37, 99, 235, 0.8);
}

.hiw-btn--primary:hover {
    background: var(--hiw-brand-ink);
    box-shadow: 0 14px 28px -12px rgba(37, 99, 235, 0.9);
}

.hiw-btn--ghost {
    border: 1px solid var(--hiw-line);
    background: #fff;
    color: var(--hiw-ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.hiw-btn--ghost:hover {
    border-color: #bfdbfe;
    color: var(--hiw-brand-ink);
    box-shadow: var(--hiw-shadow);
}

.hiw-btn--light {
    background: #fff;
    color: var(--hiw-brand-ink);
    box-shadow: 0 10px 24px -12px rgba(2, 6, 23, 0.5);
}

.hiw-btn--outline-light {
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    color: #fff;
}

.hiw-btn--outline-light:hover {
    background: rgba(255, 255, 255, 0.14);
}

.hiw-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    margin-right: 18px;
    border-radius: 6px;
    color: var(--hiw-brand-ink);
    font-weight: 600;
}

.hiw-link--muted {
    color: var(--hiw-muted);
}

.hiw-link:hover {
    color: var(--hiw-brand);
}

/* ── Sections ─────────────────────────────────────────────────────────── */

.hiw-section {
    padding: 84px 0;
}

.hiw-section--tint {
    border-top: 1px solid var(--hiw-line);
    border-bottom: 1px solid var(--hiw-line);
    background: var(--hiw-soft);
}

.hiw-section--last {
    padding-top: 24px;
}

.hiw-head {
    max-width: 40rem;
    margin: 0 auto 48px;
    text-align: center;
}

.hiw-head--left {
    margin: 0;
    text-align: left;
}

.hiw-head__title {
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: clamp(1.625rem, 1.2rem + 1.5vw, 2.25rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.hiw-head__lead {
    margin: 12px 0 0;
    color: var(--hiw-muted);
    font-size: 17px;
    line-height: 1.6;
}

/* ── Steps: a timeline ────────────────────────────────────────────────── */

.hiw-timeline {
    position: relative;
    display: grid;
    gap: 18px;
    max-width: 760px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

/* The thread the numbers hang on. */
.hiw-timeline::before {
    content: '';
    position: absolute;
    top: 24px;
    bottom: 24px;
    left: 23px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, #bfdbfe, #e2e8f0 85%, rgba(226, 232, 240, 0));
}

.hiw-step {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.hiw-step__marker {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 2px solid #bfdbfe;
    border-radius: 999px;
    background: #fff;
    color: var(--hiw-brand-ink);
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 0 0 6px #fff;
    transition: background-color 0.5s var(--hiw-ease) 0.15s, color 0.5s var(--hiw-ease) 0.15s, border-color 0.5s var(--hiw-ease) 0.15s;
}

/* A revealed step's number fills in, so the thread reads as progress down the page. */
.hiw-step.is-visible .hiw-step__marker,
html:not(.hiw-js) .hiw-step__marker {
    border-color: var(--hiw-brand);
    background: var(--hiw-brand);
    color: #fff;
}

.hiw-step__card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 16px;
    padding: 22px 24px;
    border: 1px solid var(--hiw-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--hiw-shadow);
    transition: transform 0.25s var(--hiw-ease), box-shadow 0.25s var(--hiw-ease), border-color 0.25s var(--hiw-ease);
}

.hiw-step__card:hover {
    transform: translateY(-3px);
    border-color: #bfdbfe;
    box-shadow: var(--hiw-shadow-lift);
}

.hiw-step__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--hiw-brand-soft);
    color: var(--hiw-brand);
    transition: transform 0.3s var(--hiw-ease), background-color 0.3s var(--hiw-ease), color 0.3s var(--hiw-ease);
}

.hiw-step__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hiw-step__card:hover .hiw-step__icon {
    transform: rotate(-6deg) scale(1.06);
    background: var(--hiw-brand);
    color: #fff;
}

.hiw-step__title {
    margin: 2px 0 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.hiw-step__body {
    margin: 6px 0 0;
    color: var(--hiw-ink-2);
    font-size: 15.5px;
    line-height: 1.65;
}

.hiw-step__tip {
    margin: 12px 0 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--hiw-soft);
    color: var(--hiw-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Wide screens: the thread runs down the middle and the cards alternate sides. */
@media (min-width: 960px) {
    .hiw-timeline {
        max-width: none;
        gap: 4px;
    }

    .hiw-timeline::before {
        left: calc(50% - 1px);
    }

    .hiw-step {
        grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
        gap: 28px;
    }

    .hiw-step__marker {
        grid-column: 2;
        grid-row: 1;
        margin-top: 22px;
    }

    .hiw-step__card {
        grid-row: 1;
    }

    .hiw-step:nth-child(odd) .hiw-step__card {
        grid-column: 1;
    }

    .hiw-step:nth-child(even) .hiw-step__card {
        grid-column: 3;
    }
}

/* ── Booking modes ────────────────────────────────────────────────────── */

.hiw-modes {
    display: grid;
    gap: 20px;
}

@media (min-width: 900px) {
    .hiw-modes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.hiw-mode {
    --mode: #0f766e;
    --mode-soft: #f0fdfa;

    display: flex;
    flex-direction: column;
    padding: 28px;
    border: 1px solid var(--hiw-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--hiw-shadow);
    transition: transform 0.25s var(--hiw-ease), box-shadow 0.25s var(--hiw-ease), border-color 0.25s var(--hiw-ease);
}

.hiw-mode--hourly {
    --mode: #6d28d9;
    --mode-soft: #f5f3ff;
}

.hiw-mode--monthly {
    --mode: #b45309;
    --mode-soft: #fffbeb;
}

.hiw-mode:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--mode) 30%, #ffffff);
    box-shadow: var(--hiw-shadow-lift);
}

.hiw-mode__group {
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--mode-soft);
    color: var(--mode);
    font-size: 13px;
    font-weight: 600;
}

.hiw-mode__name {
    margin: 16px 0 0;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.hiw-mode__body {
    margin: 8px 0 0;
    color: var(--hiw-ink-2);
    font-size: 15.5px;
    line-height: 1.6;
}

.hiw-mode__points {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.hiw-mode__points li {
    position: relative;
    padding-left: 28px;
    color: var(--hiw-ink-2);
    font-size: 15px;
    line-height: 1.5;
}

/* A check in the mode's colour. */
.hiw-mode__points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--mode-soft);
}

.hiw-mode__points li::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 6px;
    width: 6px;
    height: 9px;
    border-right: 2px solid var(--mode);
    border-bottom: 2px solid var(--mode);
    transform: rotate(45deg);
}

.hiw-mode__types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 22px;
}

.hiw-mode__types span {
    padding: 5px 11px;
    border: 1px solid var(--hiw-line);
    border-radius: 999px;
    color: var(--hiw-muted);
    font-size: 13px;
    font-weight: 500;
}

/* ── Statuses ─────────────────────────────────────────────────────────── */

.hiw-status {
    display: grid;
    gap: 32px;
    align-items: center;
}

@media (min-width: 900px) {
    .hiw-status {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        gap: 56px;
    }
}

.hiw-status__list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hiw-status__item {
    --tone: #b45309;
    --tone-fill: #f59e0b;
    --tone-soft: #fffbeb;

    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--hiw-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--hiw-shadow);
}

.hiw-status__item--confirmed {
    --tone: #15803d;
    --tone-fill: #22c55e;
    --tone-soft: #f0fdf4;
}

.hiw-status__item--cancelled {
    --tone: #b91c1c;
    --tone-fill: #ef4444;
    --tone-soft: #fef2f2;
}

.hiw-status__item p {
    margin: 0;
    color: var(--hiw-ink-2);
    font-size: 15px;
    line-height: 1.55;
}

.hiw-status__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--tone-soft);
    color: var(--tone);
    font-size: 14px;
    font-weight: 600;
}

.hiw-status__dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--tone-fill);
}

/* A pending request breathes, like it does in the dashboard. */
.hiw-status__item--pending .hiw-status__dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    animation: hiw-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@media (max-width: 520px) {
    .hiw-status__item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* ── Next steps ───────────────────────────────────────────────────────── */

.hiw-cta {
    display: grid;
    gap: 20px;
}

@media (min-width: 900px) {
    .hiw-cta {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    }
}

.hiw-cta__card {
    padding: 32px;
    border: 1px solid var(--hiw-line);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--hiw-shadow);
}

.hiw-cta__card h2 {
    margin: 0;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.hiw-cta__card p {
    margin: 10px 0 0;
    color: var(--hiw-muted);
    font-size: 15.5px;
    line-height: 1.6;
}

.hiw-cta__card--main {
    position: relative;
    overflow: hidden;
    border: 0;
    background:
        radial-gradient(70% 90% at 100% 0%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 60%),
        linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 24px 48px -24px rgba(37, 99, 235, 0.7);
}

.hiw-cta__card--main p {
    color: rgba(255, 255, 255, 0.9);
}

.hiw-cta__card--main .hiw-hero__actions {
    justify-content: flex-start;
    margin-top: 22px;
    animation: none;
}

/* ── Reveal on scroll (only with the page script) ─────────────────────── */

.hiw-js [data-reveal] {
    transition: opacity 0.6s var(--hiw-ease), transform 0.6s var(--hiw-ease);
}

.hiw-js [data-reveal]:not(.is-visible) {
    opacity: 0;
    transform: translateY(18px);
}

@media (min-width: 960px) {
    .hiw-js .hiw-step:nth-child(odd):not(.is-visible) {
        transform: translateX(-24px);
    }

    .hiw-js .hiw-step:nth-child(even):not(.is-visible) {
        transform: translateX(24px);
    }
}

/* Cards in a row arrive a beat apart. */
.hiw-js .hiw-mode:nth-child(2),
.hiw-js .hiw-status__item:nth-child(2),
.hiw-js .hiw-cta__card:nth-child(2) {
    transition-delay: 0.08s;
}

.hiw-js .hiw-mode:nth-child(3),
.hiw-js .hiw-status__item:nth-child(3) {
    transition-delay: 0.16s;
}

@keyframes hiw-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

@keyframes hiw-ping {
    75%,
    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hiw *,
    .hiw *::before,
    .hiw *::after {
        animation: none !important;
        transition: none !important;
    }
}
