/* Reset mínimo + base global. Tudo via tokens — zero hex hardcoded. */

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

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--wf-font);
    font-size: 14px;
    line-height: 22px;
    color: var(--wf-text);
    background: var(--wf-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, p {
    margin: 0;
}

/* FocusOnNavigate foca o H1 da página após cada navegação (acessibilidade).
   Removemos o outline visual — o foco programático não deve aparecer como caixa preta.
   Usuários de teclado ainda veem o anel em elementos interativos. */
h1:focus,
h1:focus-visible,
h1[tabindex]:focus,
h1[tabindex]:focus-visible {
    outline: none;
}

a {
    color: var(--wf-brand-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

code, kbd, pre, samp {
    font-family: var(--wf-font-mono);
}

.wf-page-placeholder {
    padding: var(--wf-space-8);
    color: var(--wf-text-muted);
    font-size: 14px;
}

#blazor-error-ui {
    background: var(--wf-warning-bg);
    color: var(--wf-warning);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 10px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 13px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 8px;
}

/* Theme toggle — label alternada via CSS baseado em [data-theme] */
.wf-theme-toggle {
    height: 36px;
    padding: 0 14px;
    background: var(--wf-surface);
    color: var(--wf-text);
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius-md);
    font-family: var(--wf-font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 120ms ease-out;
    letter-spacing: -0.1px;
    box-shadow: var(--wf-shadow-sm);
}

.wf-theme-toggle:hover { background: var(--wf-hover); }
.wf-theme-toggle__claro,
.wf-theme-toggle__escuro { display: inline-flex; align-items: center; gap: 8px; }
.wf-theme-toggle__claro { display: none; }
[data-theme="dark"] .wf-theme-toggle__claro { display: inline-flex; }
[data-theme="dark"] .wf-theme-toggle__escuro { display: none; }

/* Login Variant B */
.wf-login {
    height: 100vh;
    background: radial-gradient(ellipse at 50% 30%,
        var(--wf-brand-navy-light) 0%,
        var(--wf-brand-navy) 40%,
        var(--wf-brand-navy-deep) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.wf-login-bg-dots {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='28' height='28' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='0.9' fill='%23ffffff' fill-opacity='0.07'/%3E%3C/svg%3E");
    background-size: 28px 28px;
    pointer-events: none;
}

.wf-login-bg-rings {
    position: absolute;
    opacity: 0.1;
    width: 900px;
    height: 900px;
    pointer-events: none;
}

.wf-login-card {
    position: relative;
    width: 420px;
    padding: 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wf-login-mark { display: flex; justify-content: center; margin-bottom: 12px; }
.wf-login-wordmark { display: flex; justify-content: center; margin-bottom: 8px; }

.wf-login-subtitle {
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.wf-login-error {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: #fecaca;
    padding: 10px 12px;
    border-radius: var(--wf-radius-md);
    font-size: 12px;
}

.wf-login-field { display: flex; flex-direction: column; }
.wf-login-label-row { display: flex; justify-content: space-between; margin-bottom: 6px; }

.wf-login-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.wf-login-forgot { font-size: 11px; color: var(--wf-brand-accent); text-decoration: none; }

.wf-login-input {
    height: 42px;
    padding: 0 12px;
    /* Transparente: deixa o card (rgba(255,255,255,0.03) sobre navy-light) aparecer.
       Evita empilhamento de opacidades que cria um tom visivelmente diferente. */
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--wf-radius-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
    /* color-scheme: dark faz o browser aplicar defaults de dark mode (inclusive
       no autofill), evitando fundo claro sobreposto quando o Edge/Chrome detecta
       que o form tem credenciais salvas. */
    color-scheme: dark;
}

.wf-login-input:focus-within {
    border-color: rgba(77, 163, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.15);
}

.wf-login-input input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-family: var(--wf-font);
    color-scheme: dark;
}

.wf-login-input input::placeholder { color: rgba(255, 255, 255, 0.3); }

/* Neutraliza o fundo amarelo/azul do autofill do Chrome/Edge.
   A inset box-shadow gigante sobre-escreve o background nativo do autofill.
   Cor escolhida = aproximação de "navy-light + 3% white overlay" (mesma visual
   do card) para o input ficar totalmente homogêneo com o resto quando preenchido. */
.wf-login-input input:-webkit-autofill,
.wf-login-input input:-webkit-autofill:hover,
.wf-login-input input:-webkit-autofill:focus,
.wf-login-input input:-webkit-autofill:active {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #213D63 inset;
    caret-color: #fff;
    transition: background-color 9999s ease-in-out 0s;
    font-family: var(--wf-font);
}

.wf-login-submit {
    height: 44px;
    margin-top: 8px;
    background: var(--wf-brand-accent);
    color: #fff;
    border: none;
    border-radius: var(--wf-radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--wf-font);
    letter-spacing: -0.1px;
    box-shadow: 0 8px 24px rgba(77, 163, 255, 0.33),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: background 120ms ease-out, transform 80ms ease-out;
}

.wf-login-submit:hover { background: var(--wf-brand-accent-deep); }
.wf-login-submit:active { transform: translateY(1px); }

/* ========================================================
   RichTextEditor — contenteditable + toolbar simples
   ======================================================== */
.wf-rte {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius-md);
    background: var(--wf-surface);
    overflow: hidden;
    min-height: 200px;
}
.wf-rte:focus-within {
    border-color: var(--wf-brand-accent);
    box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.15);
}

.wf-rte-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--wf-border);
    background: var(--wf-surface-alt);
    flex-wrap: wrap;
}

.wf-rte-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
    font-family: var(--wf-font);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--wf-radius-sm);
    color: var(--wf-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 100ms, border-color 100ms;
}
.wf-rte-btn:hover { background: var(--wf-bg-sunken); border-color: var(--wf-border); }
.wf-rte-btn:active { background: var(--wf-selected); }

.wf-rte-sep {
    width: 1px;
    height: 20px;
    background: var(--wf-border);
    margin: 0 4px;
}

.wf-rte-editor {
    flex: 1;
    min-height: 160px;
    padding: 12px 14px;
    font-size: 13px;
    font-family: var(--wf-font);
    color: var(--wf-text);
    outline: none;
    overflow-y: auto;
    line-height: 1.5;
}

.wf-rte-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--wf-text-subtle);
    pointer-events: none;
}

.wf-rte-editor img { max-width: 100%; height: auto; }
.wf-rte-editor a { color: var(--wf-brand-accent); }
.wf-rte-editor ul, .wf-rte-editor ol { padding-left: 24px; margin: 6px 0; }
.wf-rte-editor p { margin: 4px 0; }
