/* ========= Design tokens ========= */
.eafe-step-flow {
    /* sizing */
    --circle: clamp(104px, 20vw, 140px);
    --arrow-gap: clamp(24px, 5vw, 56px);
    --arrow-len: clamp(60px, 15vw, 120px);
    --step-gap: clamp(18px, 3vw, 36px);
    --arrow-height: 2px;
    --thickness: 2px;
    --head-size: 10px;

    /* colors (light) */
    --bg: hsl(210 40% 98%);
    --surface: hsl(0 0% 100% / 0.7);
    --text: hsl(222 47% 11%);
    --muted: hsl(215 16% 45%);
    --ring: hsl(220 13% 89%);
    --arrow-color: #b7b7b7;
    --shadow: 0 10px 30px hsl(220 40% 2% / 0.08);

    --font: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Inter,Arial,sans-serif;
}

.eafe-step-flow-dark {
    /* Dark mode */
    --bg: hsl(222 22% 10%);
    --surface: hsl(222 18% 14% / 0.6);
    --text: hsl(0 0% 100%);
    --muted: hsl(218 11% 65%);
    --ring: hsl(222 10% 22%);
    --arrow-color: hsl(220 10% 35%);
    --shadow: 0 10px 30px hsl(0 0% 0% / 0.45);
}

/* ========= Page background ========= */
.eafe-step-flow-with-bg {
    background:
            radial-gradient(80rem 40rem at 15% -10%, hsl(254 82% 66% / .10), transparent 60%),
            radial-gradient(70rem 40rem at 95% 10%, hsl(199 89% 48% / .10), transparent 60%),
            var(--bg);
}

/* ========= Layout wrapper ========= */
.eafe-step-flow {
    max-width: min(1100px, 95vw);
    margin: clamp(32px, 6vw, 72px) auto;
    padding: clamp(16px, 3vw, 24px);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--step-gap);
    position: relative;
    backdrop-filter: blur(6px);
    font-family: var(--font);
    color: var(--text);
}

.eafe-step-flow--vertical {
    flex-direction: column;
    align-items: center;
}

.eafe-step-flow--grid {
    flex-wrap: wrap;
    justify-content: center;
}

/* each step = circle + title + description */
.eafe-step {
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
    position: relative;
    padding-top: 8px;
    transition: transform .25s ease, filter .25s ease;
}

.eafe-step-flow--grid .eafe-step {
    flex: 0 0 calc(33.33% - var(--step-gap));
    margin-bottom: 44px;
}

@media (hover:hover){
    .eafe-step:hover{
        transform: translateY(-4px);
        filter: drop-shadow(0 10px 20px hsl(220 40% 2% / 0.12));
    }
}

