/* LexAberta app shell styles (todo 23 scaffold).
   WCAG 2.2 AA basics: semantic layout, skip link, visible focus,
   AA-contrast status colors, reduced-motion support.

   Identidade única verde/tinta (plano v2, todo 23): mesmos tokens da
   landing (frontend/landing/styles.css) e do contrato de temas da suíte
   (tests/uiux/fixtures/themes.css). Cor é reservada a STATUS; faixas de
   confiança (fita/selo) usam a família neutra de cinzas. */

:root {
    --tinta: #1b2a33;
    --tinta-suave: #4a5560;
    --verde: #14532d;
    --verde-escuro: #0e3d20;
    --verde-tinta: #14532d;
    --fundo: #ffffff;
    --fundo-suave: #f4f6f4;
    --fio: #d8ded8;
    --fio-forte: #5b6770;
    --foco: #14532d;

    /* Status (conectado/ok, aviso/alerta): uso exclusivo de cor semântica. */
    --status-ok-fundo: #dcfce7;
    --status-ok-texto: #14532d;
    --status-ok-borda: #166534;
    --status-aviso-fundo: #fef3c7;
    --status-aviso-texto: #78350f;
    --status-aviso-borda: #b45309;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--fundo);
    color: var(--tinta);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    background: var(--tinta);
    color: #ffffff;
    padding: 0.5rem 1rem;
    z-index: 100;
}

.skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: var(--tinta);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
}

.app-header .brand {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

/* Anel de foco consistente (todo 30): mesma geometria 3px + offset 2px do
   :focus-visible global (token --foco), com a cor trocada para branco sobre
   o cabeçalho escuro do host de autenticação (/authentication) — o verde do
   token não contrasta com o fundo tinta. */
.app-header :focus-visible {
    outline-color: #ffffff;
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 60rem;
    margin: 0 auto;
    padding: 1.5rem;
}

.app-main:focus {
    outline: none;
}

.tagline {
    color: var(--tinta-suave);
    font-size: 1.1rem;
}

.app-footer {
    background: var(--tinta);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
}

.app-footer p {
    margin: 0;
    font-size: 0.9rem;
}

a {
    color: var(--verde-tinta);
}

:focus-visible {
    outline: 3px solid var(--foco);
    outline-offset: 2px;
}

#blazor-error-ui {
    background: #ffffff;
    border-top: 4px solid #b91c1c;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(27, 42, 51, 0.25);
    color: var(--tinta);
    display: none;
    left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    right: 0;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: 1rem;
    text-decoration: underline;
}

.loading-progress {
    display: block;
    height: 8rem;
    margin: 12rem auto 1rem;
    position: relative;
    width: 8rem;
}

    .loading-progress circle {
        fill: none;
        stroke: var(--fio);
        stroke-width: 0.3rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--tinta);
            stroke-dasharray: calc(var(--last-progress-factor, 1) * 100.5%) 100.5%;
        }

.loading-progress-text {
    color: var(--tinta-suave);
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ------------------------------------------------------------
   Editor colaborativo (todo 25): conteúdo TipTap v3.
   Este bloco é global porque o DOM do editor é criado pelo
   editorInterop.js e não recebe o atributo de escopo do Blazor
   (mesmo raciocínio dos estilos do shell acima).
   ------------------------------------------------------------ */

.lx-editor {
    min-height: 20rem;
    outline: none;
    padding: 0.5rem 0.25rem;
    line-height: 1.65;
}

.lx-editor:focus-visible {
    outline: 3px solid var(--foco, #14532d);
    outline-offset: 2px;
}

.lx-editor > article {
    max-width: 46rem;
    margin: 0 auto;
}

.lx-sec {
    border-top: 1px solid var(--fio, #d8ded8);
    padding: 0.4rem 0 0.8rem;
    margin: 0.8rem 0 0;
}

.lx-sec:first-child {
    border-top: none;
}

.lx-sec-titulo {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--tinta, #1b2a33);
}

.lx-item {
    padding: 0.15rem 0 0.15rem 0.75rem;
    margin: 0.2rem 0;
    border-left: 3px solid var(--fio, #d8ded8);
}

.lx-tag::before {
    content: attr(data-rotulo);
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tinta-suave, #4a5560);
    margin-right: 0.5rem;
}

.lx-citacao {
    background: #fef9c3;
    padding: 0 0.15rem;
    border-radius: 3px;
}

.lx-citacao-ok {
    background: #dcfce7;
}

/* Sugestões IA (track-changes sugerido): formas distintas, nunca só cor. */
.lx-sug-insercao {
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: #15803d;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    background: #f0fdf4;
    border-radius: 2px;
    padding: 0 0.1rem;
}

.lx-sug-remocao {
    text-decoration: line-through;
    text-decoration-color: #b91c1c;
    text-decoration-thickness: 2px;
    background: #fef2f2;
    border-radius: 2px;
    padding: 0 0.1rem;
}

/* Cursor/caret de colaboração (y-prosemirror): contraste garantido. */
.collaboration-carets__caret {
    border-left: 2px solid var(--tinta);
    border-right: 2px solid var(--tinta);
    margin: 0 -2px;
    pointer-events: none;
    position: relative;
    word-break: normal;
}

.collaboration-carets__label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #ffffff;
    padding: 0.05rem 0.35rem;
    border-radius: 4px 4px 4px 0;
    position: absolute;
    top: -1.15em;
    left: -2px;
    user-select: none;
    white-space: nowrap;
}

