* { box-sizing: border-box; }

:root {
    --app-content-max-width: 1600px;
    --app-bottom-nav-offset: calc(56px + env(safe-area-inset-bottom, 0px));
}

/** Conteneur centré pour pages larges (tunnel tirage, catalogue, accueil connecté, admin liste). */
.appContentMax {
    max-width: var(--app-content-max-width);
    margin-inline: auto;
    width: 100%;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
    color: rgba(15, 23, 42, 0.95);
    background:
        radial-gradient(900px 500px at 15% 5%, rgba(31, 111, 235, 0.22), transparent 60%),
        radial-gradient(900px 500px at 90% 10%, rgba(16, 185, 129, 0.18), transparent 60%),
        radial-gradient(900px 500px at 40% 90%, rgba(168, 85, 247, 0.16), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.55));
}

@media (max-width: 900px), (orientation: portrait) {
    html,
    body {
        height: auto;
        min-height: 100%;
    }

    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .page {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

}

/* Applique Open Sans par défaut partout */
body {
    font-family: 'Open Sans', sans-serif;
}

/* Applique Rubik uniquement aux titres et au logo */
h1, h2, h3, .logo-text {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
}

h1, h2, h3 { letter-spacing: -0.02em; }

input, select, button {
    font: inherit;
}

/* Helpers for fullscreen pages */
.page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.grow {
    flex: 1 1 auto;
    min-height: 0; /* required for nested overflow */
}

.scroll {
    overflow: auto;
    min-height: 0;
}

table {
    text-align: center;
    vertical-align: middle;
}
td {
    vertical-align: inherit;
}

.site-footer {
    flex-shrink: 0;
    padding: 20px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 650;
    color: rgba(15, 23, 42, 0.65);
}

.footer-container {
    max-width: var(--app-content-max-width);
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links a {
    color: rgba(15, 23, 42, 0.75);
    text-decoration: none;
    font-weight: 750;
}

.footer-links a:hover {
    color: #1f6feb;
    text-decoration: underline;
}

.legalPage h1 {
    margin: 0 0 16px 0;
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
}

@media (max-width: 900px), (orientation: portrait) {
    .site-footer {
        padding-bottom: calc(20px + var(--app-bottom-nav-offset));
    }

    .footer-container {
        flex-direction: column;
        align-items: flex-start;
    }
}