/*
 * Public website header and footer (resources/views/site/partials/header.blade.php and footer.blade.php).
 * Loaded by resources/views/layouts/site.blade.php. Every rule is scoped to .skip-link / .site-header / .site-nav /
 * .site-footer so it can be loaded next to any page's own CSS (including the app layouts) without leaking.
 * See docs/frontend/site-layout.md.
 *
 * Header modifiers (set with @section('header_variant', '...') in a page, space separated):
 *   (none)  sticky: the header takes its own space at the top and stays visible while scrolling
 *   fixed   the header floats over the page; the page must leave about 72px free at the top (landing, company, contact)
 *   light   white header with dark text, for white document pages (privacy, terms); the footer gap shrinks to 28px
 *
 * Markup: <a class="skip-link"> <header class="site-header [site-header--fixed]"> <nav class="site-nav [site-nav--light]">.
 * The positioning lives on .site-header (a sticky element can never leave its parent's box, so it must be the
 * outermost element); the look lives on .site-nav.
 *
 * Navigation off (@section('nav', 'off'), the auth pages): .site-nav--no-menu holds the logo only and
 * .site-footer--minimal holds the legal line only (.foot-legal).
 *
 * Submit lock (form[data-submit-lock], public-site.js): .submit-lock-spinner inside the disabled button and the
 * visually hidden live region .submit-lock-status. Both are shared by every page that loads this file.
 */

.site-nav,
.site-footer {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    box-sizing: border-box;
}

.site-nav *,
.site-nav *::before,
.site-nav *::after,
.site-footer *,
.site-footer *::before,
.site-footer *::after {
    box-sizing: border-box;
}

/* ---------- Skip link (first focusable element; visible only while focused) ---------- */

.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1001;
    padding: 0.6rem 1rem;
    background: #fff;
    color: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
    outline: 2px solid #000;
    outline-offset: -2px;
}

/* the skip link's target: no focus ring on the page body itself */
main[tabindex="-1"]:focus {
    outline: 0;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    z-index: 1000;
}

.site-header--fixed {
    position: fixed;
}

.site-nav {
    display: block;
    margin: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.25rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav .container {
    max-width: 1400px;
    width: auto;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-nav .logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
}

.site-nav .logo img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
}

.site-nav .mobile-menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0;
    background: transparent;
    color: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.site-nav .mobile-menu-toggle span {
    width: 16px;
    height: 1px;
    background: currentColor;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-nav .mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.site-nav .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.site-nav .mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.site-nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

.site-nav li {
    margin: 0;
    padding: 0;
}

.site-nav a {
    color: #888;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.3s;
    text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a.active {
    color: #fff;
    text-decoration: none;
}

/* Specificity 0,3,1: beats a host layout's own `a[href]:hover { text-decoration: underline }` (layouts.blank) */
.site-nav a[href]:hover,
.site-nav a[href]:focus,
.site-nav a[href].active,
.site-footer a[href]:hover,
.site-footer a[href]:focus {
    text-decoration: none;
}

.site-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-nav .request-demo-btn {
    padding: 0.5rem 1.2rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-family: inherit;
}

.site-nav .request-demo-btn::after {
    content: ' \2192';
}

.site-nav .request-demo-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.site-nav .login-link {
    color: #888;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* Light header (white document pages) */
.site-nav--light {
    background: rgba(255, 255, 255, 0.98);
    border-bottom-color: #d9d9d9;
}

/* the logo PNG is white; darken it on the white header */
.site-nav--light .logo img {
    filter: invert(1);
}

.site-nav--light a,
.site-nav--light .login-link {
    color: #5a5a5a;
}

.site-nav--light a:hover,
.site-nav--light a.active {
    color: #121212;
}

.site-nav--light .request-demo-btn {
    border-color: #cfcfcf;
    color: #121212;
}

.site-nav--light .request-demo-btn:hover {
    color: #000;
    border-color: #8a8a8a;
}

.site-nav--light .mobile-menu-toggle {
    border-color: rgba(0, 0, 0, 0.22);
    color: #121212;
}

/* Navigation off: the logo alone, left-aligned, same height as the full header */
.site-nav--no-menu .container {
    justify-content: flex-start;
    min-height: 26px;
}

/* ---------- Footer ---------- */

.site-footer {
    display: block;
    border-top: 1px solid #1d1e1e;
    margin: 56px 0 0;
    padding: 28px 2rem 40px;
    background: #000;
    color: #f2f2f2;
}

/* white document pages (header_variant "light"): the gap above the black footer stays 28px as before #196 */
.site-footer--light {
    margin-top: 28px;
}

.site-footer .footer-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.site-footer .foot-top {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: start;
    gap: 24px;
    margin-bottom: 44px;
}

.site-footer .foot-logo img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-top: 2px;
}

.site-footer .foot-nav {
    position: static;
    width: auto;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    border: 0;
    z-index: auto;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
    justify-self: center;
}

.site-footer .foot-nav a {
    text-decoration: none;
    color: #d0d0d0;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    transition: color 0.3s;
}

.site-footer .foot-nav a:hover {
    color: #fff;
    text-decoration: none;
}

.site-footer .foot-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
    align-content: start;
    justify-self: end;
    min-width: 230px;
}

.site-footer .foot-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-footer .foot-col a {
    text-decoration: none;
    color: #9ca0a0;
    font-size: 12px;
    line-height: 1.4;
}

.site-footer .foot-col a:hover {
    text-decoration: none;
}

.site-footer .foot-meta {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-end;
}

.site-footer .foot-tagline {
    font-size: 40px;
    letter-spacing: -0.02em;
    line-height: 1;
}

.site-footer .foot-copy {
    color: #bcbcbc;
    font-size: 14px;
    margin-left: auto;
}

/* Navigation off: the legal line only */
.site-footer--minimal {
    padding: 22px 2rem 26px;
}

.site-footer .foot-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 22px;
}

