/* "How It Works" — inline walkthrough slider, small-screen variant.
   Adapted from docs/how-it-works_MOBILE/how-it-works.css (originally a
   bottom-sheet modal for touch): the touch-tuned spacing, tap-target sizes
   and condensed captions are carried over, but the drag-handle
   swipe-to-close behavior is dropped since this page embeds the slider
   inline rather than as a dismissible sheet.

   Loaded instead of how-it-works.css via a <link media="(max-width: 600px)">
   in pages/how-it-works.blade.php, so it only needs to cover that viewport
   — there is no larger-screen fallback to layer on top of. */

:root {
    --hiw-accent: #F94735;
    --hiw-accent-2: #ff7a63;
    --hiw-accent-dark: #d6301e;
    --hiw-panel-line: rgba(255, 255, 255, 0.09);
    --hiw-gray: #9aa0a4;
    --hiw-frame-ratio: 1.5625; /* 2400 / 1536 — every step image shares this exact frame */
}

.hiw-card {
    position: relative;
    margin: 0 auto;
    background:
        radial-gradient(ellipse 90% 50% at 50% -10%, rgba(249, 71, 53, 0.16), transparent 60%),
        linear-gradient(165deg, #1e1b18 0%, #16130f 55%, #100e0c 100%);
    border: 1px solid var(--hiw-panel-line);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hiw-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 0;
}
.hiw-progress {
    flex: 1;
    display: flex;
    gap: 6px;
}
.hiw-progress-seg {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: var(--hiw-panel-line);
    overflow: hidden;
    position: relative;
}
.hiw-progress-seg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--hiw-accent), var(--hiw-accent-2));
    box-shadow: 0 0 8px rgba(249, 71, 53, 0.7);
    transform: scaleX(0);
    transform-origin: left;
}
.hiw-progress-seg.is-done::after { transform: scaleX(1); }
.hiw-progress-seg.is-active::after {
    animation: hiwFill var(--hiw-dur, 5s) linear forwards;
}
.hiw-card.hiw-paused .hiw-progress-seg.is-active::after {
    animation-play-state: paused;
}
@keyframes hiwFill {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.hiw-stage {
    position: relative;
    padding: 2px 16px 14px;
}
.hiw-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.22, 0.9, 0.25, 1);
    touch-action: pan-y;
}
.hiw-slide {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    transition: opacity 0.35s ease, filter 0.35s ease;
}
.hiw-slide:not(.is-current) { opacity: 0.3; filter: blur(1.5px); }

.hiw-imgwrap {
    position: relative;
    width: 100%;
    aspect-ratio: var(--hiw-frame-ratio);
    border-radius: 14px;
    overflow: hidden;
    background: #e8e9ea;
    transform: none !important; /* no cursor-tilt on touch */
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.5),
        0 30px 60px -20px rgba(0, 0, 0, 0.6),
        0 10px 24px -8px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(0, 0, 0, 0.06);
}
.hiw-imgwrap::before {
    display: none; /* no cursor-follow glare on touch */
}
.hiw-imgwrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.hiw-imgwrap img.is-loaded { opacity: 1; }

.hiw-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    min-width: 38px;
    height: 22px;
    padding: 0 9px;
    border-radius: 11px;
    background: rgba(10, 11, 12, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.hiw-caption {
    padding: 16px 20px 2px;
}
.hiw-kicker {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    background: linear-gradient(90deg, var(--hiw-accent), var(--hiw-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.hiw-caption h3 {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 800;
    color: #f5f6f7;
    letter-spacing: -0.4px;
}
.hiw-caption p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--hiw-gray);
}

.hiw-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px 18px;
}
.hiw-navbtn {
    border: 1px solid var(--hiw-panel-line);
    background: rgba(255, 255, 255, 0.05);
    width: 44px; /* Apple min tap target */
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f5f6f7;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
}
.hiw-navbtn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); }
.hiw-navbtn:active:not(:disabled) { transform: scale(0.92); }
.hiw-navbtn:disabled { opacity: 0.3; cursor: default; }

/* Dots don't earn their space at this width — prev/next + swipe cover it. */
.hiw-dots { display: none; }

.hiw-cta-wrap {
    text-align: center;
    margin-top: 2rem;
}

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