/*
 * EZPIN Final — structural design contract
 *
 * This layer must never redesign approved artwork. Global controls, type,
 * cards, glass effects and motion remain owned by global.css and page CSS.
 * This file is limited to structural safeguards and accessibility behavior.
 */

:root {
    /* Locked brand aliases. Values are defined by the original global system. */
    --ez-ds-brand: var(--ez-orange, #f2672a);
    --ez-ds-dark: var(--ez-dark, #12344d);
    --ez-ds-ink: var(--ez-slate, #0f172a);
    --ez-ds-success: var(--ez-green, #22c55e);

    /* Structural tokens only. They do not override approved section artwork. */
    --ez-ds-container: 1200px;
    --ez-ds-gutter: clamp(20px, 4vw, 40px);
    --ez-ds-space-0: 0;
    --ez-ds-space-1: 4px;
    --ez-ds-space-2: 8px;
    --ez-ds-space-3: 12px;
    --ez-ds-space-4: 16px;
    --ez-ds-space-5: 24px;
    --ez-ds-space-6: 32px;
    --ez-ds-space-7: 48px;
    --ez-ds-space-8: 64px;
    --ez-ds-space-9: 80px;
    --ez-ds-space-10: 96px;
    --ez-ds-radius-control: var(--ez-r-md, 12px);
    --ez-ds-radius-compact: var(--ez-r-lg, 16px);
    --ez-ds-radius-card: var(--ez-r-xl, 24px);
    --ez-ds-radius-feature: var(--ez-r-2xl, 32px);
    --ez-ds-radius-pill: var(--ez-r-full, 9999px);
    --ez-ds-shadow-card: 0 10px 20px rgba(15, 23, 42, .08);
    --ez-ds-shadow-glass: 0 16px 40px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
    --ez-ds-shadow-accent: 0 18px 42px rgba(242, 103, 42, .16);
    --ez-ds-shadow-control: 0 10px 25px rgba(242, 103, 42, .25);
    --ez-ds-type-display: clamp(2.5rem, 4vw, 3.5rem);
    --ez-ds-type-section: clamp(2rem, 3.2vw, 2.8rem);
    --ez-ds-type-subsection: clamp(1.35rem, 2vw, 1.6rem);
    --ez-ds-type-card: 1.25rem;
    --ez-ds-motion-fast: 180ms ease;
    --ez-ds-motion-standard: 300ms cubic-bezier(.4, 0, .2, 1);
}

/* Four spacing roles shared by all 30 section patterns. */
body.ez-design-system-v2 main.ez-global-wrapper .ez-section.ez-space--hero {
    padding-block: 130px var(--ez-ds-space-10);
}

body.ez-design-system-v2 main.ez-global-wrapper .ez-section.ez-space--standard {
    padding-block: var(--ez-ds-space-9);
}

body.ez-design-system-v2 main.ez-global-wrapper .ez-section.ez-space--compact {
    padding-block: var(--ez-ds-space-8);
}

body.ez-design-system-v2 main.ez-global-wrapper .ez-section.ez-space--focused {
    padding-block: var(--ez-ds-space-9);
}

/* Typography roles: page CSS may color or decorate text, not redefine scale. */
body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="heading"] {
    margin-block-start: 0;
    text-wrap: balance;
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="heading"][data-ez-variant="display"] {
    font-size: var(--ez-ds-type-display);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -.035em;
    margin-block-end: var(--ez-ds-space-5);
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="heading"][data-ez-variant="section"] {
    font-size: var(--ez-ds-type-section);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.025em;
    margin-block-end: var(--ez-ds-space-5);
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="heading"][data-ez-variant="subsection"] {
    font-size: var(--ez-ds-type-subsection);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.015em;
    margin-block-end: var(--ez-ds-space-4);
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="heading"][data-ez-variant="card"] {
    font-size: var(--ez-ds-type-card);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.01em;
    margin-block-end: var(--ez-ds-space-3);
}

/* Fallbacks cover the native 404 template and renderer-generated headings. */
body.ez-design-system-v2 main.ez-global-wrapper .ez-section h1:not([data-ez-component]) {
    font-size: var(--ez-ds-type-display);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -.035em;
}

body.ez-design-system-v2 main.ez-global-wrapper .ez-section h2:not([data-ez-component]) {
    font-size: var(--ez-ds-type-section);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.025em;
}

/* The two approved button variants plus one compact header size. */
body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="button"] {
    min-height: 52px;
    padding: 0 var(--ez-ds-space-6);
    border-radius: var(--ez-ds-radius-control);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    transition: var(--ez-t-spring, var(--ez-ds-motion-standard));
}

body.ez-design-system-v2 main.ez-global-wrapper .ez-b2c-cta-btn {
    min-height: 52px;
    padding: 0 var(--ez-ds-space-6);
    border-radius: var(--ez-ds-radius-control);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

body.ez-design-system-v2 .fluentform .ff-btn-submit {
    min-height: 52px;
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="button"][data-ez-variant="primary"] {
    color: white;
    background-color: var(--ez-ds-brand);
    box-shadow: var(--ez-ds-shadow-control);
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="button"][data-ez-variant="secondary"] {
    color: var(--ez-ds-ink);
    background-color: rgba(255, 255, 255, .5);
    border: 2px solid var(--ez-ds-dark);
    box-shadow: 0 4px 15px rgba(15, 23, 42, .08);
}

/* Badge variants share one geometry and type rhythm. */
body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="badge"] {
    display: inline-flex;
    align-items: center;
    gap: var(--ez-ds-space-2);
    min-height: 28px;
    padding: 6px 14px;
    border-radius: var(--ez-ds-radius-pill);
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .06em;
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="badge"][data-ez-variant="brand"] {
    color: var(--ez-ds-brand);
    background-color: var(--ez-orange-soft, #fff7ed);
    border-color: #ffedd5;
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="badge"][data-ez-variant="neutral"] {
    color: var(--ez-gray, #475569);
    background-color: var(--ez-bg, #f8fafc);
    border-color: var(--ez-border, #e2e8f0);
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="badge"][data-ez-variant="overlay"] {
    color: var(--ez-ds-ink);
    background-color: rgba(255, 255, 255, .9);
    border-color: rgba(255, 255, 255, .95);
    box-shadow: var(--ez-ds-shadow-card);
}

/* Six card variants replace page-by-page radius, border and elevation drift. */
body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="card"] {
    border-radius: var(--ez-card-radius, var(--ez-ds-radius-card));
    border-color: var(--ez-card-border, var(--ez-border, #e2e8f0));
    box-shadow: var(--ez-card-shadow, var(--ez-ds-shadow-card));
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="card"][data-ez-variant="standard"] {
    --ez-card-radius: var(--ez-ds-radius-card);
    --ez-card-border: var(--ez-border, #e2e8f0);
    --ez-card-shadow: var(--ez-ds-shadow-card);
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="card"][data-ez-variant="compact"] {
    --ez-card-radius: var(--ez-ds-radius-compact);
    --ez-card-border: var(--ez-border, #e2e8f0);
    --ez-card-shadow: none;
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="card"][data-ez-variant="metric"] {
    --ez-card-radius: var(--ez-ds-radius-control);
    --ez-card-border: var(--ez-border, #e2e8f0);
    --ez-card-shadow: none;
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="card"][data-ez-variant="glass"] {
    --ez-card-radius: var(--ez-ds-radius-card);
    --ez-card-border: rgba(255, 255, 255, .9);
    --ez-card-shadow: var(--ez-ds-shadow-glass);
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="card"][data-ez-variant="accent"] {
    --ez-card-radius: var(--ez-ds-radius-card);
    --ez-card-border: var(--ez-ds-brand);
    --ez-card-shadow: var(--ez-ds-shadow-accent);
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="card"][data-ez-variant="inverse"] {
    --ez-card-radius: var(--ez-ds-radius-compact);
    --ez-card-border: rgba(255, 255, 255, .16);
    --ez-card-shadow: none;
}

body.ez-design-system-v2 main.ez-global-wrapper [data-ez-component="icon"] {
    width: 60px;
    height: 60px;
    border-radius: var(--ez-ds-radius-compact);
}

/* Prevent below-fold section measurement from producing scroll jumps. */
body.ez-design-system-v2 main.ez-global-wrapper .ez-section {
    content-visibility: visible;
    contain-intrinsic-size: none;
}

/* Keyboard focus is additive and does not alter the normal visual state. */
body.ez-design-system-v2 :where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ez-ds-brand) 65%, white);
    outline-offset: 3px;
}

/* The header is fixed; reserve enough space without styling the hero itself. */
@media (min-width: 1024px) {
    body.ez-design-system-v2 main.ez-global-wrapper :where(
        .ez-hero-wrapper,
        .ez-hero,
        .ez-about-hero,
        .ez-contact-hero-wrapper,
        .ez-leadership-hero,
        .ez-partners-hero-wrapper
    ) {
        padding-top: 130px;
    }
}

@media (max-width: 1023px) {
    body.ez-design-system-v2 main.ez-global-wrapper .ez-section.ez-space--hero {
        padding-block: 120px var(--ez-ds-space-8);
    }

    body.ez-design-system-v2 main.ez-global-wrapper .ez-section.ez-space--standard,
    body.ez-design-system-v2 main.ez-global-wrapper .ez-section.ez-space--focused {
        padding-block: var(--ez-ds-space-8);
    }

    body.ez-design-system-v2 main.ez-global-wrapper .ez-section.ez-space--compact {
        padding-block: var(--ez-ds-space-7);
    }

    body.ez-design-system-v2 main.ez-global-wrapper :where(
        .ez-hero-wrapper,
        .ez-hero,
        .ez-about-hero,
        .ez-contact-hero-wrapper,
        .ez-leadership-hero,
        .ez-partners-hero-wrapper
    ) {
        padding-top: 60px;
    }
}

/* Keep approved motion visible while preventing off-screen animation work. */
body.ez-design-system-v2 [data-ez-performance-offscreen="true"],
body.ez-design-system-v2 [data-ez-performance-offscreen="true"] * {
    animation-play-state: paused !important;
}

/* Normal motion remains intact. Only explicit OS reduced-motion is honored. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    body.ez-design-system-v2 *,
    body.ez-design-system-v2 *::before,
    body.ez-design-system-v2 *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
