/* demo.css
 * Migo Contact – merged core + demo styles
 *
 * This file contains:
 *  - Core Migo Contact component styles (m-form, m-input, m-dropzone, alerts, file preview, etc.)
 *  - Dark demo shell for public examples (single form pages + index listing + wizard)
 *
 * All classes are prefixed with .m- to avoid conflicts in client projects.
 */

/* -------------------------------------------------
 * Global demo baseline (html + body)
 * ------------------------------------------------- */

html,
body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #e5e7eb;
    background: #020617;
    background: radial-gradient(circle at top, #1f2937 0, #020617 55%, #000 100%);
}

/* -------------------------------------------------
 * Core form primitives (formerly forms.css)
 * ------------------------------------------------- */

/* Root form wrapper */
.m-form {
    position: relative;
    max-width: 100%;
    font-family: inherit;
    font-size: 14px;
    color: #0f172a;
}

/* Basic row wrapper (single field) */
.m-row {
    margin-bottom: 0.9rem;
}

/* Honeypot field – hidden from humans, visible for bots */
.m-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Labels & helpers */
.m-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: #111827;
}

.m-label span.m-label-optional {
    font-weight: 400;
    font-size: 0.8rem;
    color: #6b7280;
    margin-left: 0.25rem;
}

/* Inputs / textareas / selects – neutral (light) baseline */
.m-input,
.m-textarea {
    display: block;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: 0.55rem;
    border: 1px solid #d1d5db;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #111827;
    background-color: #ffffff;
    outline: none;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background-color 0.16s ease,
        color 0.16s ease;
    box-sizing: border-box;
}

.m-input::placeholder,
.m-textarea::placeholder {
    color: #9ca3af;
}

.m-input:focus,
.m-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.m-input[disabled],
.m-textarea[disabled],
.m-input[readonly],
.m-textarea[readonly] {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

/* Select inherits .m-input visuals */
select.m-input {
    padding-right: 2rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #9ca3af 50%),
        linear-gradient(135deg, #9ca3af 50%, transparent 50%);
    background-position:
        calc(100% - 13px) 47%,
        calc(100% - 8px) 47%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

/* Error state */
.m-row.m-row--error .m-label {
    color: #b91c1c;
}

.m-input.m-input--error,
.m-textarea.m-input--error {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25);
}

.m-field-error {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #b91c1c;
    /* prevent long filenames from breaking layout */
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Primary button – neutral baseline */
.m-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    border: 1px solid #2563eb;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #f9fafb;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    outline: none;
    white-space: nowrap;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        filter 0.16s ease,
        opacity 0.16s ease;
}

.m-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.45);
}

.m-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.m-btn[disabled],
.m-btn.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Loading state for submit button inside a loading form */
.m-form.is-loading .m-btn[type="submit"] {
    cursor: wait;
}

/* Global alert / result box */
.m-alert {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    border-radius: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid transparent;
    background-color: transparent;
    color: #111827;
    display: none;
    /* allow long text / filenames to wrap properly */
    word-break: break-word;
    overflow-wrap: anywhere;
}

.m-alert.is-visible {
    display: block;
}

.m-alert--success {
    background-color: #ecfdf3;
    border-color: #bbf7d0;
    color: #166534;
}

.m-alert--error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* Dropzone / file upload – neutral baseline */
.m-dropzone {
    position: relative;
    border-radius: 0.9rem;
    border: 1px dashed #cbd5e1;
    background-color: #f8fafc;
    padding: 0.9rem 0.9rem;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.16s ease,
        background-color 0.16s ease,
        box-shadow 0.16s ease;
}

.m-dropzone:hover {
    border-color: #60a5fa;
    background-color: #eff6ff;
}

