/*
 * Identidade NOVA FCT — tipografia Futura + ajustes finos.
 * Ficheiro estático (sem build). Registado por FilamentServiceProvider.
 * Cor da marca (#0065BD / Pantone 300C) e logótipos são definidos no painel.
 */

@font-face {
    font-family: 'Futura';
    src: url('/fonts/futura/futura-light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

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

@font-face {
    font-family: 'Futura';
    src: url('/fonts/futura/futura-medium-italic.woff2') format('woff2');
    font-weight: 400 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Futura';
    src: url('/fonts/futura/futura-bold.woff2') format('woff2');
    font-weight: 600 800;
    font-style: normal;
    font-display: swap;
}

/*
 * Corpo e dados: sans-serif do sistema (legível em tabelas densas e formulários).
 * Identidade (Futura): marca, títulos, navegação, botões e valores em destaque.
 */
:root {
    --font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.fi-topbar,
.fi-sidebar-header,
.fi-sidebar-nav,
.fi-header-heading,
.fi-page-header-heading,
.fi-section-header-heading,
.fi-ta-header-heading,
.fi-modal-heading,
.fi-breadcrumbs,
.fi-btn-label,
.fi-wi-stats-overview-stat-value,
.fi-wi-stats-overview-stat-label {
    font-family: 'Futura', ui-sans-serif, system-ui, sans-serif;
    letter-spacing: 0.01em;
}

/* O logótipo na barra lateral com respiro */
.fi-sidebar-header .fi-logo {
    padding-block: 0.25rem;
}

/* Ecrã de login: usa o logótipo vertical, maior e centrado */
.fi-simple-header img.fi-logo {
    height: 6.5rem !important;
    width: auto;
    margin-inline: auto;
    margin-block-end: 0.5rem;
}

.fi-simple-header img.fi-logo-light {
    content: url('/img/nova-fct-vertical.svg');
}

.fi-simple-header img.fi-logo-dark {
    content: url('/img/nova-fct-vertical-dark.svg');
}

/* ---------------------------------------------------------------------------
 * Editor dos templates de email — App\Filament\Forms\Components\CampoTemplate
 * Paleta de marcadores + realce (textarea transparente sobre camada colorida).
 * ------------------------------------------------------------------------- */
[x-cloak] { display: none !important; }

.ct-barra {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.ct-paleta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    flex: 1;
}

.ct-toggle {
    flex: none;
    font-family: "Jost", ui-sans-serif, system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border: 1px solid #cdd9e4;
    border-radius: 0.375rem;
    background: #f6f9fc;
    color: #0059a8;
    cursor: pointer;
    white-space: nowrap;
}
.ct-toggle:hover { background: #eef3f8; }
.dark .ct-toggle { background: #1b2733; border-color: #33434f; color: #82bcec; }
.dark .ct-toggle:hover { background: #22303d; }

.ct-preview {
    white-space: pre-wrap;
    overflow-wrap: break-word;
    font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    padding: 0.6rem 0.75rem;
    border: 1px dashed #cdd9e4;
    border-radius: 0.5rem;
    background: #f6f9fc;
    color: #17222e;
    min-height: 4rem;
}
.dark .ct-preview { border-color: #33434f; background: #10171f; color: #e4e4e7; }
.ct-preview.ct-linha-unica { min-height: 0; white-space: pre; overflow-x: auto; }

.ct-chip {
    font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 0.15rem 0.45rem;
    border: 1px solid;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: filter 0.1s ease;
}
.ct-chip:hover { filter: brightness(0.97); }
.dark .ct-chip:hover { filter: brightness(1.15); }

/* famílias: id (omissão) · data · contacto · texto */
.ct-id,       .ct-m           { background: #e8effb; color: #1f4f9c; border-color: #c3d5f2; }
.ct-data,     .ct-m.ct-data     { background: #fbefda; color: #8a5a12; border-color: #eed6ab; }
.ct-contacto, .ct-m.ct-contacto { background: #e4f1e7; color: #256b39; border-color: #bfddc6; }
.ct-texto,    .ct-m.ct-texto    { background: #ececf1; color: #4c4f63; border-color: #d5d5de; }

.dark .ct-id,       .dark .ct-m           { background: rgba(59, 130, 246, 0.18); color: #9cbcea; border-color: rgba(59, 130, 246, 0.38); }
.dark .ct-data,     .dark .ct-m.ct-data     { background: rgba(217, 160, 80, 0.18); color: #e0ad6a; border-color: rgba(217, 160, 80, 0.38); }
.dark .ct-contacto, .dark .ct-m.ct-contacto { background: rgba(74, 201, 126, 0.16); color: #79c890; border-color: rgba(74, 201, 126, 0.38); }
.dark .ct-texto,    .dark .ct-m.ct-texto    { background: rgba(160, 170, 190, 0.16); color: #c2c6d2; border-color: rgba(160, 170, 190, 0.32); }

/* Legenda "Substituições possíveis" — pastilhas coloridas + descrição */
.ct-legenda {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.4rem 1.2rem;
}
.ct-legenda-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.ct-legenda .ct-chip { cursor: default; }
.ct-legenda-desc { color: #5e7180; font-size: 0.85rem; }
.dark .ct-legenda-desc { color: #94a7b6; }

.ct-campo {
    position: relative;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    overflow: hidden;
}
.dark .ct-campo { background: #27272a; border-color: #3f3f46; }
.ct-campo:focus-within { border-color: #0065bd; box-shadow: 0 0 0 1px #0065bd; }
.dark .ct-campo:focus-within { border-color: #5aa4e0; box-shadow: 0 0 0 1px #5aa4e0; }

.ct-backdrop,
.ct-textarea {
    margin: 0;
    padding: 0.5rem 0.625rem;
    font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    letter-spacing: 0;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.ct-textarea {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: #111827;
    caret-color: #111827;
    resize: vertical;
}
.dark .ct-textarea { color: #e4e4e7; caret-color: #f4f4f5; }
.ct-textarea:focus { outline: 0; box-shadow: none; }

/* Só se esconde o texto do textarea depois de a camada de realce estar montada
 * — assim, se algo falhar, vê-se o texto normal em vez de nada. */
.ct-pronto .ct-textarea { color: transparent; }
.dark .ct-pronto .ct-textarea { color: transparent; }

.ct-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    color: #111827;
}
.dark .ct-backdrop { color: #e4e4e7; }

.ct-linha-unica .ct-textarea { resize: none; white-space: pre; overflow-x: auto; }
.ct-linha-unica .ct-backdrop { white-space: pre; }

.ct-m {
    border-radius: 0.25rem;
    padding: 0.05em 0.15em;
    box-shadow: inset 0 0 0 1px currentColor;
}