.site-footer .foot-legal .foot-copy {
    margin-left: 0;
    font-size: 12px;
}

.site-footer .foot-legal a {
    text-decoration: none;
    color: #9ca0a0;
    font-size: 12px;
    line-height: 1.4;
}

.site-footer .foot-legal a:hover {
    color: #fff;
}

/* ---------- Submit lock (form[data-submit-lock], see public-site.js) ---------- */

.submit-lock-spinner {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.6em;
    vertical-align: -0.12em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: submit-lock-spin 0.8s linear infinite;
}

@keyframes submit-lock-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .submit-lock-spinner {
        animation-duration: 2.4s;
    }
}

form[aria-busy="true"] [type="submit"][disabled] {
    cursor: progress;
    opacity: 0.85;
}

/* the polite live region: read by screen readers, never seen */
.submit-lock-status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
    .site-nav ul {
        gap: 1.25rem;
    }
}

/* Keep in step with MOBILE_BREAKPOINT in public/js/public-site.js */
@media (max-width: 992px) {
    .site-nav {
        padding: 0.9rem 1.1rem;
    }

    .site-nav .container {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 0.8rem;
    }

    .site-nav .mobile-menu-toggle {
        display: inline-flex;
        justify-self: end;
    }

    .site-nav ul {
        grid-column: 1 / -1;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        width: 100%;
        white-space: normal;
        padding: 0.25rem 0 0.5rem;
    }

    .site-nav ul.nav-open {
        display: flex;
    }

    .site-nav ul li {
        width: 100%;
    }

    .site-nav ul a {
        display: inline-block;
        width: 100%;
    }

    .site-nav .nav-right {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        justify-content: flex-start;
        padding: 0 0 0.3rem;
    }

    .site-nav .nav-right.nav-open {
        display: flex;
    }

    .site-footer .foot-top { grid-template-columns: 1fr; }
    .site-footer .foot-links { grid-template-columns: 1fr 1fr; }
    .site-footer .foot-meta { flex-direction: column; align-items: flex-start; }
    .site-footer .foot-tagline { font-size: 30px; }
    .site-footer--minimal { padding-left: 1.1rem; padding-right: 1.1rem; }
}

@media (max-width: 768px) {
    .site-nav {
        padding: 0.8rem 0.95rem;
    }

    .site-nav .nav-right {
        gap: 0.75rem;
    }

    .site-nav .request-demo-btn {
        padding: 0.42rem 0.8rem;
        font-size: 0.58rem;
    }

    .site-nav .login-link {
        font-size: 0.64rem;
    }

    .site-footer .foot-nav {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .site-footer .foot-nav {
        flex-direction: column;
        align-items: flex-start;
    }
}