/* ========= The circle (accented, glossy) ========= */
.eafe-step-circle {
    --c: var(--step-accent-color, #33484e);
    position: relative;
    width: var(--circle);
    height: var(--circle);
    margin: 0 auto clamp(16px, 3vw, 20px);
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    border: 2px solid color-mix(in srgb, var(--c) 35%, transparent);
    background:
            radial-gradient(120% 120% at 50% 35%, color-mix(in srgb, var(--c) 16%, transparent), transparent 60%) padding-box,
            linear-gradient(var(--surface), var(--surface)) padding-box;
    box-shadow: inset 0 0 0 8px color-mix(in srgb, var(--c) 8%, transparent), var(--shadow);
    transition: transform .25s ease;
}

@media (hover:hover){
    .eafe-step-circle:hover { transform: scale(1.04); }
}

/* glossy highlight */
.eafe-step-circle::before{
    content:"";
    position:absolute;
    inset: 8%;
    border-radius: inherit;
    background: radial-gradient(100% 60% at 50% 10%, #fff6, transparent 60%);
    mix-blend-mode: screen;
    pointer-events: none;
}

/* animated glow ring */
.eafe-step-flow-no-glow .eafe-step-circle::after {
    display: none;
}

.eafe-step-circle::after{
    content:"";
    position:absolute;
    inset:-2px;
    border-radius: inherit;
    background:
            conic-gradient(from 180deg,
            color-mix(in srgb, var(--c) 60%, transparent),
            color-mix(in srgb, var(--c) 15%, transparent),
            color-mix(in srgb, var(--c) 60%, transparent));
    -webkit-mask:
            linear-gradient(#000 0 0) content-box,
            linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding:2px;
    opacity:.25;
    filter: blur(6px);
    pointer-events:none;
    animation: eafe-spin 6s linear infinite;
}

@keyframes eafe-spin { to { transform: rotate(1turn); } }

/* number badge */
.eafe-step-badge{
    position: absolute;
    right: 0;
    top: 5px;
    min-width: 10px;
    height: clamp(22px, 5vw, 30px);
    padding: 0 clamp(8px, 2vw, 10px);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--c) 12%, transparent);
    border: 2px solid color-mix(in srgb, var(--c) 45%, transparent);
    color: var(--text);
    font-weight: 800;
    font-size: clamp(10px, 2vw, 12px);
    line-height: 1;
    backdrop-filter: blur(4px);
}

/* ========= Desktop connector (default arrow) ========= */
.eafe-step-arrow.arrow-default {
    position: absolute;
    left: calc(100% + var(--arrow-gap));
    top: 50%;
    transform: translateY(-50%);
    width: var(--arrow-len);
    height: var(--thickness);
    display: inline-block;
}

.eafe-step-arrow.arrow-default::before {
    content: "";
    position: absolute;
    left: 0;
    right: calc(var(--head-size) + 2px);
    top: 50%;
    border-top: var(--thickness) solid var(--arrow-color);
    transform: translateY(-50%);
}

.eafe-step-arrow.arrow-default::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: var(--head-size);
    height: var(--head-size);
    border-top: var(--thickness) solid var(--arrow-color);
    border-right: var(--thickness) solid var(--arrow-color);
    transform: translateY(-50%) rotate(45deg);
}

.eafe-step-arrow.arrow-default[style*="dashed"]::before {
    border-top-style: dashed;
}

.eafe-step-arrow.arrow-default[style*="dotted"]::before {
    border-top-style: dotted;
}

.eafe-step-arrow.arrow-default[style*="none"] {
    display: none;
}

/* ========= Symbol arrow ========= */
.eafe-step-arrow.arrow-symbol {
    position: absolute;
    left: calc(100% + var(--arrow-gap));
    top: 50%;
    transform: translateY(-50%);
    width: var(--arrow-len);
    height: var(--thickness);
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
}

.eafe-step-arrow.arrow-symbol .arrow-symbol {
    font-size: calc(var(--head-size) * 1.5);
    color: var(--arrow-color);
}

.eafe-step-arrow.arrow-symbol[style*="dashed"] .arrow-symbol,
.eafe-step-arrow.arrow-symbol[style*="dotted"] .arrow-symbol {
    text-decoration: none;
}

.eafe-step-arrow.arrow-symbol[style*="none"] {
    display: none;
}

