/*
 * FitUI V2 — Global Footer
 * Visual contract for the existing .fit-global-footer template.
 */

body.fitui-v2-active .fit-global-footer {
    position: relative;
    isolation: isolate;
    width: 100%;
    overflow: hidden;
    border-top: 1px solid var(--fit-border-soft);
    background:
        radial-gradient(circle at 50% 0%, rgba(var(--fit-gold-rgb), .085), transparent 30%),
        radial-gradient(circle at 88% 70%, rgba(var(--fit-gold-rgb), .025), transparent 27%),
        linear-gradient(180deg, #0a0b0e 0%, var(--fit-bg-deep) 100%);
    color: var(--fit-text-muted);
}

body.fitui-v2-active .fit-global-footer::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    left: 50%;
    width: min(920px, 72vw);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--fit-gold-rgb), .58), transparent);
    opacity: .76;
    transform: translateX(-50%);
}

body.fitui-v2-active .fit-global-footer::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -250px;
    left: 50%;
    width: 680px;
    height: 680px;
    border: 1px solid rgba(var(--fit-gold-rgb), .035);
    border-radius: 50%;
    box-shadow:
        0 0 0 80px rgba(var(--fit-gold-rgb), .012),
        0 0 0 160px rgba(var(--fit-gold-rgb), .008);
    transform: translateX(-50%);
    pointer-events: none;
}

/* Official 1480px shell */

body.fitui-v2-active .fit-footer-shell {
    position: relative;
    width: min(calc(100% - (var(--fit-gutter) * 2)), var(--fit-container)) !important;
    max-width: var(--fit-container) !important;
    margin-inline: auto !important;
    padding-top: clamp(76px, 8vw, 118px);
    padding-bottom: 30px;
}

/* Brand and statement */

body.fitui-v2-active .fit-footer-brand-line {
    max-width: 790px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

body.fitui-v2-active .fit-footer-logo {
    position: relative;
    margin-bottom: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

body.fitui-v2-active .fit-footer-logo::before {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 98px;
    height: 62px;
    border-radius: 50%;
    background: rgba(var(--fit-gold-rgb), .14);
    filter: blur(26px);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

body.fitui-v2-active .fit-footer-logo img {
    position: relative;
    display: block;
    width: 92px;
    max-width: none;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(var(--fit-gold-rgb), .20));
    transition: transform var(--fit-duration) var(--fit-ease);
}

body.fitui-v2-active .fit-footer-logo:hover img,
body.fitui-v2-active .fit-footer-logo:focus-visible img {
    transform: translateY(-3px) scale(1.025);
}

body.fitui-v2-active .fit-footer-brand-line h2 {
    max-width: 720px;
    margin: 0 0 17px !important;
    color: var(--fit-text) !important;
    font-family: var(--fit-font-display);
    font-size: clamp(32px, 4vw, 54px);
    font-weight: var(--fit-weight-black);
    line-height: 1.02;
    letter-spacing: var(--fit-tracking-tight);
    text-wrap: balance;
}

body.fitui-v2-active .fit-footer-brand-line p {
    max-width: 610px;
    margin: 0 !important;
    color: var(--fit-text-muted) !important;
    font-size: var(--fit-text-md);
    line-height: 1.75;
    text-wrap: balance;
}

/* Footer navigation */

body.fitui-v2-active .fit-footer-nav {
    width: fit-content;
    max-width: 100%;
    margin: clamp(42px, 5vw, 64px) auto 0;
    padding: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3px;
    border: 1px solid var(--fit-border);
    border-radius: var(--fit-radius-pill);
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015));
    box-shadow: var(--fit-shadow-inset), 0 18px 50px rgba(0, 0, 0, .22);
    backdrop-filter: var(--fit-blur-sm);
    -webkit-backdrop-filter: var(--fit-blur-sm);
}

body.fitui-v2-active .fit-footer-nav a {
    position: relative;
    min-height: 38px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--fit-radius-pill);
    color: var(--fit-text-muted) !important;
    font-size: var(--fit-text-md);
    font-weight: var(--fit-weight-bold);
    line-height: 1;
    letter-spacing: .025em;
    text-decoration: none !important;
    transition:
        color var(--fit-duration-fast) ease,
        border-color var(--fit-duration-fast) ease,
        background var(--fit-duration-fast) ease,
        transform var(--fit-duration-fast) ease;
}

