/* =========================================================================
   INFSS Scolarité — Pages publiques
   Vérification d'un document, résultats publiés et état des services.
   Ces pages sont consultées hors de l'application, souvent sur mobile et
   parfois en connexion dégradée : mise en page sobre, contrastée, sans
   dépendance à la coquille applicative.
   ========================================================================= */

.pub {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* ------------------------------------------------------------- En-tête */
.pub-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 18px 30px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.pub-brand img { display: block; height: 44px; width: auto; }

.pub-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pub-nav-link {
    padding: 9px 14px;
    border-radius: var(--r-full);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--body);
    white-space: nowrap;
}
.pub-nav-link:hover { background: var(--surface-2); color: var(--brand-600); text-decoration: none; }
.pub-nav-link.is-active { background: var(--brand-50); color: var(--brand-700); }

/* ------------------------------------------------------------ Contenu */
.pub-main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 940px;
    margin: 0 auto;
    padding: 38px 22px 56px;
}
.pub-main.is-narrow { max-width: 620px; }

.pub-head { margin-bottom: 24px; }
.pub-head h1 { font: 800 27px/1.22 var(--font-title); color: var(--ink); margin: 0 0 10px; }
.pub-head p { font-size: 14.5px; color: var(--body); margin: 0; max-width: 62ch; line-height: 1.6; }

/* --------------------------------------------------- Verdict de vérification */
.pub-verdict {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 24px 26px;
    border-radius: var(--r-xl);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--sh-sm);
    margin-bottom: 22px;
}
.pub-verdict-icon {
    width: 54px; height: 54px; flex: 0 0 auto;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-2);
    color: var(--muted);
}
.pub-verdict h2 { font: 800 19px/1.3 var(--font-title); margin: 0 0 6px; color: var(--ink); }
.pub-verdict p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--body); }
.pub-verdict .pub-verdict-code {
    display: inline-block;
    margin-top: 12px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .12em;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 6px 12px;
}

.pub-verdict.is-ok { border-color: #a9d9bb; background: #f4fbf6; }
.pub-verdict.is-ok .pub-verdict-icon { background: #dff2e6; color: var(--green-700); }
.pub-verdict.is-revoked { border-color: #f0b4b4; background: #fff7f7; }
.pub-verdict.is-revoked .pub-verdict-icon { background: #fbe3e3; color: var(--red-700); }
.pub-verdict.is-unknown { border-color: #efd0a1; background: #fdf9f2; }
.pub-verdict.is-unknown .pub-verdict-icon { background: #fbeed6; color: var(--amber-700); }

/* Fiche du document vérifié ------------------------------------------- */
.pub-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.pub-fact { background: var(--surface); padding: 15px 18px; }
.pub-fact dt {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 5px;
}
.pub-fact dd { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--ink); word-break: break-word; }

/* ------------------------------------------------------- Liste de résultats */
.pub-list { display: grid; gap: 12px; }
.pub-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.pub-item:hover { border-color: var(--brand-300); box-shadow: var(--sh-sm); text-decoration: none; }
.pub-item-body { flex: 1 1 auto; min-width: 0; }
.pub-item-title { font: 700 15.5px/1.35 var(--font-title); color: var(--ink); margin: 0 0 4px; }
.pub-item-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pub-item .ic { color: var(--muted-2); flex: 0 0 auto; }

/* ------------------------------------------------------------- Services */
.pub-service {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line-2);
}
.pub-service:last-child { border-bottom: 0; }
.pub-service-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; background: var(--muted-2); }
.pub-service-name { flex: 1 1 auto; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.pub-service-msg { font-size: 12.5px; color: var(--muted); }

.s-operationnel { background: var(--green); }
.s-degrade { background: var(--orange); }
.s-indisponible { background: var(--red); }
.s-maintenance { background: var(--brand-400); }

/* ---------------------------------------------------------------- Pied */
.pub-foot {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 20px 30px;
    font-size: 12.5px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.pub-foot a { color: var(--muted); }
.pub-foot a:hover { color: var(--brand-450); }

@media (max-width: 640px) {
    .pub-top { padding: 14px 18px; }
    .pub-brand img { height: 36px; }
    .pub-main { padding: 26px 16px 44px; }
    .pub-head h1 { font-size: 22px; }
    .pub-verdict { padding: 18px; gap: 14px; flex-direction: column; }
}

@media print {
    .pub-top, .pub-nav, .pub-foot { display: none !important; }
    .pub-main { max-width: none; padding: 0; }
    .pub-verdict, .pub-facts { break-inside: avoid; box-shadow: none; }
}