/* ========= SVG and Icon arrows ========= */
.eafe-step-arrow.arrow-svg,
.eafe-step-arrow.arrow-icon {
    position: absolute;
    left: calc(100% + var(--arrow-gap));
    top: 50%;
    transform: translateY(-50%);
    width: var(--arrow-len);
    height: calc(var(--head-size) * 2);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.eafe-step-arrow.arrow-svg svg,
.eafe-step-arrow.arrow-icon i {
    width: calc(var(--head-size) * 2);
    height: calc(var(--head-size) * 2);
    stroke: var(--arrow-color);
    fill: none;
    color: var(--arrow-color);
}

.eafe-step-arrow.arrow-svg[style*="none"],
.eafe-step-arrow.arrow-icon[style*="none"] {
    display: none;
}

.eafe-step:last-child .eafe-step-arrow { display: none; }

/* Titles + descriptions */
.eafe-step-title {
    margin: 0 0 clamp(8px, 2vw, 10px);
    font-weight: 800;
    letter-spacing: .2px;
    font-size: clamp(16px, 3vw, 18px);
    color: var(--c);
    line-height: 1.3;
    text-shadow: 0 1px 0 color-mix(in srgb, #fff 25%, transparent);
}

.eafe-step-description {
    margin: 0 auto;
    max-width: min(320px, 92%);
    font-size: clamp(14px, 2.5vw, 16px);
    line-height: 1.6;
    color: var(--muted);
}

/* ========= Medium screens ========= */
@media (max-width: 992px) and (min-width: 769px) {
    .eafe-step-flow--horizontal {
        flex-wrap: wrap;
        justify-content: center;
    }
    .eafe-step-flow--horizontal .eafe-step {
        flex: 0 0 calc(50% - var(--step-gap));
        margin-bottom: 44px;
    }
    .eafe-step-flow--horizontal .eafe-step:nth-child(2) .eafe-step-arrow { display: none; }
    .eafe-step-flow--grid .eafe-step {
        flex: 0 0 calc(50% - var(--step-gap));
    }
}

/* ========= Mobile: stack w/ vertical arrows ========= */
@media (max-width: 768px) {
    .eafe-step-flow--horizontal,
    .eafe-step-flow--vertical {
        flex-direction: column;
        align-items: center;
        gap: clamp(28px, 8vw, 80px);
    }
    .eafe-step-flow--grid {
        flex-direction: column;
        align-items: center;
    }
    .eafe-step { width: 100%; }
    .eafe-step-circle .eafe-step-arrow { display: none; }

    .eafe-step-flow--horizontal .eafe-step:not(:last-child)::after,
    .eafe-step-flow--vertical .eafe-step:not(:last-child)::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: calc(-1 * clamp(24px, 6vw, 36px) / 2 - clamp(22px, 5vw, 42px) / 2);
        transform: translateX(-50%);
        width: var(--thickness);
        height: clamp(22px, 5vw, 42px);
        border-left: var(--thickness) solid var(--arrow-color);
    }

    .eafe-step-flow--horizontal .eafe-step:not(:last-child)::before,
    .eafe-step-flow--vertical .eafe-step:not(:last-child)::before {
        content: "";
        position: absolute;
        left: 50%;
        bottom: calc(-1 * clamp(24px, 6vw, 36px) / 2 - clamp(22px, 5vw, 42px) / 2 - 9px);
        transform: translateX(-50%);
        width: var(--head-size);
        height: var(--head-size);
        border-bottom: var(--thickness) solid var(--arrow-color);
        border-right: var(--thickness) solid var(--arrow-color);
        transform: translateX(-50%) rotate(45deg);
    }
}

/* ========= Small mobile ========= */
@media (max-width: 480px) {
    .eafe-step-flow { gap: 28px; }
    .eafe-step-circle {
        width: clamp(86px, 26vw, 104px);
        height: clamp(86px, 26vw, 104px);
    }
    .eafe-step-circle svg,
    .eafe-step-circle i { width: 32px; height: 32px; font-size: 32px; }
    .eafe-step-badge { height: 20px; font-size: 10px; }
    .eafe-step-flow--horizontal .eafe-step:not(:last-child)::after,
    .eafe-step-flow--vertical .eafe-step:not(:last-child)::after {
        bottom: calc(-28px / 2 - 20px / 2);
        height: 20px;
    }
    .eafe-step-flow--horizontal .eafe-step:not(:last-child)::before,
    .eafe-step-flow--vertical .eafe-step:not(:last-child)::before {
        bottom: calc(-28px / 2 - 20px / 2 - 9px);
    }
}

/* normalize SVGs + icons + accent stroke */
.eafe-step-circle svg,
.eafe-step-circle i {
    width: clamp(32px, 8vw, 42px);
    height: clamp(32px, 8vw, 42px);
    stroke: var(--c);
    stroke-width: 1.8;
    fill: none;
    color: var(--c);
}

/* Focus styles for accessibility */
.eafe-step:focus-within .eafe-step-circle {
    outline: 2px solid var(--c);
    outline-offset: 2px;
}

/* Active state */
.eafe-step-active .eafe-step-circle {
    transform: scale(1.06);
    box-shadow: inset 0 0 0 8px color-mix(in srgb, var(--c) 12%, transparent), 0 12px 24px hsl(220 40% 2% / 0.2);
}