.m-dropzone-icon {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.m-dropzone-text {
    font-size: 0.85rem;
    color: #4b5563;
}

.m-dropzone-text strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

/* Drag over state (toggled via JS) */
.m-dropzone.is-dragover {
    border-color: #3b82f6;
    background-color: #e0f2fe;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

/* Native file input – visually hidden but accessible */
.m-file {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* File preview list */
.m-file-preview {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.m-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    color: #111827;
}

.m-file-item-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1 1 auto;
}

/* Text wrapper inside file item (name + meta) */
.m-file-item-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Icon / thumbnail container – small 40x40 square */
.m-file-item-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    background-color: rgba(148, 163, 184, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    overflow: hidden;
}

/* Thumbnail image */
.m-file-item-thumb {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

.m-file-item-name {
    font-weight: 500;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
}

.m-file-item-meta {
    font-size: 0.78rem;
    color: #6b7280;
}

.m-file-item-remove {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.1rem 0.25rem;
    border-radius: 999px;
    transition:
        background-color 0.16s ease,
        color 0.16s ease;
}

.m-file-item-remove:hover {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* File validation error (e.g. invalid extension / size) */
.m-file-item--error {
    border-color: #fecaca;
    background-color: #fef2f2;
    color: #b91c1c;
}

/* Helper state classes for JS */
.m-has-error .m-input,
.m-has-error .m-textarea {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25);
}

/* Small inline pill / badge */
.m-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    font-size: 0.75rem;
    color: #4b5563;
    background-color: #f9fafb;
}

/* Core responsive tweaks */
@media (max-width: 480px) {
    .m-input,
    .m-textarea {
        font-size: 0.88rem;
        padding: 0.5rem 0.65rem;
    }

    .m-btn {
        width: 100%;
        justify-content: center;
    }
}

/* -------------------------------------------------
 * Single form demo shell (dark card) – reused by all demos
 * ------------------------------------------------- */

/* Outer flex wrapper for one form demo page */
.m-page-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.75rem 2.5rem;
    gap: 0.9rem;
    box-sizing: border-box;
}

/* Main dark card shell */
.m-page-card {
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
    background: rgba(15, 23, 42, 0.96);
    border-radius: 1.5rem;
    padding: 1.75rem 1.75rem 2rem;
    box-shadow: 0 26px 95px rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(30, 64, 175, 0.7);
    box-sizing: border-box;
}

/* Header inside card */
.m-page-header {
    margin-bottom: 1.4rem;
}

.m-page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.m-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: #f9fafb;
}

.m-page-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 0.18rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.75);
    background: rgba(15, 23, 42, 0.98);
    color: #e5e7eb;
    white-space: nowrap;
}

.m-page-sub {
    font-size: 0.9rem;
    color: #9ca3af;
    margin: 0.35rem 0 0;
}

/* Two-column helper (name + email, etc.) */
.m-row-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem 1.2rem;
    margin-bottom: 0.9rem;
}

/* Label + required mark on dark background */
.m-page-card .m-label {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #e5e7eb;
}

.m-required {
    color: #fb923c;
    font-weight: 600;
    font-size: 0.9em;
}

/* Inputs / textareas in dark card */
.m-page-card .m-input,
.m-page-card .m-textarea {
    background-color: #020617;
    border-color: #1f2933;
    color: #e5e7eb;
}

.m-page-card .m-input::placeholder,
.m-page-card .m-textarea::placeholder {
    color: #64748b;
}

.m-page-card .m-input:focus,
.m-page-card .m-textarea:focus {
    background-color: #020617;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

/* Primary button treatment on dark card */
.m-page-card .m-btn {
    margin-top: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.4rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.98);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.85);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.85),
        0 12px 30px rgba(15, 23, 42, 0.9);
    cursor: pointer;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease,
        color 0.16s ease;
}

/* Arrow accent on button */
.m-page-card .m-btn::after {
    content: '→';
    font-size: 0.85rem;
    opacity: 0.85;
    transform: translateX(0);
    transition: transform 0.16s ease, opacity 0.16s ease;
}

.m-page-card .m-btn:hover {
    background: #111827;
    border-color: rgba(209, 213, 219, 0.95);
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.9),
        0 16px 40px rgba(15, 23, 42, 0.95);
    color: #f9fafb;
}

.m-page-card .m-btn:hover::after {
    transform: translateX(3px);
    opacity: 1;
}

.m-page-card .m-btn:active {
    transform: translateY(0);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 1),
        0 8px 24px rgba(15, 23, 42, 0.95);
}

.m-page-card .m-btn:focus-visible {
    outline: 2px solid #e5e7eb;
    outline-offset: 3px;
}

