/*
 * RMA — Registo Municipal do Associativismo · tema da área das associações
 *
 * Cores do Município de Ourém: vermelho do escudo e cinza-carvão do logótipo.
 * Tipo: Public Sans (desenhada para serviços públicos; boa leitura em formulários longos).
 * Estrutura: fundo cinza, blocos brancos bem destacados (cada grupo de perguntas é um
 * bloco com cabeçalho próprio); o vermelho fica para a ação principal e para "onde estou".
 */
:root {
    --rma-red: #c9222a;
    --rma-red-dark: #a51b22;
    --rma-red-tint: #fcebea;
    --rma-red-soft: #f6d3d1;
    --rma-ink: #2f2f2d;
    --rma-ink-soft: #4d4d49;
    --rma-muted: #686863;
    --rma-line: #e1e2df;
    --rma-line-strong: #cfd1cd;
    --rma-page: #eef0ee;
    --rma-surface: #ffffff;
    --rma-field: #fbfbfa;
    --rma-ok: #23774a;
    --rma-ok-tint: #e3f3e9;
    --rma-warn: #95590a;
    --rma-warn-tint: #fdf1dc;
    --rma-info: #255d8a;
    --rma-info-tint: #e5eff8;
    --rma-radius: 12px;
    --rma-radius-lg: 18px;
    --rma-radius-sm: 8px;
    --rma-shadow: 0 1px 2px rgba(30, 30, 28, .06), 0 6px 24px -8px rgba(30, 30, 28, .14);
    --rma-shadow-hover: 0 2px 4px rgba(30, 30, 28, .08), 0 14px 32px -10px rgba(30, 30, 28, .22);
    --rma-font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    --bs-body-font-family: var(--rma-font);
    --bs-body-color: var(--rma-ink);
    /* --bs-body-bg fica branco: é o fundo de modais, menus e cartões do Bootstrap. O fundo cinza é só do body. */
    --bs-link-color: var(--rma-red-dark);
    --bs-link-color-rgb: 165, 27, 34;
    --bs-link-hover-color: var(--rma-red);
    --bs-link-hover-color-rgb: 201, 34, 42;
    --bs-border-color: var(--rma-line);
    --bs-border-radius: var(--rma-radius-sm);
    --bs-focus-ring-color: rgba(201, 34, 42, .25);
}

html { font-size: 16px; }
body.rma {
    font-family: var(--rma-font);
    font-size: 0.97rem;
    line-height: 1.55;
    color: var(--rma-ink);
    background: var(--rma-page);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}
body.rma h1, body.rma h2, body.rma h3, body.rma h4, body.rma h5 {
    font-weight: 700;
    color: var(--rma-ink);
    letter-spacing: -0.015em;
    line-height: 1.2;
    text-wrap: balance;
}
body.rma h1 { font-size: clamp(1.6rem, 2.4vw, 2.05rem); }
body.rma h2 { font-size: 1.3rem; }
body.rma h3 { font-size: 1.12rem; }
body.rma h4 { font-size: 1.02rem; }
body.rma h5 { font-size: .95rem; }
body.rma a { text-underline-offset: 3px; }
body.rma :focus-visible { outline: 3px solid rgba(201, 34, 42, .45); outline-offset: 2px; }
.rma-muted { color: var(--rma-muted); }
.rma-num { font-variant-numeric: tabular-nums; }

