html,
body {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: var(--color-surface);
    color: var(--color-on-surface);
    font-family: var(--font-family-body);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-body);
    line-height: var(--line-height-body);
    letter-spacing: var(--letter-spacing-body);
}

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

/* TeleportHQ component host elements are custom inline elements by default.
   Make them real full-width blocks without changing the inner site containers. */
navigation-wrapper.navigation-wrapper,
footer-wrapper.footer-wrapper {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

navigation-wrapper.navigation-wrapper {
    top: auto;
    position: relative;
    z-index: auto;
    border-bottom: 0;
    background: transparent;
}

.navigation-container1,
.footer-container1,
.navigation-container3,
.footer-container3 {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.navigation-container2,
.footer-container2 {
    display: none;
}

/* Keep the actual site header/footer full bleed while their inner containers
   retain the same max-width and spacing as on the rest of the website. */
nav.navigation-wrapper,
.footer-root {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

nav.navigation-wrapper {
    display: block;
    left: 0;
    right: 0;
}

.footer-root {
    flex-shrink: 0;
}

/* Use exactly the same typography system as the rest of the website. */
.legal-page,
.legal-page p,
.legal-page li,
.legal-page a,
.legal-page span,
.legal-page strong,
.legal-page label,
.navigation-wrapper,
.footer-root,
button,
input,
textarea,
select {
    font-family: var(--font-family-body);
}

.legal-page h1,
.legal-page h2,
.legal-page h3,
.legal-page h4,
.legal-page h5,
.legal-page h6 {
    font-family: var(--font-family-heading);
    font-style: var(--font-style-heading);
    font-weight: var(--font-weight-heading);
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-heading);
}

/* Legal page layout */
.legal-page {
    width: 100%;
    flex: 1 0 auto;
    min-height: 60vh;
    margin: 0;
    background: var(--color-surface);
    color: var(--color-on-surface);
}

.legal-hero {
    width: 100%;
    margin: 0;
    padding: var(--spacing-3xl) var(--spacing-xl) var(--spacing-2xl);
    background: var(--color-surface-elevated);
    border-bottom: var(--divider-value);
}

.legal-hero-inner,
.legal-content {
    width: 100%;
    max-width: 900px;
    margin-inline: auto;
}

.legal-hero p {
    margin-top: var(--spacing-md);
    color: var(--color-on-surface-secondary);
}

.legal-content {
    padding: var(--spacing-3xl) var(--spacing-xl);
}

.legal-company-card {
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-card);
}

.legal-company-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-sm) var(--spacing-xl);
    margin-top: var(--spacing-md);
}

.legal-company-grid p {
    overflow-wrap: anywhere;
}

.legal-section {
    margin-top: var(--spacing-2xl);
}

.legal-section h2 {
    margin-bottom: var(--spacing-md);
}

.legal-section h3 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.legal-section p,
.legal-section li {
    line-height: 1.75;
}

.legal-section ul,
.legal-section ol {
    margin: var(--spacing-md) 0 0;
    padding-left: var(--spacing-lg);
}

/* Remove browser-blue / purple links and all underlines on legal pages. */
.legal-page a,
.legal-page a:link,
.legal-page a:visited,
.legal-page a:hover,
.legal-page a:active {
    color: var(--color-on-surface) !important;
    text-decoration: none !important;
    text-decoration-line: none !important;
}

.legal-page a:hover {
    color: var(--color-secondary) !important;
}

/* Header links must use the site's own child-element colors, never UA blue/purple. */
nav.navigation-wrapper a,
nav.navigation-wrapper a:link,
nav.navigation-wrapper a:visited,
nav.navigation-wrapper a:hover,
nav.navigation-wrapper a:active {
    color: inherit;
    text-decoration: none !important;
    text-decoration-line: none !important;
}

/* Footer links stay white/gold like on the main site and never get underlined. */
.footer-root a,
.footer-root a:link,
.footer-root a:visited,
.footer-root a:active {
    color: var(--color-on-primary);
    text-decoration: none !important;
    text-decoration-line: none !important;
}

.footer-root a:hover {
    color: var(--color-secondary);
    text-decoration: none !important;
    text-decoration-line: none !important;
}

.footer-root .footer-link,
.footer-root .footer-legal-link,
.footer-root .footer-link:hover,
.footer-root .footer-legal-link:hover,
.footer-root .footer-link:visited,
.footer-root .footer-legal-link:visited {
    text-decoration: none !important;
    text-decoration-line: none !important;
}

/* Keep keyboard focus visible without restoring an underline. */
.legal-page a:focus-visible,
nav.navigation-wrapper a:focus-visible,
.footer-root a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    text-decoration: none !important;
}

@media (max-width: 767px) {
    .legal-hero {
        padding: var(--spacing-2xl) var(--spacing-md) var(--spacing-xl);
    }

    .legal-content {
        padding: var(--spacing-2xl) var(--spacing-md);
    }

    .legal-company-grid {
        grid-template-columns: 1fr;
    }

    .legal-company-card {
        padding: var(--spacing-lg);
    }

    .legal-page,
    .legal-hero,
    .legal-content {
        max-width: 100%;
    }
}