.m-page-card .m-btn[disabled],
.m-page-card .m-btn.is-disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

/* Dark card global alert override */
.m-page-card .m-alert {
    color: #e5e7eb;
    margin-top: 0.9rem;
}

/* Dark dropzone + file list inside card */
.m-page-card .m-file-preview {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

/* Single file item (dark palette) */
.m-page-card .m-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.75rem;
    border: 1px solid #1e293b;
    background-color: #020617;
    color: #e5e7eb;
}

/* Main content (icon + filename + meta) */
.m-page-card .m-file-item-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1 1 auto;
}

/* Text wrapper in dark card */
.m-page-card .m-file-item-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Thumbnail / extension square in dark card */
.m-page-card .m-file-item-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    background-color: rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    overflow: hidden;
    color: #e5e7eb;
}

/* Thumbnail image – nicely cropped */
.m-page-card .m-file-item-thumb {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

/* Filename + file meta text */
.m-page-card .m-file-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e5e7eb;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
}

.m-page-card .m-file-item-meta {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Remove (X) button */
.m-page-card .m-file-item-remove {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    padding: 0.1rem 0.25rem;
    border-radius: 999px;
    transition:
        background-color 0.16s ease,
        color 0.16s ease;
}

.m-page-card .m-file-item-remove:hover {
    background-color: rgba(248, 113, 113, 0.18);
    color: #fecaca;
}

/* File error state in dark card */
.m-page-card .m-file-item--error {
    border-color: #fecaca;
    background-color: rgba(248, 113, 113, 0.06);
    color: #fecaca;
}

/* Dark dropzone styling inside demo card */
.m-page-card .m-dropzone {
    background: rgba(15, 23, 42, 0.9);
    border-color: #334155;
}

.m-page-card .m-dropzone:hover {
    border-color: #60a5fa;
    background-color: rgba(30, 64, 175, 0.25);
}

.m-page-card .m-dropzone.is-dragover {
    border-color: #3b82f6;
    background-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

/* Dropzone text tweaks on dark card (prevent overflow, better contrast) */
.m-page-card .m-dropzone-text {
    max-width: 100%;
    text-align: center;
}

.m-page-card .m-dropzone-text strong {
    color: #e5e7eb;
}

.m-page-card .m-dropzone-text span {
    color: #94a3b8;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Dark alerts inside card */
.m-page-card .m-alert {
    margin-top: 1rem;
    font-size: 0.85rem;
    border-radius: 0.75rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid transparent;
    background-color: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    display: none;
}

.m-page-card .m-alert.is-visible {
    display: block;
}

/* Success alert on dark background */
.m-page-card .m-alert--success {
    background-color: rgba(22, 163, 74, 0.18);
    border-color: rgba(34, 197, 94, 0.75);
    color: #bbf7d0;
}

/* Error alert on dark background */
.m-page-card .m-alert--error {
    background-color: rgba(153, 27, 27, 0.22);
    border-color: rgba(248, 113, 113, 0.9);
    color: #fecaca;
}

.m-page-card .m-alert--success::before,
.m-page-card .m-alert--error::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.m-page-card .m-alert--success::before {
    background-color: #22c55e;
}

.m-page-card .m-alert--error::before {
    background-color: #f97373;
}

/* Bottom navigation – centered link back to index */
.m-page-nav-bottom {
    width: 100%;
    max-width: 640px;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

.m-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #9ca3af;
    text-decoration: none;
    transition:
        background 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}

.m-link-pill-icon {
    font-size: 0.9rem;
}

.m-link-pill:hover {
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    transform: translateY(-1px);
}

.m-link-pill:active {
    transform: translateY(0);
}

/* Responsive tweaks for single-form layout */
@media (max-width: 900px) {
    .m-page-wrap {
        padding-inline: 2rem;
    }

    .m-page-card {
        padding: 1.5rem 1.6rem 1.8rem;
        border-radius: 1.4rem;
    }

    .m-page-title {
        font-size: 1.3rem;
    }

    .m-page-sub {
        font-size: 0.88rem;
    }
}

@media (max-width: 640px) {
    .m-page-wrap {
        /* top | right | bottom | left */
        justify-content: flex-start;
        padding: 1.6rem 1.55rem 2rem 1.35rem;
        gap: 0.8rem;
    }

    .m-page-card {
        padding: 1.3rem 1.3rem 1.6rem;
        border-radius: 1.25rem;
        box-shadow: 0 18px 60px rgba(15, 23, 42, 0.95);
    }

    .m-page-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .m-page-title {
        font-size: 1.25rem;
    }

    .m-page-badge {
        font-size: 0.68rem;
        padding: 0.16rem 0.65rem;
    }

    .m-page-sub {
        font-size: 0.86rem;
    }

    .m-row-group {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .m-row {
        margin-bottom: 0.8rem;
    }

    .m-page-card .m-label {
        font-size: 0.82rem;
    }

    .m-page-card .m-btn {
        width: 100%;
        justify-content: center;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
        font-size: 0.8rem;
    }

    .m-page-nav-bottom {
        margin-top: 0.2rem;
    }

    .m-link-pill {
        font-size: 0.72rem;
        padding: 0.35rem 0.9rem;
    }
}

@media (max-width: 400px) {
    .m-page-wrap {
        /* top | right | bottom | left */
        padding: 1.5rem 1.45rem 1.8rem 1.25rem;
    }

    .m-page-card {
        padding-inline: 1.1rem;
    }

    .m-page-title {
        font-size: 1.15rem;
    }

    .m-page-sub {
        font-size: 0.82rem;
    }
}

/* -------------------------------------------------
 * Index (demo listing) layout
 * ------------------------------------------------- */

.m-home {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 3rem;
}

.m-home-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.m-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e5e7eb;
    margin-bottom: 0.9rem;
}

.m-logo span:first-child {
    font-weight: 600;
    margin-right: 0.4rem;
}

.m-title {
    font-size: clamp(1.9rem, 3vw, 2.3rem);
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #f9fafb;
}

.m-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: #9ca3af;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.m-badge-row {
    margin-top: 1.2rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.m-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: #cbd5f5;
    background: rgba(15, 23, 42, 0.7);
}

/* Cards grid for demo listing */
.m-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.4rem;
    margin-top: 2.4rem;
}

/* Individual demo card */
.m-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.96);
    border-radius: 1rem;
    padding: 1.45rem 1.25rem 1.45rem;
    padding-top: 1.8rem; /* space for flag in the corner */
    border: 1px solid rgba(30, 64, 175, 0.45);
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.85);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.m-card:hover {
    transform: translateY(-3px);
    border-color: rgba(96, 165, 250, 0.9);
    box-shadow: 0 24px 75px rgba(15, 23, 42, 0.95);
    background: rgba(15, 23, 42, 0.98);
}

