/*!
 * Multi-Step Form Master - showcase page styles (index.html only)
 * Not needed in your project.
 */

:root {
    --bg: #f5f6fb;
    --surface: #ffffff;
    --surface-muted: #eef0f8;
    --text: #151829;
    --text-muted: #5b6075;
    --border: #e1e4ef;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.1);
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 20px 40px -18px rgba(16, 24, 40, 0.18);
    --radius: 18px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}

:root[data-msf-mode="dark"] {
    --bg: #0d0f1a;
    --surface: #161a2b;
    --surface-muted: #11141f;
    --text: #eceef7;
    --text-muted: #a2a7bd;
    --border: #272c42;
    --primary: #818cf8;
    --primary-hover: #a5b4fc;
    --primary-soft: rgba(129, 140, 248, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 40px -18px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root[data-msf-mode="auto"] {
        --bg: #0d0f1a;
        --surface: #161a2b;
        --surface-muted: #11141f;
        --text: #eceef7;
        --text-muted: #a2a7bd;
        --border: #272c42;
        --primary: #818cf8;
        --primary-hover: #a5b4fc;
        --primary-soft: rgba(129, 140, 248, 0.14);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 40px -18px rgba(0, 0, 0, 0.6);
        color-scheme: dark;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
}

svg {
    width: 20px;
    height: 20px;
}

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.container {
    width: min(1200px, 100% - 40px);
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    inset-inline-start: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.skip-link:focus {
    top: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

:root[data-msf-mode="dark"] .btn--primary {
    color: #0d0f1a;
}

.btn--primary:hover {
    background: var(--primary-hover);
}

.btn--ghost {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.btn--ghost:hover {
    border-color: var(--primary);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 68px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
}

.site-nav {
    display: flex;
    gap: 4px;
    margin-inline-start: auto;
}

.site-nav a {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
}

.site-nav a:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.mode-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.mode-toggle__sun,
:root[data-msf-mode="dark"] .mode-toggle__moon {
    display: none;
}

:root[data-msf-mode="dark"] .mode-toggle__sun {
    display: block;
}

.mode-toggle span {
    line-height: 0;
}

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    padding: 96px 0 80px;
    text-align: center;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -40% -10% auto;
    height: 640px;
    background:
        radial-gradient(closest-side, rgba(99, 102, 241, 0.22), transparent 70%) 20% 40% / 60% 100% no-repeat,
        radial-gradient(closest-side, rgba(236, 72, 153, 0.16), transparent 70%) 80% 50% / 60% 100% no-repeat;
    pointer-events: none;
}

.hero__inner {
    position: relative;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.hero__badge svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.hero__title {
    max-width: 820px;
    margin: 0 auto 20px;
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.08;
}

.hero__text {
    max-width: 640px;
    margin: 0 auto 32px;
    color: var(--text-muted);
    font-size: 1.125rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.hero__stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-width: 860px;
    margin: 56px auto 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--border);
    gap: 1px;
}

.hero__stats div {
    display: flex;
    flex-direction: column-reverse;
    padding: 20px 12px;
    background: var(--surface);
}

.hero__stats dt {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.hero__stats dd {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Sections */
.section {
    padding: 88px 0;
}

.section--muted {
    border-block: 1px solid var(--border);
    background: var(--surface-muted);
}

.section__head {
    max-width: 640px;
    margin: 0 auto 40px;
    text-align: center;
}

.section__title {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 3.4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.section__text {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.0625rem;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 36px;
}

.filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter span {
    padding: 0 8px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
}

.filter:hover {
    border-color: var(--primary);
}

.filter.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

:root[data-msf-mode="dark"] .filter.is-active {
    color: #0d0f1a;
}

.filter.is-active span {
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
}

/* Demo cards */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.demo-card {
    animation: card-in 0.4s ease both;
}

.demo-card[hidden] {
    display: none;
}

.demo-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.demo-card__link:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.demo-card__thumb {
    aspect-ratio: 16 / 11;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

.demo-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.5s ease;
}

.demo-card__link:hover .demo-card__thumb img {
    transform: scale(1.04);
}

.demo-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px 22px 22px;
}

.demo-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.8125rem;
}

.demo-card__num {
    color: var(--text-muted);
    font-family: var(--mono);
}

.demo-card__cat {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.demo-card__title {
    margin: 0 0 6px;
    font-size: 1.1875rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.demo-card__text {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.demo-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: auto 0 0;
    padding: 0;
    list-style: none;
}

.demo-card__tags li {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Features */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.feature {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.feature__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}

.feature__title {
    margin: 0 0 6px;
    font-size: 1.0625rem;
}

.feature__text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Get started */
.start {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 56px;
}

.start__steps {
    margin: 24px 0 32px;
    padding-inline-start: 22px;
    color: var(--text-muted);
    font-size: 1.0625rem;
}

.start__steps li + li {
    margin-top: 10px;
}

.start__steps strong {
    color: var(--text);
}

.code {
    margin: 0;
    padding: 28px;
    overflow: auto;
    border-radius: var(--radius);
    background: #0f1222;
    box-shadow: var(--shadow);
    color: #c9d1f5;
    font-family: var(--mono);
    font-size: 0.875rem;
    line-height: 1.7;
}

/* Footer */
.site-footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-footer p {
    margin: 0;
}

.site-footer nav {
    display: flex;
    gap: 20px;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .demo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .start {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
}

@media (max-width: 720px) {
    .site-nav {
        display: none;
    }

    .mode-toggle {
        margin-inline-start: auto;
    }

    .hero {
        padding: 64px 0 56px;
    }

    .hero__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero__stats div:last-child {
        grid-column: 1 / -1;
    }

    .section {
        padding: 64px 0;
    }

    .demo-grid,
    .feature-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