body.fitui-v2-active .fit-footer-nav a:hover,
body.fitui-v2-active .fit-footer-nav a:focus-visible {
    border-color: var(--fit-border-gold-soft);
    background: rgba(var(--fit-gold-rgb), .08);
    color: var(--fit-gold-light) !important;
    transform: translateY(-1px);
}

/* Floating Back to Top */

body.fitui-v2-active .fit-footer-back-top {
    position: fixed;
    z-index: calc(var(--fit-z-modal) - 1);
    right: 30px;
    bottom: 30px;
    width: 58px;
    height: 58px;
    min-height: 0;
    margin: 0;
    display: block;
}

body.fitui-v2-active .fit-footer-back-top::before {
    display: none;
}

body.fitui-v2-active .fit-footer-back-top button {
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fit-gold-light), var(--fit-gold));
    box-shadow:
        0 18px 50px rgba(0, 0, 0, .38),
        0 0 34px rgba(var(--fit-gold-rgb), .30);
    color: var(--fit-on-gold);
    font-family: var(--fit-font-sans);
    cursor: pointer;
    transition:
        box-shadow var(--fit-duration) ease,
        transform var(--fit-duration) var(--fit-ease);
}

body.fitui-v2-active .fit-footer-arrow {
    width: auto;
    height: auto;
    display: block;
    border: 0;
    background: transparent;
    color: var(--fit-on-gold);
    font-size: var(--fit-text-2xl);
    font-weight: var(--fit-weight-black);
    line-height: 1;
    transition: transform var(--fit-duration) var(--fit-ease-out);
}

body.fitui-v2-active .fit-footer-back-text {
    display: none;
}

body.fitui-v2-active .fit-footer-back-top button:hover,
body.fitui-v2-active .fit-footer-back-top button:focus-visible {
    box-shadow:
        0 22px 56px rgba(0, 0, 0, .42),
        0 0 42px rgba(var(--fit-gold-rgb), .38);
    color: var(--fit-on-gold);
    transform: translateY(-5px) scale(1.05);
}

body.fitui-v2-active .fit-footer-back-top button:hover .fit-footer-arrow,
body.fitui-v2-active .fit-footer-back-top button:focus-visible .fit-footer-arrow {
    transform: translateY(-2px);
}

/* Copyright */

body.fitui-v2-active .fit-footer-bottom {
    min-height: 74px;
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: var(--fit-text-subtle);
    font-size: var(--fit-text-xs);
    font-weight: var(--fit-weight-medium);
    line-height: 1.5;
    letter-spacing: .04em;
}

body.fitui-v2-active .fit-footer-bottom span:last-child {
    color: rgba(var(--fit-gold-rgb), .64);
}

/* Generic primitive retained for future templates. */

.fit-footer {
    position: relative;
    border-top: 1px solid var(--fit-border-soft);
    background: var(--fit-bg-deep);
    color: var(--fit-text-muted);
}

.fit-footer a {
    color: var(--fit-text-muted);
    text-decoration: none;
}

.fit-footer a:hover {
    color: var(--fit-gold-light);
}

@media (max-width: 680px) {
    body.fitui-v2-active .fit-footer-shell {
        padding-top: 68px;
        padding-bottom: 24px;
    }

    body.fitui-v2-active .fit-footer-logo {
        margin-bottom: 24px;
    }

    body.fitui-v2-active .fit-footer-logo img {
        width: 82px;
    }

    body.fitui-v2-active .fit-footer-brand-line h2 {
        font-size: clamp(31px, 10vw, 42px);
    }

    body.fitui-v2-active .fit-footer-nav {
        width: 100%;
        padding: 10px;
        border-radius: var(--fit-radius-md);
    }

    body.fitui-v2-active .fit-footer-nav a {
        flex: 1 1 calc(33.333% - 6px);
        padding-inline: 10px;
    }

    body.fitui-v2-active .fit-footer-back-top {
        right: 18px;
        bottom: 18px;
        width: 54px;
        height: 54px;
        min-height: 0;
        margin: 0;
    }

    body.fitui-v2-active .fit-footer-back-top button {
        width: 54px;
        height: 54px;
        min-height: 54px;
    }

    body.fitui-v2-active .fit-footer-bottom {
        min-height: 94px;
        padding-top: 24px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 7px;
    }
}

@media (max-width: 410px) {
    body.fitui-v2-active .fit-footer-nav a {
        flex-basis: calc(50% - 6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.fitui-v2-active .fit-footer-logo img,
    body.fitui-v2-active .fit-footer-nav a,
    body.fitui-v2-active .fit-footer-back-top button,
    body.fitui-v2-active .fit-footer-arrow {
        transition: none;
    }
}