/* Accent card (e.g. Demo #1) */
.m-card--accent {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.2), transparent 55%)
        rgba(15, 23, 42, 0.98);
    border-color: rgba(59, 130, 246, 0.9);
}

.m-card--accent:hover {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.28), transparent 60%)
        rgba(15, 23, 42, 0.99);
}

/* Flags in corner (Most used / Advanced / Success / Upcoming) */
.m-card-flag {
    position: absolute;
    top: 0.95rem;
    right: 0.95rem;
    padding: 0.16rem 0.6rem;
    border-radius: 999px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    border: 1px solid rgba(148, 163, 184, 0.65);
    background: rgba(15, 23, 42, 0.98);
    color: #e5e7eb;
    pointer-events: none;
}

.m-card-flag--primary {
    border-color: rgba(251, 191, 36, 0.9);
    color: #facc15;
}

.m-card-flag--advanced {
    border-color: rgba(56, 189, 248, 0.9);
    color: #7dd3fc;
}

.m-card-flag--success {
    border-color: rgba(34, 197, 94, 0.9);
    color: #a7f3d0;
}

.m-card-flag--upcoming {
    border-color: rgba(129, 140, 248, 0.9);
    color: #c7d2fe;
}

.m-card-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.2rem;
}

.m-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    color: #e5e7eb;
}

.m-card-desc {
    font-size: 0.85rem;
    color: #9ca3af;
    margin: 0 0 0.75rem;
}

.m-card-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.85rem;
}

.m-card-meta span + span::before {
    content: "•";
    margin: 0 0.4rem;
    opacity: 0.5;
}

