/* ====================================================================================================================================
   CRÉER UN DOCUMENT (design V2) — même identité "papier / registre" que
   l'accueil et Mon compte (mêmes valeurs de tokens). Remplace l'ancien
   hero "verre dépoli sur fond marine" et les pastilles dégradées bleues.

   Cette page reste publique et indexable (option B validée) : la
   connexion n'est demandée qu'à l'ouverture d'un formulaire précis, pas
   ici. La bannière .creer-banner reflète cet état sans jamais bloquer
   la page elle-même.
   ==================================================================================================================================== */

:root {
    --paper: #faf7f2;
    --paper-surface: #ffffff;
    --paper-line: #e8e2d8;
    --paper-line-soft: #f1ede5;
    --paper-ink-line: #cfc7b8;
    --paper-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 24px -10px rgba(15, 23, 42, .18);
    --ink-soft: #55606f;
}

body {
    background: var(--paper);
}

.section-eyebrow {
    display: block;
    font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   En-tête
-------------------------------------------------------------------------- */
/* .main-content (base.css) centre ses enfants avec align-items:center, ce
   qui les laisse en shrink-to-fit tant qu'aucune largeur explicite n'est
   posée. Sans "width:100%" ici, la grille de cartes plus bas (auto-fill)
   perd sa taille de conteneur définie et retombe sur une seule colonne. */
.creer-hero, .creer-docs {
    width: 100%;
}

.creer-hero {
    padding: 4.5rem 2rem 2.5rem;
}

.creer-header-content {
    display: flex;
    justify-content: center;
    text-align: center;
}

.creer-header-text {
    max-width: 720px;
    width: 100%;
    text-align: center;
}

.creer-hero .creer-title {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    line-height: 1.15;
}

.creer-hero .creer-subtitle {
    max-width: 560px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--ink-soft);
}

/* Barre de recherche */
.creer-search-wrapper {
    position: relative;
    max-width: 480px;
    margin: 1.8rem auto 0;
}

.creer-search-input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--paper-line);
    background: var(--paper-surface);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.creer-search-input::placeholder {
    color: var(--paper-ink-line);
}

.creer-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

@media (max-width: 768px) {
    .creer-hero { padding: 2.5rem 1.25rem 1.75rem; }
    .creer-hero .creer-title { font-size: 1.8rem; }
    .creer-hero .creer-subtitle { font-size: 0.98rem; }
}

/* --------------------------------------------------------------------------
   Navigation par catégories - pastilles sobres (filet + fond papier),
   plus de dégradé ni d'effet de brillance au survol.
-------------------------------------------------------------------------- */
.creer-cat-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.8rem auto 0;
}

.creer-cat-pill {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink-soft);
    background: var(--paper-surface);
    border: 1px solid var(--paper-line);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .creer-cat-pill:hover {
        background: #f0f9ff;
        border-color: var(--primary);
        color: var(--primary);
    }
}

.creer-cat-pill.active {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: var(--paper-line-soft);
}

@media (max-width: 768px) {
    .creer-cat-nav { margin-top: 1.3rem; gap: 0.5rem; }
    .creer-cat-pill { padding: 0.5rem 1rem; font-size: 0.85rem; }
}

/* --------------------------------------------------------------------------
   Bannière d'état de connexion
-------------------------------------------------------------------------- */
.creer-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto 1.75rem;
    padding: 0.9rem 1.15rem;
    border-radius: 12px;
    background: #fef3e2;
    border: 1px solid #f3d9a8;
    color: #7c4a03;
    font-size: 0.97rem;
    line-height: 1.5;
    max-width: 1200px;
}

.creer-banner svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #b45309;
}

.creer-banner a {
    color: #b45309;
    font-weight: 700;
    text-decoration: none;
}

.creer-banner a:hover {
    text-decoration: underline;
}

.creer-banner-account {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #075985;
}

.creer-banner-account svg {
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   Conteneur principal
-------------------------------------------------------------------------- */
.creer-docs {
    padding: 0 2rem 5rem;
}

.creer-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.creer-no-results {
    display: none;
    text-align: center;
    color: var(--ink-soft);
    font-size: 1rem;
    padding: 2rem 0;
}

/* --------------------------------------------------------------------------
   Catégories
-------------------------------------------------------------------------- */
.creer-category {
    margin-bottom: 4rem;
    scroll-margin-top: 120px;
    padding-top: 2.5rem;
    border-top: 1px solid var(--paper-line);
}

.creer-category:first-child {
    border-top: none;
    padding-top: 0;
}

.creer-category-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.creer-category-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--paper-line);
    background: var(--paper-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.creer-category-icon i {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.creer-category-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Grille des cartes
-------------------------------------------------------------------------- */
.creer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

/* --------------------------------------------------------------------------
   Cartes
-------------------------------------------------------------------------- */
.creer-card {
    background: var(--paper-surface);
    border: 1px solid var(--paper-line);
    border-radius: 14px;
    padding: 1.35rem;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

/* Survol scopé à (hover: hover) : sur tactile, un :hover simple resterait
   "collé" après un tap au lieu de disparaître - pas d'effet sur mobile. */
@media (hover: hover) and (pointer: fine) {
    .creer-card:hover {
        transform: translateY(-2px);
        border-color: var(--primary);
        box-shadow: var(--paper-shadow);
    }

    .creer-card:hover .card-arrow {
        transform: translateX(3px);
    }
}

/* Icônes */
.card-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--paper-line);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.9rem;
    color: var(--text-primary);
}

.card-icon svg {
    width: 20px;
    height: 20px;
}

/* Titre */
.card-title {
    font-size: 1.06rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem 0;
}

/* Description */
.card-desc {
    font-size: 0.94rem;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 0 0 1.1rem 0;
    flex-grow: 1;
}

/* Pied de carte : compteur + flèche */
.card-footer {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: auto;
}

.card-count {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--paper-ink-line);
}

.card-arrow {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: transform 0.15s ease;
}

.card-arrow i {
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Badge "Populaire"
-------------------------------------------------------------------------- */
.card-badge-popular {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    padding: 0.22rem 0.6rem;
    border-radius: 5px;
    background: #e0f2fe;
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   RESPONSIVE
-------------------------------------------------------------------------- */
@media (max-width: 1024px) and (min-width: 769px) {
    .creer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .creer-docs {
        padding: 0 1rem 3rem;
    }
    .creer-grid {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
    }
    .creer-card {
        padding: 0.7rem 0.9rem;
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 0.8rem;
    }
    .card-icon {
        width: 38px;
        height: 38px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .card-icon svg {
        width: 18px;
        height: 18px;
    }
    .card-title {
        font-size: 0.96rem;
        flex: 1;
        margin: 0;
    }
    .card-desc,
    .card-badge-popular {
        display: none;
    }
    .card-footer {
        width: auto;
        gap: 0.5rem;
    }
    .card-count {
        white-space: nowrap;
        flex-shrink: 0;
    }
    .creer-category-title {
        font-size: 1.25rem;
    }
    .creer-category-icon {
        width: 38px;
        height: 38px;
    }
    .creer-category-icon i {
        font-size: 1rem;
    }
    .creer-banner {
        font-size: 0.9rem;
        align-items: flex-start;
    }
}
