/* ============================================================
   docspace — habillage du portail, sur la charte lb4tech.
   Les valeurs de marque ne sont PAS ici : elles viennent de
   tokens.css, copié tel quel depuis lb4tech-design. Ne jamais
   écrire une couleur en dur dans ce fichier.
   ============================================================ */

/* --- Polices (auto-hébergées, sous-ensemble latin) ------------------- */

@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ubuntu-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/ubuntu-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/ubuntu-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Ubuntu Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ubuntu-mono-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Ubuntu Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/ubuntu-mono-700.woff2') format('woff2');
}

/* --- Une exception, et une seule, à « pas de couleur en dur » --------- */

:root {
    /*
     * Texte posé SUR le jaune de marque. Ce n'est pas `--ink` : celui-ci
     * bascule en clair sur le thème sombre, ce qui donnerait du blanc sur du
     * jaune — illisible, et interdit par la charte (§9). Le jaune, lui, ne
     * change pas d'un thème à l'autre : son texte non plus. Volontairement
     * défini une seule fois, jamais redéfini sous [data-theme="dark"].
     */
    --on-accent: #1b1914;
}

/* --- Base ------------------------------------------------------------ */

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

html {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: var(--font-display);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-soft);
    /* Le fond n'est jamais plat : dégradé crème vertical (charte §3). */
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 340px) fixed;
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.25;
    margin: 0 0 12px;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 22px;
}

h3 {
    font-size: 17px;
    font-weight: 500;
}

p {
    margin: 0 0 12px;
}

a {
    color: var(--link);
    text-decoration: none;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Micro-libellé : la signature de la marque (charte §4). */
.label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted);
}

.mono {
    font-family: var(--font-mono);
    font-size: 13px;
}

/* --- Mise en page ---------------------------------------------------- */

.page {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 24px 64px;
}

.page-narrow {
    max-width: 470px;
}

.page-head {
    margin-bottom: 32px;
}

.page-head p {
    color: var(--muted);
    margin: 0;
}

/* --- En-tête --------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg-top) 82%, transparent);
    backdrop-filter: blur(12px);
    /* Filet dégradé jaune en bord inférieur (charte §5). */
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 var(--accent-tint), 0 18px 40px -34px var(--glow);
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 700;
    font-size: 17px;
}

.brand:hover {
    color: var(--ink);
    text-decoration: none;
}

.brand svg {
    width: 26px;
    height: 26px;
    display: block;
}

.brand-suffix {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted);
    padding-left: 10px;
    margin-left: 2px;
    border-left: 1px solid var(--border-strong);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.site-nav a,
.site-nav button {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: var(--r-sm);
    padding: 7px 12px;
    cursor: pointer;
    transition: background .14s ease, color .14s ease;
}

.site-nav a:hover,
.site-nav button:hover {
    background: var(--surface-3);
    color: var(--ink);
    text-decoration: none;
}

.site-nav a.is-active {
    background: var(--accent-tint);
    color: var(--ink);
}

.site-nav form {
    display: inline;
    margin: 0;
}

/* --- Boutons --------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    padding: 10px 18px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .14s ease, background .14s ease;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

/* Un seul par écran : fond jaune, texte encre, lueur (charte §6). */
.btn-primary {
    background: linear-gradient(180deg, var(--accent-bright), var(--accent-strong));
    color: var(--on-accent);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    color: var(--on-accent);
    box-shadow: 0 14px 30px -8px var(--glow);
}

.btn-ghost {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--ink);
}

.btn-ghost:hover {
    background: var(--surface-3);
    color: var(--ink);
}

.btn-block {
    width: 100%;
}

.btn .glyph {
    font-family: var(--font-mono);
}

/* --- Cartes de zone -------------------------------------------------- */

.zones {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin: 0 0 40px;
    padding: 0;
    list-style: none;
}

.zone {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform .14s ease, box-shadow .14s ease;
}

.zone:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 0 rgba(27, 25, 20, .02), 0 22px 44px -20px rgba(27, 25, 20, .26);
}

.zone-image {
    display: block;
    width: 100%;
    height: 148px;
    object-fit: cover;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.zone-body {
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.zone-title {
    font-size: 17px;
    margin: 0 0 6px;
}

.zone-title a {
    color: var(--ink);
}

.zone-title a:hover {
    color: var(--link);
    text-decoration: none;
}

.zone-desc {
    color: var(--muted);
    margin: 0 0 16px;
}

.zone-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.zone-path {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--faint);
}

/* Pastille : pilule + point de 7 px (charte §6). */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    border-radius: 999px;
    padding: 3px 11px 3px 9px;
    background: var(--surface-2);
    color: var(--muted);
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}

.badge-private {
    background: var(--accent-tint);
    color: var(--accent-deep);
}

/* --- Formulaires ----------------------------------------------------- */

.card-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    padding: 32px;
}

.field {
    margin-bottom: 18px;
}

.field label,
.field>.label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--muted);
}

.field input {
    width: 100%;
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.field input::placeholder {
    color: var(--faint);
}

.field input:focus {
    outline: none;
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px var(--accent-tint);
}

.field .hint {
    display: block;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--faint);
}

.field .hint ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.form-actions {
    margin-top: 24px;
}

.form-links {
    margin-top: 18px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* --- Messages (callouts) --------------------------------------------- */

.callout {
    border-left: 4px solid var(--info);
    background: var(--info-tint);
    border-radius: var(--r-xs);
    padding: 12px 16px;
    margin: 0 0 18px;
    color: var(--ink-soft);
}

.callout .label {
    display: block;
    margin-bottom: 2px;
    color: inherit;
    opacity: .8;
}

.callout-success {
    border-color: var(--success);
    background: var(--success-tint);
}

.callout-warning {
    border-color: var(--warning);
    background: var(--warning-tint);
}

.callout-error {
    border-color: var(--danger);
    background: var(--danger-tint);
}

/* --- État vide -------------------------------------------------------- */

.empty {
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-lg);
    padding: 40px 24px;
    text-align: center;
    color: var(--muted);
}

/* --- Page d'erreur ---------------------------------------------------- */

.error-code {
    font-family: var(--font-mono);
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-deep);
    margin: 0 0 8px;
}

/* --- Pied de page ----------------------------------------------------- */

.site-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: var(--bg-top);
}

.site-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--faint);
}

/* --- Petits écrans ---------------------------------------------------- */

@media (max-width: 640px) {
    .site-header-inner {
        flex-wrap: wrap;
        gap: 8px 16px;
    }

    .site-nav {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .brand-suffix {
        display: none;
    }

    .page {
        padding: 28px 16px 48px;
    }

    .site-footer-inner {
        flex-direction: column;
        text-align: center;
    }
}