/* Footer: CTA + technical note */
.m-card-footer {
    margin-top: auto;        /* push footer to card bottom */
    padding-top: 0.6rem;     /* small spacing above meta */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

/* "Open demo" button */
.m-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.98);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.85);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.85),
        0 10px 26px rgba(15, 23, 42, 0.9);
    text-decoration: none;
    cursor: pointer;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease,
        color 0.16s ease;
}

.m-card-link::after {
    content: '→';
    font-size: 0.82rem;
    opacity: 0.85;
    transform: translateX(0);
    transition: transform 0.16s ease, opacity 0.16s ease;
}

.m-card-link:hover {
    background: #111827;
    border-color: rgba(209, 213, 219, 0.95);
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.9),
        0 14px 32px rgba(15, 23, 42, 0.95);
    color: #f9fafb;
}

.m-card-link:hover::after {
    transform: translateX(3px);
    opacity: 1;
}

.m-card-link:active {
    transform: translateY(0);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 1),
        0 8px 22px rgba(15, 23, 42, 0.95);
}

.m-card-link:focus-visible {
    outline: 2px solid #e5e7eb;
    outline-offset: 3px;
}

/* Disabled button for "Coming soon" demos */
.m-card-link--disabled {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
    border-style: dashed;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.7);
}

.m-card-link--disabled::after {
    content: '…';
}

/* "Uses …php/html" note */
.m-card-footnote {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.74rem;
    color: #9ca3af;
}

.m-card-footnote-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    flex-shrink: 0;
}

.m-card-footnote code {
    font-size: 0.74rem;
    color: #e5e7eb;
}

/* Bottom section on index page (docs link + code hint) */
.m-bottom {
    margin-top: 2.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.8rem;
    align-items: flex-start;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #9ca3af;
}

.m-bottom-main {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-width: 460px;
}

/* Version badge with pulse */
.m-version-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background:
        radial-gradient(circle at left, rgba(37, 99, 235, 0.34), transparent 55%)
        rgba(15, 23, 42, 0.98);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.98);
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #e5e7eb;
    margin-bottom: 0.35rem;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease;
}

.m-version-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
    flex-shrink: 0;
    overflow: visible;
}

.m-version-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.45);
    opacity: 0;
    transform: scale(0.8);
    animation: m-version-pulse 1.8s ease-out infinite;
}

@keyframes m-version-pulse {
    0% {
        opacity: 0.7;
        transform: scale(0.9);
    }
    60% {
        opacity: 0;
        transform: scale(1.6);
    }
    100% {
        opacity: 0;
        transform: scale(1.6);
    }
}

.m-version-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.98);
    border-color: rgba(191, 219, 254, 0.9);
}

.m-version-label {
    font-weight: 600;
    color: #e5edff;
}

.m-version-date {
    color: #c4d7ff;
}

.m-bottom-text {
    color: #9ca3af;
}

/* Documentation button */
.m-doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.m-doc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.4rem 1.05rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.98);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.85);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.9),
        0 10px 26px rgba(15, 23, 42, 0.9);
    text-decoration: none;
    cursor: pointer;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease,
        color 0.16s ease;
}

.m-doc-btn::after {
    content: '↗';
    font-size: 0.82rem;
    opacity: 0.85;
    transform: translateX(0);
    transition: transform 0.16s ease, opacity 0.16s ease;
}

.m-doc-btn:hover {
    background: #111827;
    border-color: rgba(209, 213, 219, 0.95);
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.9),
        0 14px 32px rgba(15, 23, 42, 0.95);
    color: #f9fafb;
}

.m-doc-btn:hover::after {
    transform: translateX(3px);
    opacity: 1;
}

.m-doc-btn:active {
    transform: translateY(0);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 1),
        0 8px 22px rgba(15, 23, 42, 0.95);
}

.m-doc-btn:focus-visible {
    outline: 2px solid #e5e7eb;
    outline-offset: 3px;
}

.m-code-hint {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.7);
    max-width: 480px;
}

.m-code-hint-code {
    word-break: break-word;
}

.m-code-hint-note {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: #9ca3af;
}

.m-code-hint-note code {
    font-size: 0.78rem;
    color: #e5e7eb;
}