/* ---------- Cabeçalho ---------- */
.rma-header {
    background: var(--rma-surface);
    border-bottom: 4px solid var(--rma-red);
    box-shadow: 0 2px 12px -6px rgba(30, 30, 28, .2);
    position: relative;
    z-index: 10;
}
.rma-header .container { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; padding-block: .7rem; }
.rma-brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: var(--rma-ink); }
.rma-brand img { height: 48px; width: auto; display: block; }
.rma-brand .sep { width: 1px; height: 36px; background: var(--rma-line-strong); }
.rma-brand .name { font-weight: 650; font-size: .98rem; line-height: 1.2; max-width: 15rem; }
.rma-nav { margin-left: auto; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.rma-nav > a, .rma-nav > .dropdown { white-space: nowrap; }
.rma-nav a, .rma-nav button.rma-navlink {
    color: var(--rma-ink); text-decoration: none; font-weight: 550;
    padding: .55rem .9rem; border-radius: 999px; border: 0; background: none; font-size: .95rem;
    transition: background-color .15s, color .15s;
}
.rma-nav a:hover, .rma-nav button.rma-navlink:hover { background: var(--rma-page); color: var(--rma-ink); }
.rma-nav a.active { color: var(--rma-red-dark); background: var(--rma-red-tint); }
.rma-nav a.btn { padding: .5rem 1.1rem; }
.rma-nav .dropdown-menu { border: 1px solid var(--rma-line); border-radius: var(--rma-radius); box-shadow: var(--rma-shadow-hover); padding: .4rem; min-width: 16rem; }
.rma-nav .dropdown-item { border-radius: var(--rma-radius-sm); padding: .55rem .8rem; }
.rma-nav .dropdown-item:active { background: var(--rma-red); }
.rma-account { display: flex; align-items: center; gap: .5rem; }
.rma-account .initials {
    width: 32px; height: 32px; border-radius: 50%; background: var(--rma-red); color: #fff;
    display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700;
}
.rma-account .who { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Área principal ---------- */
.rma-main { padding-block: 1.75rem 4rem; min-height: 60vh; }
.rma-main .breadcrumb {
    background: none; padding: 0; margin-bottom: 1.1rem; font-size: .85rem;
    --bs-breadcrumb-divider-color: var(--rma-muted);
}
.rma-main .breadcrumb a { color: var(--rma-muted); text-decoration: none; }
.rma-main .breadcrumb a:hover { color: var(--rma-red-dark); text-decoration: underline; }
.rma-page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.rma-page-title h1 { margin: 0; }
.rma-page-title p { margin: .4rem 0 0; color: var(--rma-muted); max-width: 64ch; font-size: 1rem; }

/* Blocos: a unidade visual de cada grupo de informação */
.rma-panel, .rma-block, .rma-fieldset {
    background: var(--rma-surface);
    border: 1px solid var(--rma-line);
    border-radius: var(--rma-radius-lg);
    box-shadow: var(--rma-shadow);
}
.rma-panel { padding: 1.5rem 1.6rem; }
.rma-panel + .rma-panel { margin-top: 1.1rem; }
.rma-panel > h2, .rma-panel > h3 { margin-top: 0; }

.rma-block { margin-bottom: 1.4rem; overflow: hidden; }
.rma-block-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: 1.15rem 1.6rem; border-bottom: 1px solid var(--rma-line);
    background: linear-gradient(90deg, var(--rma-red) 0 5px, #fafaf9 5px);
}
.rma-block-head h2 { margin: 0; font-size: 1.18rem; }
.rma-block-head p { margin: .2rem 0 0; color: var(--rma-muted); font-size: .92rem; max-width: 70ch; }
.rma-block-body { padding: 1.4rem 1.6rem .4rem; }
.rma-block-body--flush { padding: 0; }
.rma-block-body--flush .grid-view, .rma-block-body--flush .table-responsive { border: 0; border-radius: 0; box-shadow: none; margin: 0; }
.rma-block-body--flush .grid-view .empty { padding: 1.25rem 1.6rem; color: var(--rma-muted); }
.rma-sub { font-size: 1.02rem; margin: 1.5rem 0 .75rem; padding-top: 1rem; border-top: 1px dashed var(--rma-line-strong); }
.rma-block-body > .rma-sub:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.rma-sub-sm { font-size: .9rem; margin: 1.1rem 0 .5rem; color: var(--rma-ink-soft); }
.rma-count { font-size: .82rem; font-weight: 600; padding: .3rem .75rem; border-radius: 999px; background: var(--rma-warn-tint); color: var(--rma-warn); white-space: nowrap; }
.rma-count.completo { background: var(--rma-ok-tint); color: var(--rma-ok); }

/* Navegação dentro de uma página longa */
.rma-subnav { display: flex; gap: .5rem; flex-wrap: wrap; margin: -0.5rem 0 1.25rem; position: sticky; top: .5rem; z-index: 5; }
.rma-subnav a { background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: 999px; padding: .4rem 1rem; font-weight: 600; font-size: .88rem; color: var(--rma-ink); text-decoration: none; box-shadow: var(--rma-shadow); }
.rma-subnav a:hover { border-color: var(--rma-red); color: var(--rma-red-dark); }

/* Lista rótulo / valor (consulta) */
.rma-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .9rem 1.5rem; margin: 0 0 1rem; }
.rma-dl > div { min-width: 0; }
.rma-dl dt { font-size: .8rem; font-weight: 600; color: var(--rma-muted); margin-bottom: .15rem; }
.rma-dl dd { margin: 0; overflow-wrap: anywhere; }
.rma-item { border: 1px solid var(--rma-line); border-radius: var(--rma-radius); padding: .25rem 1.1rem; margin-bottom: .75rem; background: #fcfcfb; }
.rma-item[open] { padding-bottom: 1rem; background: var(--rma-surface); }
.rma-item > summary { cursor: pointer; font-weight: 700; padding: .65rem 0; list-style-position: outside; }
.rma-item > summary .rma-muted { font-weight: 500; }
.rma-table-wrap { border: 1px solid var(--rma-line); border-radius: var(--rma-radius-sm); margin-bottom: .5rem; }
.rma-doc-link { white-space: nowrap; font-weight: 600; }

/* ---------- Rodapé ---------- */
.rma-footer { background: var(--rma-ink); color: #d9d9d4; font-size: .9rem; }
.rma-footer .container { padding-block: 2.5rem 1.5rem; }
.rma-footer a { color: #fff; }
body.rma .rma-footer h2 { color: #fff; font-size: .98rem; font-weight: 650; margin-bottom: .6rem; }
.rma-footer .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.75rem; }
.rma-footer .base { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 1.75rem; padding-top: 1.1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.rma-footer .social { display: flex; gap: .9rem; font-size: 1.15rem; }

/* ---------- Botões: um só sistema para todas as classes usadas nos views ---------- */
body.rma .btn {
    --bs-btn-padding-x: 1.15rem; --bs-btn-padding-y: .62rem; --bs-btn-font-size: .95rem; --bs-btn-font-weight: 650;
    --bs-btn-border-radius: 10px; --bs-btn-border-width: 1.5px;
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    letter-spacing: .005em; line-height: 1.2;
    transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
body.rma .btn:active { transform: translateY(1px); }
body.rma .btn-sm { --bs-btn-padding-x: .8rem; --bs-btn-padding-y: .38rem; --bs-btn-font-size: .85rem; --bs-btn-border-radius: 8px; }
body.rma .btn-lg { --bs-btn-padding-x: 1.5rem; --bs-btn-padding-y: .85rem; --bs-btn-font-size: 1.05rem; }
/* Ação principal: btn-danger é usado em todo o RMA para "seguinte", "guardar", "submeter" */
body.rma .btn-danger, body.rma .btn-primary {
    --bs-btn-color: #fff; --bs-btn-bg: var(--rma-red); --bs-btn-border-color: var(--rma-red);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--rma-red-dark); --bs-btn-hover-border-color: var(--rma-red-dark);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #8f161c; --bs-btn-active-border-color: #8f161c;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--rma-red); --bs-btn-disabled-border-color: var(--rma-red);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 8px 18px -10px rgba(201, 34, 42, .8);
}
body.rma .btn-danger:hover, body.rma .btn-primary:hover { box-shadow: 0 2px 0 rgba(0, 0, 0, .04), 0 12px 22px -10px rgba(201, 34, 42, .85); }
/* Ação de confirmação/positiva */
body.rma .btn-success {
    --bs-btn-color: #fff; --bs-btn-bg: var(--rma-ok); --bs-btn-border-color: var(--rma-ok);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1b5f3a; --bs-btn-hover-border-color: #1b5f3a;
    --bs-btn-active-bg: #164e30; --bs-btn-active-border-color: #164e30;
}
/* Ações secundárias: contorno */
body.rma .btn-secondary, body.rma .btn-default, body.rma .btn-light, body.rma .btn-info, body.rma .btn-outline-secondary {
    --bs-btn-color: var(--rma-ink); --bs-btn-bg: var(--rma-surface); --bs-btn-border-color: var(--rma-line-strong);
    --bs-btn-hover-color: var(--rma-ink); --bs-btn-hover-bg: var(--rma-surface); --bs-btn-hover-border-color: var(--rma-ink);
    --bs-btn-active-color: var(--rma-ink); --bs-btn-active-bg: #f1f1ef; --bs-btn-active-border-color: var(--rma-ink);
    --bs-btn-disabled-color: var(--rma-muted); --bs-btn-disabled-bg: var(--rma-surface); --bs-btn-disabled-border-color: var(--rma-line);
}
/* Ações de adicionar dentro de listas */
body.rma .btn-dark {
    --bs-btn-color: #fff; --bs-btn-bg: var(--rma-ink); --bs-btn-border-color: var(--rma-ink);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #111; --bs-btn-hover-border-color: #111;
}
body.rma .btn-warning {
    --bs-btn-color: #3d2604; --bs-btn-bg: #f2c46b; --bs-btn-border-color: #f2c46b;
    --bs-btn-hover-color: #3d2604; --bs-btn-hover-bg: #eab14a; --bs-btn-hover-border-color: #eab14a;
}
body.rma .btn-outline-danger {
    --bs-btn-color: var(--rma-red-dark); --bs-btn-border-color: var(--rma-red);
    --bs-btn-hover-bg: var(--rma-red); --bs-btn-hover-border-color: var(--rma-red); --bs-btn-hover-color: #fff;
}
body.rma .btn-group > .btn { box-shadow: none; }
/* Botões de "Adicionar" colocados antes das tabelas (muitos com float:left inline) */
body.rma .btn[style*="float: left"], body.rma .btn[style*="float:left"] { margin-bottom: .9rem; }
body.rma .grid-view, body.rma form .grid-view { clear: both; }

/* ---------- Formulários ---------- */
body.rma .form-label, body.rma .control-label, body.rma .form-group > label, body.rma .field-group > label,
body.rma .mb-3 > label:not(.form-check-label) {
    font-weight: 650; font-size: .9rem; color: var(--rma-ink); margin-bottom: .4rem;
}
body.rma .form-control, body.rma .form-select {
    border: 1.5px solid #d7d9d6; border-radius: 10px; padding: .7rem .9rem; font-size: .97rem;
    background-color: var(--rma-field); min-height: 46px;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
body.rma .form-control:hover, body.rma .form-select:hover { border-color: #babdb8; }
body.rma .form-control:focus, body.rma .form-select:focus {
    border-color: var(--rma-red); background-color: #fff; box-shadow: 0 0 0 4px rgba(201, 34, 42, .12);
}
body.rma textarea.form-control { min-height: 110px; line-height: 1.55; }
body.rma .form-control[readonly], body.rma .form-control:disabled { background: #f0f1ef; color: var(--rma-ink-soft); }
body.rma input[type="file"].form-control { padding: .55rem .7rem; }
body.rma input[type="file"].form-control::file-selector-button {
    border: 0; border-radius: 8px; background: var(--rma-ink); color: #fff; font-weight: 600;
    padding: .35rem .85rem; margin: -.1rem .9rem -.1rem 0;
}
body.rma .form-check-input { width: 1.15em; height: 1.15em; border: 1.5px solid #b9bcb7; }
body.rma .form-check-input:checked { background-color: var(--rma-red); border-color: var(--rma-red); }
body.rma .form-check-input:focus { box-shadow: 0 0 0 4px rgba(201, 34, 42, .12); border-color: var(--rma-red); }
/* Sim/Não como botões de escolha */
body.rma .rma-radio-row { display: flex; gap: .6rem; flex-wrap: wrap; }
body.rma .rma-radio-row > label, body.rma .rma-radio-row .form-check {
    display: inline-flex; align-items: center; gap: .5rem; margin: 0; padding: .55rem 1rem .55rem .8rem;
    border: 1.5px solid #d7d9d6; border-radius: 10px; background: var(--rma-field); font-weight: 600; cursor: pointer;
}
body.rma .rma-radio-row > label:has(input:checked), body.rma .rma-radio-row .form-check:has(input:checked) { border-color: var(--rma-red); background: var(--rma-red-tint); color: var(--rma-red-dark); }
body.rma .rma-radio-row input[type=radio] { accent-color: var(--rma-red); margin: 0; }
body.rma .rma-radio-row .form-check-input { float: none; margin: 0; }
/* campos obrigatórios: asterisco igual em todos os formulários */
body.rma .required > label:not(.form-check-label)::after,
body.rma .required > .form-label::after,
body.rma .required .control-label::after { content: " *"; color: var(--rma-red); font-weight: 700; }
body.rma .invalid-feedback, body.rma .help-block, body.rma .help-block-error { color: var(--rma-red-dark); font-size: .86rem; font-weight: 500; }
body.rma .has-error .form-control, body.rma .is-invalid { border-color: var(--rma-red) !important; background-color: #fffafa; }
body.rma .hint-block, body.rma .form-text { color: var(--rma-muted); font-size: .86rem; margin-top: .3rem; }
body.rma .error-summary { color: var(--rma-red-dark); background: var(--rma-red-tint); border-left: 4px solid var(--rma-red); padding: .85rem 1.1rem; margin-bottom: 1rem; border-radius: 0 10px 10px 0; }
body.rma form .mb-3, body.rma form .form-group { margin-bottom: 1.15rem; }

.rma-fieldset { padding: 1.4rem 1.6rem .5rem; margin-bottom: 1.25rem; }
.rma-fieldset > legend, .rma-fieldset > h2 {
    /*float: none; */ width: auto; font-size: 1.15rem; font-weight: 700; margin: 0 0 .3rem;
    padding-left: .8rem; border-left: 5px solid var(--rma-red); line-height: 1.25;
}
.rma-fieldset > .lead-in { color: var(--rma-muted); margin: 0 0 1.1rem; max-width: 70ch; }
.rma-qa { padding: 1rem 0 .25rem; border-top: 1px solid var(--rma-line); }
.rma-qa:first-child { border-top: 0; padding-top: 0; }

/* Barra de ações no fim dos formulários; ação principal à direita */
.rma-actions {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    padding-top: 1.25rem; margin-top: 1.5rem; border-top: 1px solid var(--rma-line-strong);
}
.rma-actions .end { display: flex; gap: .6rem; margin-left: auto; flex-wrap: wrap; }
/* Barra fixa de gravação em formulários longos */
.rma-savebar {
    position: sticky; bottom: 0; z-index: 20; margin: 1.5rem 0 0;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
    border: 1px solid var(--rma-line); border-radius: var(--rma-radius-lg); box-shadow: 0 -6px 24px -10px rgba(30, 30, 28, .25);
    padding: .8rem 1.1rem calc(.8rem + env(safe-area-inset-bottom, 0px));
}
.rma-savebar .end { display: flex; gap: .6rem; flex-wrap: wrap; }
.rma-savestate { font-size: .9rem; color: var(--rma-muted); display: inline-flex; align-items: center; gap: .45rem; }
.rma-savestate::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--rma-ok); }
.rma-savestate.erro { color: var(--rma-red-dark); }
.rma-savestate.erro::before { background: var(--rma-red); }

/* Ficheiros entregues */
.rma-file { display: flex; align-items: center; gap: .65rem; padding: .65rem .9rem; border: 1px solid var(--rma-line); border-radius: 10px; background: #f7f8f6; margin-bottom: .6rem; font-size: .93rem; }
.rma-file i { color: var(--rma-red); font-size: 1.1rem; }
.rma-file a { font-weight: 600; }
.rma-file .state { margin-left: auto; font-size: .8rem; color: var(--rma-muted); white-space: nowrap; }
.rma-file.missing { background: var(--rma-warn-tint); border-color: #efd5a8; }
.rma-file.missing i { color: var(--rma-warn); }

/* Áreas da candidatura: cartões grandes de entrada */
.rma-areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; padding: 1.4rem 1.6rem; }
.rma-area {
    display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border-radius: var(--rma-radius);
    border: 1.5px solid var(--rma-line); background: #fff; text-decoration: none; color: var(--rma-ink);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rma-area:hover { border-color: var(--rma-red); box-shadow: var(--rma-shadow-hover); transform: translateY(-2px); color: var(--rma-ink); }
.rma-area .ico { flex: none; width: 3rem; height: 3rem; border-radius: 14px; display: grid; place-items: center; background: var(--rma-red-tint); color: var(--rma-red); font-size: 1.35rem; }
.rma-area strong { display: block; font-size: 1.1rem; font-weight: 750; color: var(--rma-ink); margin-bottom: .2rem; }
.rma-area > span > span { display: block; color: var(--rma-muted); font-size: .9rem; line-height: 1.45; }
.rma-area .go { margin-left: auto; align-self: center; color: var(--rma-red); font-size: 1.2rem; }

/* ---------- Assistente de dados (sequência de 9 passos) ---------- */
.rma-steps {
    list-style: none; margin: 0 0 1.5rem; padding: 1.1rem .5rem .9rem; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); counter-reset: passo;
    background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: var(--rma-radius-lg); box-shadow: var(--rma-shadow);
}
.rma-steps li { position: relative; text-align: center; font-size: .78rem; color: var(--rma-muted); padding-top: 2.6rem; line-height: 1.25; counter-increment: passo; }
.rma-steps li::before {
    content: counter(passo); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 2.15rem; height: 2.15rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--rma-surface); border: 2px solid var(--rma-line-strong); color: var(--rma-muted); font-weight: 700; font-size: .88rem; z-index: 1;
}
.rma-steps li::after { content: ""; position: absolute; top: 1.05rem; left: -50%; width: 100%; height: 2px; background: var(--rma-line-strong); z-index: 0; }
.rma-steps li:first-child::after { display: none; }
.rma-steps li a { color: inherit; text-decoration: none; }
.rma-steps li.done { color: var(--rma-ink); }
.rma-steps li.done::before { content: "\2713"; background: var(--rma-ink); border-color: var(--rma-ink); color: #fff; }
.rma-steps li.done::after, .rma-steps li.current::after { background: var(--rma-ink); }
.rma-steps li.current { color: var(--rma-red-dark); font-weight: 700; }
.rma-steps li.current::before { background: var(--rma-red); border-color: var(--rma-red); color: #fff; box-shadow: 0 0 0 5px var(--rma-red-tint); }
.rma-steps-mobile { display: none; font-weight: 650; margin-bottom: .75rem; }
@media (max-width: 900px) {
    .rma-steps li { font-size: 0; padding-top: 2.2rem; }
    .rma-steps-mobile { display: block; }
}
.rma-wizard-intro { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1.25rem; }
.rma-wizard-intro h1 { margin: 0; }
.rma-wizard-intro p { margin: .35rem 0 0; color: var(--rma-muted); max-width: 65ch; }

/* ---------- Painel inicial da associação ---------- */
.rma-dashboard { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
@media (max-width: 992px) { .rma-dashboard { grid-template-columns: minmax(0, 1fr); } }
.rma-hello { margin-bottom: 1.4rem; }
.rma-hello h1 { margin: 0 0 .25rem; }
.rma-hello p { margin: 0; color: var(--rma-muted); }
.rma-journey { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.rma-journey li { position: relative; padding: 0 0 1.5rem 3rem; }
.rma-journey li:last-child { padding-bottom: 0; }
.rma-journey li::before { content: ""; position: absolute; left: .78rem; top: 1.9rem; bottom: .2rem; width: 2px; background: var(--rma-line-strong); }
.rma-journey li:last-child::before { display: none; }
.rma-journey .dot {
    position: absolute; left: 0; top: 0; width: 1.75rem; height: 1.75rem; border-radius: 50%;
    border: 2px solid var(--rma-line-strong); background: var(--rma-surface); display: grid; place-items: center; font-size: .78rem; color: #fff; font-weight: 700;
}
.rma-journey li.done .dot { background: var(--rma-ink); border-color: var(--rma-ink); }
.rma-journey li.done::before { background: var(--rma-ink); }
.rma-journey li.now .dot { background: var(--rma-red); border-color: var(--rma-red); box-shadow: 0 0 0 6px var(--rma-red-tint); }
.rma-journey li.blocked .dot { background: var(--rma-warn); border-color: var(--rma-warn); }
.rma-journey .t { font-weight: 700; line-height: 1.75rem; font-size: 1.02rem; }
.rma-journey .d { color: var(--rma-muted); font-size: .93rem; margin-top: .1rem; max-width: 60ch; }
.rma-journey .a { margin-top: .75rem; }

.rma-links { list-style: none; margin: 0; padding: 0; }
.rma-links li + li { border-top: 1px solid var(--rma-line); }
.rma-links a { display: flex; align-items: center; gap: .85rem; padding: .8rem 0; color: var(--rma-ink); text-decoration: none; }
.rma-links a:hover { color: var(--rma-red-dark); }
.rma-links a .bi, .rma-links a .fas { color: var(--rma-red); width: 1.2rem; text-align: center; font-size: 1.05rem; }
.rma-links a .ext { margin-left: auto; color: var(--rma-muted); font-size: .8rem; white-space: nowrap; }
.rma-links small { display: block; color: var(--rma-muted); font-size: .83rem; }

/* ---------- Estados ---------- */
.rma-status { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 650; white-space: nowrap; }
.rma-status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.rma-status.edicao { background: var(--rma-info-tint); color: var(--rma-info); }
.rma-status.analise { background: var(--rma-warn-tint); color: var(--rma-warn); }
.rma-status.correcao { background: var(--rma-red-tint); color: var(--rma-red-dark); }
.rma-status.concluida { background: var(--rma-ok-tint); color: var(--rma-ok); }
.rma-status.neutro { background: #ececea; color: var(--rma-ink-soft); }

/* ---------- Avisos ---------- */
body.rma .alert { border: 0; border-left: 5px solid; border-radius: 0 12px 12px 0; padding: .95rem 1.15rem; box-shadow: var(--rma-shadow); }
body.rma .alert-danger { background: var(--rma-red-tint); border-color: var(--rma-red); color: #6b1015; }
body.rma .alert-success { background: var(--rma-ok-tint); border-color: var(--rma-ok); color: #174a2d; }
body.rma .alert-info { background: var(--rma-info-tint); border-color: var(--rma-info); color: #1c3f5c; }
body.rma .alert-warning { background: var(--rma-warn-tint); border-color: var(--rma-warn); color: #5a3606; }

/* ---------- Tabelas e GridView ---------- */
body.rma .grid-view, body.rma .table-responsive { background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: var(--rma-radius); overflow-x: auto; box-shadow: var(--rma-shadow); }
body.rma .rma-table-wrap { box-shadow: none; }
body.rma .grid-view .summary { padding: .7rem 1.1rem; color: var(--rma-muted); font-size: .85rem; border-bottom: 1px solid var(--rma-line); }
body.rma .table { margin-bottom: 0; --bs-table-striped-bg: #f8f8f7; --bs-table-hover-bg: #faf6f6; }
body.rma .table th { font-size: .8rem; font-weight: 700; color: var(--rma-ink-soft); background: #f6f6f4; border-bottom: 1px solid var(--rma-line); white-space: nowrap; }
body.rma .table th a { color: inherit; text-decoration: none; }
body.rma .table td, body.rma .table th { padding: .8rem 1rem; vertical-align: middle; }
body.rma .table-bordered > :not(caption) > * > * { border-width: 0 0 1px; }
body.rma .grid-view .pagination { padding: .8rem 1.1rem; margin: 0; }
body.rma .page-link { color: var(--rma-ink); border-radius: 8px; margin: 0 .15rem; }
body.rma .page-item.active .page-link { background: var(--rma-red); border-color: var(--rma-red); color: #fff; }
body.rma a.asc::after { content: " \25B4"; } body.rma a.desc::after { content: " \25BE"; }
body.rma .not-set { color: var(--rma-muted); font-style: italic; }
body.rma .grid-view td a .fas, body.rma .grid-view td a .bi, body.rma .grid-view td a .fa {
    display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; color: var(--rma-ink-soft); transition: background-color .15s, color .15s;
}
body.rma .grid-view td a:hover .fas, body.rma .grid-view td a:hover .bi, body.rma .grid-view td a:hover .fa { background: var(--rma-red-tint); color: var(--rma-red); }
body.rma .detail-view th { width: 35%; }

/* ---------- Cartões e listas antigas ---------- */
body.rma .card { border-color: var(--rma-line); border-radius: var(--rma-radius); box-shadow: var(--rma-shadow); }
body.rma .card-header { background: var(--rma-surface) !important; color: var(--rma-ink) !important; border-color: var(--rma-line) !important; font-weight: 700; border-top: 4px solid var(--rma-red) !important; }
body.rma .nav-tabs { border-bottom: 2px solid var(--rma-line); gap: .25rem; }
body.rma .nav-tabs .nav-link { color: var(--rma-ink-soft); font-weight: 650; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; }
body.rma .nav-tabs .nav-link.active { color: var(--rma-red-dark); border-bottom-color: var(--rma-red); background: transparent; }
body.rma .list-group-item-action:hover { color: var(--rma-red-dark); }
body.rma .profile-link { color: var(--rma-red-dark) !important; font-weight: 650; }
body.rma hr { border-color: var(--rma-line-strong); opacity: 1; }

/* ---------- Compatibilidade Bootstrap 4 → 5 ---------- */
body.rma .badge { font-weight: 650; border-radius: 999px; padding: .35em .75em; }
body.rma .badge-info { background: var(--rma-info-tint); color: var(--rma-info); }
body.rma .badge-warning { background: var(--rma-warn-tint); color: var(--rma-warn); }
body.rma .badge-danger { background: var(--rma-red-tint); color: var(--rma-red-dark); }
body.rma .badge-success { background: var(--rma-ok-tint); color: var(--rma-ok); }
body.rma .badge-secondary, body.rma .badge-light { background: #ececea; color: var(--rma-ink-soft); }
body.rma .badge-primary { background: var(--rma-ink); color: #fff; }
body.rma .pull-right, body.rma .float-right { float: right; }
body.rma .pull-left, body.rma .float-left { float: left; }
body.rma .text-right { text-align: right; }
body.rma .text-left { text-align: left; }
body.rma .ml-auto { margin-left: auto; }
body.rma .input-group .form-group { margin-bottom: 0; }
body.rma #progressbar { display: none; }

/* ---------- Páginas públicas ---------- */
/* Faixa a toda a largura dentro do .container do layout */
.rma-bleed { margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); }
.rma-home { margin-top: -1.75rem; }
.rma-home-hero { background: var(--rma-surface); padding-block: clamp(2.5rem, 6vw, 5rem); border-bottom: 1px solid var(--rma-line); }
.rma-home-hero .grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 992px) { .rma-home-hero .grid { grid-template-columns: minmax(0, 1fr); } }
.rma-home-hero .kicker { color: var(--rma-red-dark); font-weight: 700; margin-bottom: 1rem; display: inline-flex; align-items: center; gap: .5rem; }
.rma-home-hero .kicker::before { content: ""; width: 2rem; height: 3px; background: var(--rma-red); border-radius: 2px; }
body.rma .rma-home-hero h1 { font-size: clamp(2.3rem, 4.8vw, 3.6rem); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 1.25rem; max-width: 14ch; }
.rma-home-hero .lede { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--rma-ink-soft); max-width: 52ch; line-height: 1.6; margin: 0; }
.rma-home-hero .cta { display: flex; gap: .85rem; flex-wrap: wrap; margin-top: 2rem; }
.rma-home-hero .cta .btn { --bs-btn-padding-x: 1.5rem; --bs-btn-padding-y: .9rem; --bs-btn-font-size: 1.02rem; }
.rma-home-hero figure { margin: 0; position: relative; }
.rma-home-hero figure img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 24px; display: block; box-shadow: 0 30px 60px -30px rgba(30, 30, 28, .45); }
.rma-home-hero figure::after { content: ""; position: absolute; inset: auto -14px -14px auto; width: 40%; height: 45%; border-radius: 24px; background: var(--rma-red); z-index: -1; }
.rma-home-section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.rma-home-section + .rma-home-section { border-top: 1px solid var(--rma-line); }
.rma-home-section > h2, .rma-home-section .head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 .5rem; }
.rma-home-section .head { margin-bottom: 2rem; max-width: 60ch; }
.rma-home-section .head p { color: var(--rma-muted); font-size: 1.05rem; margin: 0; }
.rma-howto { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; counter-reset: passo; }
.rma-howto li { counter-increment: passo; background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: var(--rma-radius-lg); padding: 1.6rem; box-shadow: var(--rma-shadow); }
.rma-howto li::before { content: counter(passo); display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--rma-red); color: #fff; font-weight: 800; font-size: 1.15rem; margin-bottom: 1rem; }
.rma-howto h3 { font-size: 1.12rem; margin: 0 0 .4rem; }
.rma-howto p { margin: 0; color: var(--rma-ink-soft); }
.rma-howto .when { display: inline-block; margin-top: .9rem; font-weight: 700; color: var(--rma-red-dark); font-variant-numeric: tabular-nums; }
.rma-home-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 992px) { .rma-home-split { grid-template-columns: minmax(0, 1fr); } }
.rma-home-split p { font-size: 1.05rem; color: var(--rma-ink-soft); max-width: 62ch; }

.rma-auth { max-width: 28rem; margin: 1.5rem auto 0; }
.rma-auth .rma-panel { padding: 2.1rem; border-top: 5px solid var(--rma-red); }
.rma-auth h1 { font-size: 1.55rem; margin: 0 0 .4rem; }
.rma-auth .sub { color: var(--rma-muted); margin: 0 0 1.5rem; }
.rma-auth .btn-danger { width: 100%; --bs-btn-padding-y: .8rem; }
.rma-auth .alt { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: 1.25rem; font-size: .92rem; }

@media (max-width: 576px) {
    .rma-block-head, .rma-block-body, .rma-panel, .rma-fieldset { padding-left: 1.1rem; padding-right: 1.1rem; }
    .rma-areas { padding: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
@media print {
    .rma-header, .rma-footer, .rma-actions, .rma-savebar, .rma-subnav, .breadcrumb { display: none !important; }
    body.rma { background: #fff; }
    .rma-block, .rma-panel { box-shadow: none; break-inside: avoid; }
    .rma-item { display: block; }
}

/* Bloco de entrada em destaque (áreas da candidatura) */
.rma-block--destaque { border: 1.5px solid var(--rma-red-soft); box-shadow: 0 1px 2px rgba(30, 30, 28, .06), 0 14px 34px -14px rgba(201, 34, 42, .35); }
.rma-block--destaque .rma-block-head { background: linear-gradient(90deg, var(--rma-red) 0 5px, var(--rma-red-tint) 5px); border-bottom-color: var(--rma-red-soft); }

/* Barras de "Adicionar" antigas (btn-group com float) passam a uma linha própria acima da tabela */
body.rma .btn-group[style*="float"] { float: none !important; display: flex; margin: .25rem 0 1rem; padding: 0 !important; }
body.rma .btn-group[style*="float"] > .btn { float: none !important; flex: none; margin: 0; border-radius: 10px !important; }
body.rma .btn-group[style*="float"] + br, body.rma .btn-group[style*="float"] ~ br { display: none; }

/* ---------- Modais (formulários de registo) ---------- */
body.rma .modal { --bs-modal-bg: #fff; --bs-modal-border-radius: 20px; }
body.rma .modal-backdrop { --bs-backdrop-bg: #1d1d1b; --bs-backdrop-opacity: .55; }
body.rma .modal-dialog.modal-lg { --bs-modal-width: 860px; }
body.rma .modal-content { border: 0; border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); overflow: clip; }
body.rma .modal-header, body.rma .our-modal-header {
    background: #fff; border: 0; border-bottom: 1px solid var(--rma-line); padding: 1.35rem 1.75rem 1.15rem;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; position: relative;
}
body.rma .modal-header::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--rma-red); }
body.rma .modal-title, body.rma .our-modal-title { color: var(--rma-ink); font-weight: 750; font-size: 1.3rem; margin: 0; line-height: 1.25; letter-spacing: -.015em; }
body.rma .modal-title center { display: inline; text-align: left; }
.rma-modal-kicker { display: block; color: var(--rma-red-dark); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2rem; }
body.rma .modal-header .btn-close, body.rma .modal-header .close {
    flex: none; width: 2.4rem; height: 2.4rem; margin: -.3rem -.5rem 0 auto; padding: 0; border: 0; border-radius: 50%;
    background: #f1f2f0 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232f2f2d'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / .8rem no-repeat;
    opacity: 1; font-size: 0; color: transparent; transition: background-color .15s;
}
body.rma .modal-header .btn-close:hover, body.rma .modal-header .close:hover { background-color: var(--rma-red-tint); }
body.rma .modal-header .close > * { display: none; }
body.rma .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
body.rma .modal-body { padding: 1.5rem 1.75rem .5rem; background: #fff; }
body.rma .modal-body > form > .alert:first-child, body.rma .modal-body > .alert:first-child { margin-top: 0; }
body.rma .modal-body hr { margin: 1.5rem 0; }
body.rma .modal-body center > p, body.rma .modal-body center b { display: block; text-align: left; font-size: 1rem; font-weight: 700; margin: .5rem 0 .75rem; }
body.rma .modal .alert { box-shadow: none; }
/* Rodapé fixo: as ações ficam sempre visíveis enquanto se percorre o formulário */
body.rma .modal-footer, body.rma .our-modal-footer {
    position: sticky; bottom: 0; z-index: 3; background: rgba(255, 255, 255, .97); backdrop-filter: blur(6px);
    border-top: 1px solid var(--rma-line); padding: .9rem 1.75rem; display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap;
    margin: 0;
}
body.rma .modal-body .our-modal-footer { margin: 1.25rem -1.75rem -.5rem; }
body.rma .our-modal-footer .form-group, body.rma .our-modal-footer .our-form-group { display: flex; gap: .6rem; justify-content: flex-end; margin: 0; flex-wrap: wrap; }
body.rma .modal-footer > * { margin: 0; }
/* Secções dentro do modal */
.rma-msec { padding: 0 0 1.25rem; margin: 0 0 1.4rem; border-bottom: 1px solid var(--rma-line); }
.rma-msec:last-of-type { border-bottom: 0; margin-bottom: .25rem; }
.rma-msec-title { display: flex; align-items: center; gap: .6rem; font-size: 1.02rem !important; font-weight: 750 !important; margin: 0 0 .9rem; }
.rma-msec-title::before { content: ""; width: 4px; height: 1.1rem; border-radius: 2px; background: var(--rma-red); }
.rma-msec-hint { color: var(--rma-muted); font-size: .9rem; margin: -.4rem 0 1rem; }
.rma-stepnum {
    display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; margin-right: .45rem;
    background: var(--rma-red-tint); color: var(--rma-red-dark); font-size: .75rem; font-weight: 800; vertical-align: 1px;
}
body.rma .modal .row > [class*="col-"] > .mb-3 > label, body.rma .modal .row > [class*="col-"] > .form-group > label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
/* Ficheiros: zona de largar */
body.rma .modal input[type="file"].form-control, body.rma .rma-form input[type="file"].form-control {
    border: 1.5px dashed #c4c7c2; background: #fafaf9; padding: .85rem; min-height: 64px; cursor: pointer;
}
body.rma .modal input[type="file"].form-control:hover, body.rma .rma-form input[type="file"].form-control:hover { border-color: var(--rma-red); background: var(--rma-red-tint); }
/* Horário semanal */
.rma-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.rma-week .rma-day { margin: 0 !important; }
.rma-week .rma-day > label { display: block; text-align: center; font-size: .78rem !important; font-weight: 700; color: var(--rma-muted) !important; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem !important; }
.rma-week .rma-day > label::after { content: none !important; }
body.rma .rma-week .form-control { text-align: center; padding: .55rem .3rem; font-size: .88rem; min-height: 42px; }
.rma-week .invalid-feedback, .rma-week .help-block { font-size: .72rem; }
@media (max-width: 640px) { .rma-week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 576px) {
    body.rma .modal-dialog { margin: .5rem; }
    body.rma .modal-header, body.rma .modal-body, body.rma .modal-footer { padding-left: 1.1rem; padding-right: 1.1rem; }
}
/* Alertas com botão de fechar (Bootstrap 4) */
body.rma .alert-dismissible .close { position: absolute; top: .6rem; right: .75rem; border: 0; background: none; font-size: 1.3rem; line-height: 1; opacity: .5; padding: .25rem .5rem; }

/* ---------- Verificação da candidatura ---------- */
.rma-verdict {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.25rem; align-items: center;
    padding: 1.5rem 1.75rem; border-radius: var(--rma-radius-lg); margin-bottom: 1.5rem; box-shadow: var(--rma-shadow); border: 1px solid;
}
.rma-verdict > i { font-size: 2.6rem; line-height: 1; }
.rma-verdict h2 { margin: 0 0 .25rem; font-size: 1.35rem; }
.rma-verdict p { margin: 0; max-width: 62ch; }
.rma-verdict--ok { background: var(--rma-ok-tint); border-color: #bfe2cc; }
.rma-verdict--ok > i, .rma-verdict--ok h2 { color: var(--rma-ok); }
.rma-verdict--erro { background: var(--rma-red-tint); border-color: var(--rma-red-soft); }
.rma-verdict--erro > i, .rma-verdict--erro h2 { color: var(--rma-red-dark); }
.rma-verdict-stats { display: flex; gap: 1.5rem; margin: 0; }
.rma-verdict-stats div { text-align: center; }
.rma-verdict-stats dt { font-size: .75rem; font-weight: 600; color: var(--rma-muted); }
.rma-verdict-stats dd { margin: 0; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 768px) { .rma-verdict { grid-template-columns: auto minmax(0, 1fr); } .rma-verdict-stats { grid-column: 1 / -1; justify-content: space-around; } }
.rma-block-ico { width: 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-items: center; background: var(--rma-red-tint); color: var(--rma-red); flex: none; }
.rma-checklist { list-style: none; margin: 0; padding: 0; }
.rma-checklist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1rem 1.6rem; }
.rma-checklist li + li { border-top: 1px solid var(--rma-line); }
.rma-checklist li > i { font-size: 1.3rem; }
.rma-checklist strong { display: block; }
.rma-checklist span { color: var(--rma-muted); font-size: .9rem; }
.rma-check--ok > i { color: var(--rma-ok); }
.rma-check--erro { background: #fff8f8; }
.rma-check--erro > i { color: var(--rma-red); }
.rma-check--erro span { color: var(--rma-red-dark); }
.rma-check--aviso > i { color: var(--rma-warn); }
.rma-check--neutro > i { color: var(--rma-muted); }

/* ---------- Lista pública de associações ---------- */
.rma-filterbar {
    display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto auto; gap: .75rem; align-items: center;
    background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: var(--rma-radius-lg); padding: .9rem; box-shadow: var(--rma-shadow); margin-bottom: 1.25rem;
}
.rma-filter-q { position: relative; }
.rma-filter-q i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--rma-muted); }
body.rma .rma-filter-q .form-control { padding-left: 2.6rem; }
.rma-filter-actions { display: flex; gap: .5rem; }
.rma-chips { display: flex; gap: .4rem; flex-wrap: wrap; border: 0; margin: 0; padding: 0; min-width: 0; }
.rma-chip input { position: absolute; opacity: 0; pointer-events: none; }
.rma-chip span { display: inline-block; padding: .55rem .9rem; border-radius: 999px; border: 1.5px solid var(--rma-line-strong); font-weight: 600; font-size: .88rem; cursor: pointer; background: #fff; user-select: none; }
.rma-chip input:checked + span { background: var(--rma-ink); border-color: var(--rma-ink); color: #fff; }
.rma-chip input:focus-visible + span { outline: 3px solid rgba(201, 34, 42, .45); outline-offset: 2px; }
@media (max-width: 992px) { .rma-filterbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .rma-filter-q { grid-column: 1 / -1; } }
@media (max-width: 576px) { .rma-filterbar { grid-template-columns: minmax(0, 1fr); } }
.rma-results-count { color: var(--rma-muted); margin: 0 0 1rem; }
.rma-results-count strong { color: var(--rma-ink); }
.rma-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; }
.rma-card { display: flex; gap: 1rem; background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: var(--rma-radius-lg); padding: 1.25rem; box-shadow: var(--rma-shadow); }
.rma-card-mono { flex: none; width: 3rem; height: 3rem; border-radius: 14px; display: grid; place-items: center; background: var(--rma-red-tint); color: var(--rma-red-dark); font-weight: 800; font-size: 1.25rem; }
.rma-card-body { min-width: 0; }
body.rma .rma-card h2 { font-size: 1.02rem; margin: .1rem 0 .4rem; line-height: 1.3; }
.rma-card-place { margin: 0 0 .15rem; font-size: .9rem; font-weight: 600; color: var(--rma-ink-soft); }
.rma-card-addr { margin: 0; font-size: .85rem; color: var(--rma-muted); }
.rma-tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .7rem; }
.rma-tag { font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: #ececea; color: var(--rma-ink-soft); }
.rma-tag--cultural { background: #f3e8fb; color: #6a2d91; }
.rma-tag--desportiva { background: var(--rma-info-tint); color: var(--rma-info); }
.rma-tag--recreativa { background: var(--rma-warn-tint); color: var(--rma-warn); }
.rma-pager { display: flex; justify-content: center; margin-top: 1.75rem; }
.rma-pager .pagination { margin: 0; flex-wrap: wrap; justify-content: center; }
.rma-count.erro { background: var(--rma-red-tint); color: var(--rma-red-dark); }
body.rma .form-select { padding-right: 2.4rem; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.rma-msec .row.g-3 { --bs-gutter-y: 0; }

/* ---- Associações: cartões com ficha pública ---- */
.rma-card--link { position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rma-card--link:hover { border-color: var(--rma-line-strong); box-shadow: var(--rma-shadow-hover); transform: translateY(-1px); }
.rma-card--link h2 a { color: var(--rma-ink); text-decoration: none; }
.rma-card--link:hover h2 a { color: var(--rma-red-dark); }
.rma-card--link .rma-card-body { flex: 1; position: relative; padding-right: 1.25rem; }
.rma-card-seta { position: absolute; right: 0; top: .15rem; color: var(--rma-muted); }
.rma-card--link:hover .rma-card-seta { color: var(--rma-red); }
.rma-tag--escutismo { background: var(--rma-ok-tint); color: var(--rma-ok); }
.rma-ficha-head { display: flex; gap: 1.1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.rma-ficha-head .rma-card-mono { width: 3.6rem; height: 3.6rem; font-size: 1.5rem; }
.rma-ficha-head h1 { margin: 0 0 .25rem; }
.rma-ficha-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.1rem; }
.rma-ficha-grid .rma-panel + .rma-panel { margin-top: 0; }
.rma-contactos { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.rma-contactos li { display: flex; gap: .8rem; align-items: flex-start; }
.rma-contactos li > i { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 10px; display: grid; place-items: center; background: var(--rma-red-tint); color: var(--rma-red-dark); font-size: 1rem; }
.rma-contactos li span { display: block; font-size: .78rem; font-weight: 600; color: var(--rma-muted); }
.rma-contactos li div { overflow-wrap: anywhere; }

/* ---- Transparência ---- */
.rma-anos { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.rma-anos a { padding: .45rem 1.1rem; border-radius: 999px; border: 1px solid var(--rma-line); background: var(--rma-surface); color: var(--rma-ink); font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.rma-anos a:hover { border-color: var(--rma-ink); color: var(--rma-ink); }
.rma-anos a.ativo { background: var(--rma-ink); border-color: var(--rma-ink); color: #fff; }
.rma-transp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .85rem; margin-bottom: 1.1rem; }
.rma-transp-kpi { background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: var(--rma-radius); padding: 1rem 1.2rem; box-shadow: var(--rma-shadow); }
.rma-transp-kpi span { display: block; font-size: .8rem; font-weight: 600; color: var(--rma-muted); }
.rma-transp-kpi strong { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rma-transp-kpi--total { border-top: 4px solid var(--rma-red); }
.rma-transp-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.rma-transp-head .rma-filter-q { min-width: min(100%, 20rem); }
.rma-transp-tabela .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rma-transp-tabela thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--rma-muted); }
.rma-transp-tabela tfoot th, .rma-transp-tabela tfoot td { border-top: 2px solid var(--rma-ink); font-weight: 700; }
.rma-transp-tabela td a { font-weight: 600; }

/* ---- Nova candidatura com base num ano anterior ---- */
.rma-base-opcoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; margin-bottom: .75rem; }
.rma-base-opcao { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border: 1.5px solid var(--rma-line); border-radius: var(--rma-radius); background: var(--rma-surface); cursor: pointer; margin: 0; transition: border-color .15s, background-color .15s; }
.rma-base-opcao:hover { border-color: var(--rma-line-strong); }
.rma-base-opcao input { margin-top: .25rem; accent-color: var(--rma-red); }
.rma-base-opcao span { display: flex; flex-direction: column; gap: .1rem; }
.rma-base-opcao small { color: var(--rma-muted); font-size: .82rem; }
.rma-base-opcao:has(input:checked) { border-color: var(--rma-red); background: var(--rma-red-tint); }
.rma-base-info { font-size: .9rem; color: var(--rma-ink-soft); }
.rma-base-info summary { cursor: pointer; font-weight: 600; color: var(--rma-red-dark); }
.rma-base-info ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.rma-base-info li + li { margin-top: .3rem; }

/* ---- Assinar e submeter a candidatura ---- */
.rma-assinar-ano { align-self: center; padding: .4rem .9rem; border-radius: 999px; background: var(--rma-red-tint); color: var(--rma-red-dark); font-weight: 700; font-size: .85rem; }
.rma-assinar-passos { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1rem; }
.rma-assinar-passo { display: grid; grid-template-columns: 3rem 1fr; gap: 1.1rem; background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: var(--rma-radius-lg); padding: 1.4rem 1.5rem; box-shadow: var(--rma-shadow); }
.rma-assinar-passo .num { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--rma-red); color: #fff; font-weight: 800; font-size: 1.1rem; }
body.rma .rma-assinar-passo h2 { font-size: 1.12rem; margin: .35rem 0 .35rem; }
.rma-assinar-passo p { color: var(--rma-ink-soft); margin-bottom: .8rem; }
.rma-assinar-passo .acoes { display: flex; gap: .5rem; flex-wrap: wrap; }
.rma-assinar-opcoes { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .6rem; }
.rma-assinar-opcoes li { display: flex; gap: .75rem; align-items: center; padding: .75rem .9rem; border: 1px solid var(--rma-line); border-radius: var(--rma-radius); background: var(--rma-field); }
.rma-assinar-opcoes li > i { font-size: 1.4rem; color: var(--rma-red); }
.rma-assinar-opcoes li span { display: flex; flex-direction: column; line-height: 1.3; }
.rma-assinar-opcoes small { color: var(--rma-muted); }
.rma-drop { position: relative; display: block; margin: .3rem 0 0; border: 2px dashed var(--rma-line-strong); border-radius: var(--rma-radius-lg); background: var(--rma-field); cursor: pointer; transition: border-color .15s, background-color .15s; }
.rma-drop:hover, .rma-drop.arrastar { border-color: var(--rma-red); background: var(--rma-red-tint); }
.rma-drop.tem { border-style: solid; border-color: var(--rma-ok); background: var(--rma-ok-tint); cursor: default; }
.rma-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rma-drop.tem .rma-drop-input { pointer-events: none; }
.rma-drop .vazio { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2.2rem 1rem; text-align: center; color: var(--rma-ink-soft); }
.rma-drop .vazio i { font-size: 2.4rem; color: var(--rma-red); line-height: 1; }
.rma-drop .vazio strong { font-size: 1.05rem; color: var(--rma-ink); }
.rma-drop .vazio span { font-size: .88rem; }
.rma-drop .escolhido { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.25rem; position: relative; z-index: 1; }
.rma-drop .escolhido > i { font-size: 2rem; color: var(--rma-red); }
.rma-drop .escolhido > span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.rma-drop .escolhido .nome { overflow-wrap: anywhere; }
.rma-drop .escolhido small { color: var(--rma-muted); }
.rma-drop-erro { margin-top: .5rem; color: var(--rma-red-dark); font-weight: 600; font-size: .9rem; }
@media (max-width: 575.98px) { .rma-assinar-passo { grid-template-columns: 1fr; padding: 1.1rem; } }

/* ---- Carregar elementos por ficheiro Excel (janela comum) ---- */
.rma-upx-modelo { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border: 1px solid var(--rma-line); border-radius: var(--rma-radius); background: var(--rma-field); margin-bottom: 1.1rem; flex-wrap: wrap; }
.rma-upx-modelo > i { font-size: 1.9rem; color: var(--rma-ok); line-height: 1; }
.rma-upx-modelo > div { flex: 1; min-width: 14rem; display: flex; flex-direction: column; gap: .2rem; }
.rma-upx-modelo > div span { color: var(--rma-ink-soft); font-size: .88rem; }
.rma-upx-modelo code { display: inline-block; margin: .15rem .25rem 0 0; padding: .05rem .4rem; border-radius: 4px; background: var(--rma-surface); border: 1px solid var(--rma-line); color: var(--rma-ink); font-size: .8rem; }
body.rma .rma-upx-tit { font-size: .95rem; font-weight: 700; margin: 0 0 .5rem; }
.rma-upx-regras { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .45rem; }
.rma-upx-regras li { display: flex; gap: .65rem; align-items: baseline; color: var(--rma-ink-soft); }
.rma-upx-regras li > i { color: var(--rma-red); }
.rma-upx-regras code { color: var(--rma-red-dark); }

/* ---- Eventos (Ourém Agenda) ---- */
.rma-ev-kicker { display: block; color: var(--rma-red-dark); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2rem; }
.rma-ev-estados { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.rma-ev-estados a { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--rma-line); background: var(--rma-surface); color: var(--rma-ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.rma-ev-estados a strong { min-width: 1.6rem; padding: .05rem .45rem; border-radius: 999px; background: var(--rma-field); text-align: center; font-variant-numeric: tabular-nums; }
.rma-ev-estados a:hover { border-color: var(--rma-line-strong); color: var(--rma-ink); }
.rma-ev-estados a.ativo { background: var(--rma-ink); border-color: var(--rma-ink); color: #fff; }
.rma-ev-estados a.ativo strong { background: rgba(255,255,255,.18); }
.rma-ev-filtros { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.25rem; }
.rma-ev-filtros .campo.procura { position: relative; flex: 1 1 18rem; max-width: 30rem; }
.rma-ev-filtros .campo.procura i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--rma-muted); pointer-events: none; }
.rma-ev-filtros .campo.procura input.form-control { padding-left: 2.4rem; }
.rma-ev-filtros .form-select { width: auto; min-width: 12rem; }
.rma-ev-grelha { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
a.rma-ev-cartao { display: flex; flex-direction: column; background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: var(--rma-radius-lg); overflow: hidden; color: var(--rma-ink); text-decoration: none; box-shadow: var(--rma-shadow); transition: transform .15s, box-shadow .15s; }
a.rma-ev-cartao:hover { transform: translateY(-2px); color: var(--rma-ink); box-shadow: 0 12px 28px -14px rgba(0,0,0,.28); }
.rma-ev-cartao.passado { opacity: .72; }
.rma-ev-cartao .capa { position: relative; aspect-ratio: 4 / 3; background: var(--rma-field); }
.rma-ev-cartao .capa img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rma-ev-cartao .sem-capa { display: grid; place-items: center; height: 100%; color: var(--rma-line-strong); font-size: 2.6rem; }
.rma-ev-cartao .capa .rma-ev-estado { position: absolute; left: .7rem; top: .7rem; }
.rma-ev-cartao .corpo { padding: .9rem 1rem 1.05rem; display: flex; flex-direction: column; gap: .35rem; }
.rma-ev-cartao .categoria { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--rma-red-dark); }
body.rma .rma-ev-cartao h2 { font-size: 1.05rem; line-height: 1.3; margin: 0; }
.rma-ev-cartao ul { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .2rem; color: var(--rma-ink-soft); font-size: .86rem; }
.rma-ev-cartao li { display: flex; gap: .45rem; align-items: baseline; }
.rma-ev-cartao li i { color: var(--rma-muted); }
.rma-ev-estado { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.rma-ev-estado.estatico { box-shadow: none; border: 1px solid currentColor; }
.rma-ev-estado.ok { color: var(--rma-ok); }
.rma-ev-estado.aviso { color: #95590a; }
.rma-ev-estado.erro { color: var(--rma-red-dark); }
.rma-ev-vazio { text-align: center; padding: 2.5rem 1rem; }
.rma-ev-vazio > i { font-size: 2.6rem; color: var(--rma-line-strong); }
body.rma .rma-ev-vazio h2 { font-size: 1.2rem; margin: .6rem 0 .3rem; }
.rma-ev-pager { margin-top: 1.25rem; }
.rma-ev-aviso { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--rma-radius); margin-bottom: 1rem; border: 1px solid; }
.rma-ev-aviso > i { font-size: 1.2rem; line-height: 1.2; }
.rma-ev-aviso.aviso { background: #fdf1dc; border-color: #efd5a8; color: #6d4207; }
.rma-ev-aviso.erro { background: var(--rma-red-tint); border-color: #f0c4c1; color: var(--rma-red-dark); }
.rma-ev-aviso.info { background: #e5eff8; border-color: #c6dbee; color: #1f4e74; }
.rma-ev-aviso.ok { background: var(--rma-ok-tint); border-color: #bfe0cc; color: var(--rma-ok); }
.rma-ev-ficha { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.25rem; align-items: start; }
@media (max-width: 991.98px) { .rma-ev-ficha { grid-template-columns: 1fr; } }
.rma-ev-ficha .principal, .rma-ev-ficha .lateral { display: grid; gap: 1.25rem; }
.rma-ev-ficha .rma-block { margin: 0; }
.rma-ev-dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .9rem 1.25rem; margin: 0 0 1.1rem; }
.rma-ev-dados dt { font-size: .76rem; font-weight: 700; color: var(--rma-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .15rem; }
.rma-ev-dados dt i { margin-right: .2rem; }
.rma-ev-dados dd { margin: 0; font-weight: 600; }
.rma-ev-chip { display: inline-block; margin: 0 .3rem .3rem 0; padding: .1rem .55rem; border-radius: 999px; background: var(--rma-field); border: 1px solid var(--rma-line); font-size: .82rem; font-weight: 600; }
body.rma .rma-ev-sub { font-size: .95rem; font-weight: 700; margin: 1rem 0 .35rem; }
.rma-ev-texto { color: var(--rma-ink-soft); line-height: 1.6; }
.rma-ev-mapa { height: 300px; border-radius: var(--rma-radius); border: 1px solid var(--rma-line); z-index: 0; }
.rma-ev-mapa--editar { height: 380px; cursor: crosshair; }
.rma-ev-mapa-barra { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.rma-ev-cartaz { width: 100%; border-radius: var(--rma-radius); border: 1px solid var(--rma-line); }
.rma-ev-registo { display: grid; gap: .55rem; }
.rma-ev-registo > div { display: flex; justify-content: space-between; font-size: .9rem; }
.rma-ev-registo span { color: var(--rma-muted); }
.rma-ev-opcoes { display: flex; flex-wrap: wrap; gap: .45rem; }
.rma-ev-opcao { position: relative; margin: 0; cursor: pointer; }
.rma-ev-opcao input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rma-ev-opcao span { display: inline-block; padding: .42rem .85rem; border-radius: 999px; border: 1px solid var(--rma-line-strong); background: var(--rma-field); font-weight: 600; font-size: .9rem; transition: background-color .12s, border-color .12s; }
.rma-ev-opcao input:checked + span { background: var(--rma-red); border-color: var(--rma-red); color: #fff; }
.rma-ev-opcao input:focus-visible + span { outline: 3px solid rgba(201, 34, 42, .3); outline-offset: 2px; }
.rma-ev-cartaz-campo { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; align-items: stretch; }
@media (max-width: 575.98px) { .rma-ev-cartaz-campo { grid-template-columns: 1fr; } }
.rma-ev-cartaz-previa { border-radius: var(--rma-radius); border: 1px solid var(--rma-line); background: var(--rma-field); overflow: hidden; min-height: 9rem; display: grid; place-items: center; }
.rma-ev-cartaz-previa img { width: 100%; height: 100%; object-fit: cover; }
.rma-ev-cartaz-previa span { display: flex; flex-direction: column; align-items: center; gap: .3rem; color: var(--rma-muted); font-size: .82rem; }
.rma-ev-cartaz-previa span i { font-size: 1.8rem; color: var(--rma-line-strong); }
.rma-ev-cartaz-campo .rma-drop { margin: 0; display: grid; place-items: center; }
.rma-ev-cartaz-campo .rma-drop.tem { cursor: pointer; }
.rma-ev-cartaz-campo .rma-drop.tem .rma-drop-input { pointer-events: auto; }
.rma-ev-cartao .capa { overflow: hidden; }
.rma-ev-cartao .capa img { position: absolute; inset: 0; height: 100% !important; }
.rma-ev-topo-acoes { display: flex; gap: .5rem; flex-wrap: wrap; align-self: center; }
.rma-ev-form .rma-block-head { justify-content: flex-start; gap: .85rem; text-align: left; }

/* ---- Gala do Desporto: proposta ---- */
.rma-gala-kicker { display: block; color: var(--rma-red-dark); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .15rem; }
.rma-gala-estado { align-self: center; padding: .35rem .85rem; border-radius: 999px; font-weight: 700; font-size: .85rem; border: 1px solid currentColor; }
.rma-gala-estado.edicao { color: #95590a; background: #fdf1dc; }
.rma-gala-estado.submetida { color: var(--rma-ok); background: var(--rma-ok-tint); }
.rma-gala-regras { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: .6rem; margin-bottom: 1.1rem; }
.rma-gala-regras > div { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: var(--rma-radius); background: #e5eff8; color: #1f4e74; font-size: .9rem; }
.rma-gala-regras i { font-size: 1.1rem; }
.rma-gala { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1.1rem; align-items: start; margin-bottom: 1rem; }
@media (max-width: 991.98px) { .rma-gala { grid-template-columns: 1fr; } }
.rma-gala-premios { gap: .35rem; position: sticky; top: 1rem; }
.rma-gala-premios .nav-link { display: grid; grid-template-columns: 2rem 1fr auto; gap: .55rem; align-items: center; text-align: left; padding: .6rem .7rem; border-radius: var(--rma-radius); background: var(--rma-surface); border: 1px solid var(--rma-line); color: var(--rma-ink); }
.rma-gala-premios .nav-link:hover { border-color: var(--rma-line-strong); }
.rma-gala-premios .nav-link.active { background: var(--rma-ink); border-color: var(--rma-ink); color: #fff; }
.rma-gala-premios .cod { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--rma-red); color: #fff; font-weight: 800; }
.rma-gala-premios .nome { font-weight: 600; font-size: .88rem; line-height: 1.25; }
.rma-gala-premios .conta { font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--rma-field); color: var(--rma-muted); font-variant-numeric: tabular-nums; }
.rma-gala-premios .conta.tem { background: var(--rma-ok-tint); color: var(--rma-ok); }
.rma-gala-premios .nav-link.active .conta { background: rgba(255,255,255,.18); color: #fff; }
.rma-gala-conteudo > .tab-pane { background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: var(--rma-radius-lg); box-shadow: var(--rma-shadow); padding: 1.3rem 1.4rem; }
.rma-gala-premio-topo { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
body.rma .rma-gala-premio-topo h2 { font-size: 1.3rem; margin: 0; }
.rma-gala-limites { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--rma-ink-soft); }
.rma-gala-descricao { padding: .8rem 1rem; border-radius: var(--rma-radius); background: var(--rma-field); color: var(--rma-ink-soft); font-size: .92rem; margin-bottom: 1rem; }
.rma-gala-descricao ul, .rma-gala-descricao ol { margin: .5rem 0 0; padding-left: 1.2rem; }
.rma-gala-descricao li { margin-bottom: .3rem; }
.rma-gala-descricao p:last-child { margin-bottom: 0; }
.rma-gala-lista { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.rma-gala-lista li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem .9rem; border: 1px solid var(--rma-line); border-radius: var(--rma-radius); }
.rma-gala-lista li.falta { border-color: #efd5a8; background: #fdf1dc; }
.rma-gala-lista .info { display: flex; flex-direction: column; min-width: 0; }
.rma-gala-lista .info small { color: var(--rma-muted); }
.rma-gala-lista .info small.aviso { color: #95590a; font-weight: 600; }
.rma-gala-lista .acoes { display: flex; gap: .4rem; flex: none; }
.rma-gala-cheio { color: var(--rma-ok); font-weight: 600; margin: 0; }
.rma-gala-consentimento { margin-top: .5rem; padding: .9rem 1rem; border-radius: var(--rma-radius); border: 1px solid #c6dbee; background: #f1f7fc; }
.rma-gala-consentimento > div > i { font-size: 1.3rem; color: #1f4e74; }
.rma-gala-ficheiro { margin-bottom: .9rem; }

/* ---- Gala (edições): início e formulário do candidato ---- */
.rma-gala-inicio { display: grid; gap: 1.25rem; }
.rma-gala-inicio-datas { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; }
.rma-gala-inicio-datas > div { padding: .8rem 1rem; border-radius: var(--rma-radius); background: var(--rma-field); }
.rma-gala-inicio-datas span { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rma-muted); }
.rma-gala-inicio-premios { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.rma-gala-inicio-premios li { display: flex; gap: .7rem; align-items: center; padding: .6rem .75rem; border: 1px solid var(--rma-line); border-radius: var(--rma-radius); }
.rma-gala-inicio-premios .cod, .rma-gala-avatar.vazio { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--rma-red); color: #fff; font-weight: 800; flex: none; }
.rma-gala-inicio-premios li > span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.rma-gala-inicio-premios small { color: var(--rma-muted); }
.rma-gala-lista li { justify-content: flex-start; }
.rma-gala-lista .info { flex: 1; }
.rma-gala-avatar { width: 2.6rem; height: 2.6rem; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--rma-line); }
.rma-gala-avatar.vazio { width: 2.6rem; height: 2.6rem; background: var(--rma-field); color: var(--rma-line-strong); font-size: 1.2rem; border: 1px solid var(--rma-line); }

.rma-gc .modal-body { padding: 0; background: var(--rma-field); }
.rma-gc-sec { padding: 1.25rem 1.5rem 1.4rem; background: var(--rma-surface); border-bottom: 1px solid var(--rma-line); }
.rma-gc-sec h5 { display: flex; align-items: center; gap: .6rem; font-size: 1rem; font-weight: 700; margin: 0 0 1rem; }
.rma-gc-sec h5 > span { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--rma-red); color: #fff; font-size: .85rem; }
.rma-gc-dica { margin: -.5rem 0 1rem; color: var(--rma-muted); font-size: .88rem; }
.rma-gc .form-label { font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.rma-gc-auto { resize: vertical; min-height: 4.2rem; line-height: 1.5; }
.rma-gc-conta { text-align: right; font-size: .75rem; color: var(--rma-muted); margin-top: .2rem; font-variant-numeric: tabular-nums; }
.rma-gc-erros { margin: 1rem 1.5rem 0; padding: .8rem 1rem; border-radius: var(--rma-radius); background: var(--rma-red-tint); border: 1px solid #f0c4c1; color: var(--rma-red-dark); font-size: .9rem; }
.rma-gc-erros ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.rma-gc-tipo { display: inline-flex; padding: .25rem; border-radius: 999px; background: var(--rma-field); border: 1px solid var(--rma-line); margin-bottom: 1rem; }
.rma-gc-tipo label { position: relative; margin: 0; cursor: pointer; }
.rma-gc-tipo input { position: absolute; opacity: 0; }
.rma-gc-tipo span { display: inline-block; padding: .4rem 1rem; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--rma-ink-soft); }
.rma-gc-tipo input:checked + span { background: var(--rma-surface); color: var(--rma-ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.rma-gc-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; }
.rma-gc-doc { position: relative; display: flex; flex-direction: column; gap: .3rem; margin: 0; padding: 1rem; min-height: 11rem; border: 2px dashed var(--rma-line-strong); border-radius: var(--rma-radius-lg); background: var(--rma-field); cursor: pointer; transition: border-color .15s, background-color .15s; overflow: hidden; }
.rma-gc-doc:hover, .rma-gc-doc.arrastar { border-color: var(--rma-red); background: var(--rma-red-tint); }
.rma-gc-doc.tem { border-style: solid; border-color: #9fd2b4; background: var(--rma-ok-tint); }
.rma-gc-doc.erro { border-color: var(--rma-red); background: var(--rma-red-tint); }
.rma-gc-doc-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rma-gc-doc .topo { display: flex; justify-content: space-between; align-items: center; }
.rma-gc-doc .topo > i { font-size: 1.6rem; color: var(--rma-red); }
.rma-gc-doc .estado { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--rma-muted); }
.rma-gc-doc.tem .estado { color: var(--rma-ok); }
.rma-gc-doc strong { font-size: .95rem; }
.rma-gc-doc small { color: var(--rma-muted); line-height: 1.35; }
.rma-gc-doc .ficheiro { margin-top: auto; font-size: .82rem; color: var(--rma-ink-soft); overflow-wrap: anywhere; position: relative; z-index: 1; pointer-events: none; }
.rma-gc-doc .ficheiro a { pointer-events: auto; }
.rma-gc-doc .modelo { position: relative; z-index: 1; font-size: .82rem; font-weight: 600; align-self: flex-start; }
.rma-gc-doc .msg-erro { color: var(--rma-red-dark); font-size: .8rem; font-weight: 600; }
.rma-gc-doc.com-foto::after { content: ""; position: absolute; right: .8rem; bottom: .8rem; width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--gc-foto) center / cover; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.rma-gc-rodape { background: var(--rma-surface); }
/* o <form> fica entre .modal-content e .modal-body: tem de passar o layout flex para o corpo deslizar */
.modal-dialog-scrollable .modal-content > form.rma-gc { display: flex; flex-direction: column; min-height: 0; max-height: 100%; overflow: hidden; }
.modal-dialog-scrollable .rma-gc > .modal-body { overflow-y: auto; }
.rma-gc-auto { min-height: 3.1rem; }

/* Gala: comissão de votação (júri) */
.rma-juri-entrar { max-width: 26rem; margin: 3rem auto; text-align: center; }
.rma-juri-entrar h1 { margin: .2rem 0 .4rem; }
.rma-juri-entrar form { text-align: left; margin-top: 1.25rem; }
.rma-juri-codigo { text-align: center; letter-spacing: .25em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.rma-juri-progresso { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; margin-bottom: 1.1rem; }
.rma-juri-progresso .progress { height: .5rem; }
.rma-juri-categorias { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.rma-juri-categorias a { display: grid; grid-template-columns: 2.2rem 1fr auto auto; gap: .85rem; align-items: center; padding: .7rem .9rem; border: 1px solid var(--rma-line); border-radius: var(--rma-radius); color: var(--rma-ink); text-decoration: none; transition: border-color .15s, background .15s; }
.rma-juri-categorias a:hover { border-color: var(--rma-red); background: var(--rma-red-tint); }
.rma-juri-categorias .cod { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--rma-red); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.rma-juri-categorias .nome small { display: block; color: var(--rma-muted); }
.rma-juri-categorias .n { color: var(--rma-muted); font-size: .85rem; }
.rma-juri-categorias .estado { font-size: .85rem; font-weight: 600; color: var(--rma-muted); white-space: nowrap; }
.rma-juri-categorias .feita .estado { color: var(--rma-ok); }
.rma-juri-cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.rma-juri-cand { display: flex; flex-direction: column; gap: .75rem; background: var(--rma-surface, #fff); border: 1px solid var(--rma-line); border-radius: var(--rma-radius-lg, 1rem); padding: 1rem; box-shadow: var(--rma-shadow); }
.rma-juri-cand .topo { display: flex; gap: .8rem; align-items: center; }
.rma-juri-cand .topo img, .rma-juri-cand .sem-foto { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; flex: none; background: var(--rma-field); display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--rma-muted); }
.rma-juri-cand h2 { font-size: 1.05rem; margin: 0; }
.rma-juri-cand .topo small { color: var(--rma-muted); }
.rma-juri-cand .resumo { font-size: .9rem; color: var(--rma-ink-soft); flex: 1; }
.rma-juri-cand details { font-size: .88rem; }
.rma-juri-cand summary { cursor: pointer; color: var(--rma-red-dark); font-weight: 600; }
.rma-juri-cand dt { margin-top: .5rem; font-weight: 600; color: var(--rma-muted); font-size: .8rem; }
.rma-juri-cand dd { margin: 0; }
.rma-juri-pontos { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--rma-line); padding-top: .75rem; margin: 0; }
.rma-juri-pontos legend { float: none; width: auto; font-size: .82rem; font-weight: 700; margin: 0 .4rem 0 0; color: var(--rma-muted); }
.rma-juri-pontos .btn { min-width: 2.6rem; font-weight: 800; }
@media (max-width: 575.98px) { .rma-juri-categorias a { grid-template-columns: 2.2rem 1fr; } .rma-juri-categorias .n, .rma-juri-categorias .estado { grid-column: 2; } }
.rma-pres-lista { display: grid; gap: .6rem; }
.rma-pres-linha { display: flex; gap: .75rem; align-items: flex-end; padding: .75rem; border: 1px solid var(--rma-line); border-radius: var(--rma-radius); }
.rma-pres-linha .num { width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--rma-field); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; margin-bottom: .35rem; flex: none; }
.rma-pres-linha .nif { width: 9.5rem; flex: none; }
.rma-pres-linha .form-label { margin-bottom: .15rem; }
@media (max-width: 575.98px) { .rma-pres-linha { flex-wrap: wrap; } .rma-pres-linha .nif { width: calc(100% - 4.5rem); } }
.rma-juri-pontos .btn-check:checked + .btn-outline-danger { background: var(--rma-red); border-color: var(--rma-red); color: #fff; }
.rma-juri-pontos .btn-check:checked + .btn-outline-secondary { background: var(--rma-field); color: var(--rma-ink); }

/* Protocolos de apoio (associação) */
.rma-prot-lista-fe { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.rma-prot-lista-fe a { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; border: 1px solid var(--rma-line); border-radius: var(--rma-radius); background: var(--rma-surface, #fff); color: var(--rma-ink); text-decoration: none; }
.rma-prot-lista-fe a:hover { border-color: var(--rma-red); }
.rma-prot-lista-fe .ic { font-size: 1.5rem; color: var(--rma-red); }
.rma-prot-lista-fe .txt { flex: 1; }
.rma-prot-lista-fe small { display: block; color: var(--rma-muted); }
.rma-prot-estado { font-size: .8rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px; background: var(--rma-field); white-space: nowrap; }
.rma-prot-estado.aviso { background: #fdf1dc; color: #6d4207; }
.rma-prot-estado.ok { background: var(--rma-ok-tint); color: var(--rma-ok); }
.rma-prot-estado.info { background: #e5eff8; color: #1f4e74; }
.rma-prot-fe { display: grid; grid-template-columns: 1fr minmax(18rem, 24rem); gap: 1.25rem; align-items: start; }
@media (max-width: 991.98px) { .rma-prot-fe { grid-template-columns: 1fr; } }
.rma-prot-fe > :only-child { grid-column: 1 / -1; }
.rma-prot-doc { padding: 0; overflow: hidden; }
.rma-prot-doc iframe { width: 100%; height: 78vh; border: 0; display: block; }
.rma-prot-sem-pdf { text-align: center; padding: 3rem 1rem; }
.rma-prot-sem-pdf > i { font-size: 3rem; color: var(--rma-muted); }
.rma-prot-resp { position: sticky; top: 1rem; }
.rma-prot-opcoes { display: grid; gap: .5rem; }
.rma-prot-opcoes .opcao { position: relative; cursor: pointer; }
.rma-prot-opcoes input { position: absolute; opacity: 0; }
.rma-prot-opcoes .opcao span { display: grid; grid-template-columns: auto 1fr; column-gap: .65rem; padding: .75rem .9rem; border: 1px solid var(--rma-line); border-radius: var(--rma-radius); }
.rma-prot-opcoes .opcao i { grid-row: span 2; font-size: 1.3rem; color: var(--rma-muted); align-self: center; }
.rma-prot-opcoes .opcao small { color: var(--rma-muted); }
.rma-prot-opcoes input:checked + span { border-color: var(--rma-red); background: var(--rma-red-tint); }
.rma-prot-opcoes input:checked + span i { color: var(--rma-red); }
.rma-prot-opcoes input:focus-visible + span { outline: 2px solid var(--rma-red); outline-offset: 2px; }

/* Páginas de alteração (grupo/equipa/valência): mesmo aspeto das janelas de criação */
.rma-badge { display: inline-block; font-weight: 650; font-size: .78rem; border-radius: 999px; padding: .3em .75em; background: var(--rma-info-tint); color: var(--rma-info); white-space: nowrap; }
.rma-badge--ok { background: var(--rma-ok-tint); color: var(--rma-ok); }
.rma-badge--aviso { background: var(--rma-warn-tint); color: var(--rma-warn); }
.rma-badge--erro { background: var(--rma-red-tint); color: var(--rma-red-dark); }
.rma-sub-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .85rem 1.6rem; border-top: 1px solid var(--rma-line); background: var(--rma-field); }
.rma-sub-head h3 { margin: 0; font-size: 1rem; font-weight: 750; }
.rma-sub-head h3 small { font-weight: 650; color: var(--rma-muted); background: var(--rma-surface); border: 1px solid var(--rma-line); border-radius: 999px; padding: .05rem .5rem; margin-left: .35rem; font-size: .78rem; }
.rma-doc-atual { display: flex; gap: .7rem; align-items: center; padding: .65rem .85rem; margin-bottom: .75rem; border: 1px solid var(--rma-line); border-radius: var(--rma-radius-sm); background: var(--rma-ok-tint); }
.rma-doc-atual > i { font-size: 1.3rem; color: var(--rma-ok); }
.rma-doc-atual strong { display: block; font-size: .88rem; }
.rma-doc-atual a { font-size: .88rem; font-weight: 650; }
.rma-actions--fixa { position: sticky; bottom: 0; z-index: 15; background: color-mix(in srgb, var(--rma-page) 92%, transparent); backdrop-filter: blur(6px); padding: .85rem 0; margin-top: .5rem; }
.rma-form-pagina .rma-block .grid-view { margin: 0; }
.rma-form-pagina .rma-block table td, .rma-form-pagina .rma-block table th { padding-left: 1.6rem; }