.m-bottom a {
    color: #bfdbfe;
    text-decoration: none;
}

.m-bottom a:hover {
    text-decoration: underline;
}

/* Index bottom – responsive */
@media (max-width: 640px) {
    .m-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* -------------------------------------------------
 * Wizard (project-quote) common pieces
 * ------------------------------------------------- */

.m-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.4rem;
}

.m-step-item {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.85);
    font-size: 0.78rem;
    color: #9ca3af;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        color 0.18s ease;
}

.m-step-item-index {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.9);
    color: #e5e7eb;
}

.m-step-item-label {
    white-space: nowrap;
}

.m-step-item.is-active {
    border-color: rgba(96, 165, 250, 0.95);
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.3), rgba(15, 23, 42, 0.95));
    color: #e5e7eb;
}

.m-step-item.is-active .m-step-item-index {
    border-color: transparent;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
}

.m-step-item.is-complete {
    border-color: rgba(34, 197, 94, 0.85);
    color: #bbf7d0;
}

.m-step-item.is-complete .m-step-item-index {
    border-color: transparent;
    background: #22c55e;
}

.m-wizard {
    margin-top: 0.5rem;
}

.m-step {
    display: none;
    opacity: 0;
    transform: translateY(4px);
    transition:
        opacity 0.16s ease,
        transform 0.16s ease;
}

.m-step.is-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.m-step-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: #f9fafb;
}

.m-step-sub {
    font-size: 0.85rem;
    color: #9ca3af;
    margin: 0 0 1.1rem;
}

.m-wizard-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.3rem;
}

/* Wizard responsive tweaks */
@media (max-width: 640px) {
    .m-steps {
        flex-direction: column;
    }
}

/* -------------------------------------------------
 * “Thank you” page accents
 * ------------------------------------------------- */

.m-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: #cbd5f5;
    margin-bottom: 0.9rem;
}

.m-page-eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.m-page-note {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 1.7rem;
}

.m-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: center;
}

/* Primary button on thank-you page (legacy helper, if needed) */
.m-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #f9fafb;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.m-btn-primary span {
    margin-right: 0.4rem;
}

.m-link-ghost {
    font-size: 0.85rem;
    color: #9ca3af;
    text-decoration: none;
}

.m-link-ghost:hover {
    color: #e5e7eb;
    text-decoration: underline;
}

/* -------------------------------------------------
 * Extra helpers ported from inline styles
 * ------------------------------------------------- */

/* Dark select options inside the page card */
.m-page-card select.m-input option {
    background-color: #020617;
    color: #e5e7eb;
}

.m-page-card select.m-input option[value=""] {
    color: #6b7280; /* softer placeholder */
}

.m-page-card select.m-input option:hover,
.m-page-card select.m-input option:focus,
.m-page-card select.m-input option:checked {
    background-color: #1e293b;
    color: #f9fafb;
}

/* Fieldset / legend / hint for longer forms */
.m-fieldset {
    border: 0;
    padding: 1.05rem 0 0;
    margin: 1.25rem 0 0;
    border-top: 1px solid rgba(31, 41, 55, 0.8);
}

.m-fieldset:first-of-type {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 0;
}

.m-legend {
    padding: 0;
    margin: 0 0 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #9ca3af;
}

.m-hint {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}

/* Consent checkbox – circular with pulsing dot */
.m-consent {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: #d1d5db;
    cursor: pointer;
    margin-top: 0.4rem;
}

.m-consent-input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: #020617;
    position: relative;
    flex-shrink: 0;
    margin-top: 0.05rem;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.m-consent-input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.m-consent-input:checked {
    border-color: transparent;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 1),
        0 0 0 4px rgba(37, 99, 235, 0.25);
}

.m-consent-input::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    border-radius: 999px;
    background: transparent;
    transform: translate(-50%, -50%);
}

.m-consent-input:checked::after {
    width: 6px;
    height: 6px;
    background: #f9fafb;
    box-shadow: 0 0 0 0 rgba(249, 250, 251, 0.8);
    animation: m-consent-dot-pulse 1.5s ease-out infinite;
}

@keyframes m-consent-dot-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(249, 250, 251, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(249, 250, 251, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(249, 250, 251, 0);
    }
}

.m-consent-text {
    line-height: 1.5;
}

/* Dropzone text – colors and wrapping inside dark card */
.m-page-card .m-dropzone-text {
    max-width: 100%;
    text-align: center;
}

.m-page-card .m-dropzone-text strong {
    color: #e5e7eb;
}

.m-page-card .m-dropzone-text span {
    color: #94a3b8;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Wizard: footer variant for first step (only Next aligned right) */
.m-wizard-footer--first {
    justify-content: flex-end;
}

/* Card width modifiers (instead of inline max-width on HTML) */
.m-page-card--narrow {
    max-width: 480px;
}

.m-page-card--wide {
    max-width: 1040px;
}

.m-page-card--xl {
    max-width: 880px;
}

/* Mobile: slightly smaller dropzone long text */
@media (max-width: 640px) {
    .m-page-card .m-dropzone-text span {
        font-size: 0.82rem;
    }
}

/* Centered header for thank-you screens */
.m-page-header--center {
    text-align: center;
}

/* Icon circle used on thank-you screens */
.m-page-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    background: radial-gradient(circle at 30% 0, #22c55e 0, #15803d 40%, #16a34a 100%);
    box-shadow:
        0 0 0 1px rgba(34, 197, 94, 0.45),
        0 18px 35px rgba(0, 0, 0, 0.65);
}

/* Actions row under the thank-you message */
.m-thank-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.75rem;
}

/* Ghost / secondary button – legacy helper */
.m-btn--ghost {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.75);
    color: #e5e7eb;
}

.m-btn--ghost:hover,
.m-btn--ghost:focus-visible {
    border-color: rgba(248, 250, 252, 0.95);
    background: rgba(15, 23, 42, 0.9);
}

/* Optional small icon inside buttons */
.m-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.35rem;
    font-size: 0.95em;
}

/* Buttons – primary, secondary, ghost (global) */

.m-btn,
.m-btn-secondary,
.m-btn-ghost {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

/* Primary button – filled (used mainly outside dark card) */

.m-btn {
    background: #38bdf8;
    border-color: #38bdf8;
    color: #020617;
}

.m-btn:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
    transform: translateY(-0.5px);
}

.m-btn:active {
    transform: translateY(0);
}

/* Secondary button – restored „superb” outline look */

.m-btn-secondary {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

.m-btn-secondary:hover {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(209, 213, 219, 0.95);
    color: #f9fafb;
    transform: translateY(-0.5px);
}

.m-btn-secondary:active {
    transform: translateY(0);
}

/* Ghost button – ultra light outline, perfect for "Fill the form again" */

.m-btn-ghost {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.45);
    color: #e5e7eb;
}

.m-btn-ghost:hover {
    background: rgba(15, 23, 42, 0.75);
    border-color: #38bdf8;
    color: #f9fafb;
    transform: translateY(-0.5px);
}

.m-btn-ghost:active {
    transform: translateY(0);
}

/* Actions row on thank pages (overrides previous generic .m-actions) */

.m-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
    align-items: center;
    justify-content: center;
}

/* Thank-you cards – centered and a bit more "premium" */

.m-page-card--thank {
    max-width: 640px;
    margin: 0 auto;
}

.m-page-badge-row {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.m-page-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
}

.m-page-badge-icon {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #38bdf8, #0f172a);
}

/* Big check icon for success pages */

.m-thank-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: radial-gradient(circle at 30% 30%, #38bdf8, #020617);
    display: flex;
    align-items: center;
    justify-content: center;
}

.m-thank-icon-check {
    font-size: 1.5rem;
    line-height: 1;
    color: #e5e7eb;
}

/* Thank-you cards – success green accent (ONLY badge + icon, not buttons) */

.m-page-card--thank .m-page-badge {
    border-color: rgba(34, 197, 94, 0.75);
    color: #bbf7d0;
}

.m-page-card--thank .m-page-badge-icon {
    background: radial-gradient(circle at 30% 30%, #22c55e, #052e16);
}

.m-page-card--thank .m-thank-icon {
    border-color: rgba(34, 197, 94, 0.8);
    background: radial-gradient(circle at 30% 30%, #22c55e, #052e16);
}
