/* ==========================================================================
   FPT Signer · sistema de disseny
   Estructura inspirada en Verdana (espais, radis, ombres, estats) amb els colors
   FPT validats per a WCAG 2.1 AA. Botons principals en negre càlid; el taronja
   FPT és l'accent de marca. S'activa amb <html class="fpt-modern">.
   Es manté idèntic a FPTSignerWeb/css/fpt-modern.css i FPTSigner.WebAdmin/css/fpt-modern.css.
   ========================================================================== */

/* --- Tipografies (allotjades; llicència OFL) ---------------------------------- */
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin-var.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("fonts/plus-jakarta-sans-latin-var.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fira Code"; src: url("fonts/fira-code-latin-var.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }

:root {
    /* Tinta i superfícies */
    --fpt-ink: #1C1917;                /* text i botó principal: 17,5:1 */
    --fpt-ink-hover: #292524;
    --fpt-text-2: #57534E;             /* text secundari: 7,6:1 */
    --fpt-text-3: #44403C;             /* etiquetes: 10:1 */
    --fpt-bg: #FAFAF9;
    --fpt-surface: #FFFFFF;
    --fpt-surface-2: #F5F5F4;
    --fpt-hairline: #E7E5E4;           /* separadors decoratius */
    --fpt-hairline-2: #F0EEEC;
    --fpt-border: #D6D3D1;             /* botons secundaris */
    --fpt-control: #8F8A85;            /* vores de camps: 3,4:1 */

    /* Marca */
    --fpt-brand: #FD6F02;              /* accent: amb blanc fa 2,8:1, mai text sobre blanc */
    --fpt-brand-strong: #A34600;       /* enllaços i focus: 6,1:1 */
    --fpt-brand-hover: #7A3500;
    --fpt-brand-tint: #FFF3E8;         /* #A34600 a sobre: 5,6:1 */

    /* Estats: text sobre el seu fons */
    --fpt-success: #1B5E20; --fpt-success-bg: #E8F5E9;   /* 7,0:1 */
    --fpt-pending: #8A5000; --fpt-pending-bg: #FFF3E0;   /* 5,9:1 */
    --fpt-danger:  #C62828; --fpt-danger-bg:  #FFEBEE;   /* 4,9:1 */
    --fpt-danger-strong: #B71C1C;                        /* text d'avís: 5,9:1 */
    --fpt-neutral: #37474F; --fpt-neutral-bg: #ECEFF1;   /* 8,4:1 */
    --fpt-info: #0D47A1;    --fpt-info-bg: #E3F2FD;      /* 7,6:1 */

    /* Espais (base 8px), radis i ombres */
    --fpt-s1: 4px; --fpt-s2: 8px; --fpt-s3: 12px; --fpt-s4: 16px; --fpt-s5: 20px; --fpt-s6: 24px; --fpt-s8: 32px; --fpt-s10: 40px; --fpt-s12: 48px; --fpt-s14: 56px;
    --fpt-r-sm: 6px; --fpt-r: 10px; --fpt-r-lg: 14px; --fpt-r-xl: 16px; --fpt-r-full: 9999px;
    --fpt-shadow-sm: 0 1px 3px rgba(28, 25, 23, .05);
    --fpt-shadow: 0 4px 16px rgba(28, 25, 23, .08);
    --fpt-shadow-lg: 0 12px 32px rgba(28, 25, 23, .12);

    --fpt-font: "DM Sans", "Segoe UI", system-ui, sans-serif;
    --fpt-font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
    --fpt-font-mono: "Fira Code", Consolas, "SFMono-Regular", monospace;
    --fpt-dur: 150ms;
}

/* --- Base (especificitat zero amb :where perquè qualsevol classe hi mani) ----- */
html.fpt-modern body {
    margin: 0; background: var(--fpt-bg); color: var(--fpt-ink);
    font-family: var(--fpt-font); font-size: 15px; line-height: 1.5; letter-spacing: 0;
}
:where(.fpt-modern) h1, :where(.fpt-modern) h2, :where(.fpt-modern) h3 { font-family: var(--fpt-font-display); color: var(--fpt-ink); }
:where(.fpt-modern) a { color: var(--fpt-brand-strong); }
:where(.fpt-modern) a:hover { color: var(--fpt-brand-hover); }
.fpt-modern a:not([class]) { color: var(--fpt-brand-strong); }
.fpt-modern a:not([class]):hover { color: var(--fpt-brand-hover); }
.fpt-modern :focus-visible { outline: 2px solid var(--fpt-brand-strong); outline-offset: 2px; }
.fpt-mono { font-family: var(--fpt-font-mono); font-variant-numeric: tabular-nums; }
.fpt-muted { color: var(--fpt-text-2); }
.fpt-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.is-hidden { display: none !important; }

/* --- Estructura de l'aplicació (backoffice) --------------------------------- */
.fpt-app { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--fpt-bg); }
.fpt-side {
    flex: 1 1 248px; max-width: 280px; box-sizing: border-box; background: var(--fpt-surface);
    border-right: 1px solid var(--fpt-hairline); padding: var(--fpt-s5) var(--fpt-s4);
    display: flex; flex-direction: column; gap: 28px;
}
@media (min-width: 992px) { .fpt-side { position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; } }
/* Pantalles estretes: el menú passa a ser una barra compacta (marca i usuari a dalt, enllaços en una fila) */
@media (max-width: 991.98px) {
    .fpt-side { max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--fpt-hairline); }
    .fpt-app .fpt-side__user { order: 2; margin: 0 0 0 auto; padding: 0; border-top: 0; }
    .fpt-app .fpt-side__user .fpt-side__sub, .fpt-app .fpt-side__user .fpt-side__username { display: none; }
    .fpt-app .fpt-nav { order: 3; flex-basis: 100%; flex-direction: row; flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none; }
    .fpt-app .fpt-nav__group { flex-direction: row; flex-wrap: nowrap; gap: 4px; }
    .fpt-app .fpt-nav__label { display: none; }
    .fpt-app .fpt-nav__link { min-height: 36px; padding: 0 10px; white-space: nowrap; }
}
.fpt-side__brand { display: flex; align-items: center; gap: 10px; padding: var(--fpt-s1) var(--fpt-s2); color: var(--fpt-ink); text-decoration: none; }
.fpt-side__brand:hover { color: var(--fpt-ink); text-decoration: none; }
.fpt-side__logo { width: 30px; height: 30px; border-radius: 7px; object-fit: contain; }
.fpt-side__name { display: block; font-family: var(--fpt-font-display); font-weight: 700; font-size: 15px; }
.fpt-side__sub { display: block; font-size: 12px; color: var(--fpt-text-2); }
.fpt-nav { display: flex; flex-direction: column; gap: 22px; }
.fpt-nav__group { display: flex; flex-direction: column; gap: 2px; }
.fpt-nav__label { padding: 0 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--fpt-text-2); }
.fpt-nav__link {
    display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 8px;
    color: var(--fpt-text-3); text-decoration: none; font-size: 14px; font-weight: 500;
    transition: background-color var(--fpt-dur) ease, color var(--fpt-dur) ease;
}
.fpt-nav__link > i { width: 18px; font-size: 16px; text-align: center; }
.fpt-nav__link:hover { background: var(--fpt-surface-2); color: var(--fpt-ink); text-decoration: none; }
.fpt-nav__link.is-active { background: var(--fpt-brand-tint); color: var(--fpt-brand-strong); font-weight: 600; }
.fpt-side__user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--fpt-hairline); }
.fpt-avatar {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
    background: var(--fpt-surface-2); color: var(--fpt-text-3); font-size: 13px; font-weight: 600;
}
.fpt-side__username { display: block; font-size: 14px; font-weight: 600; color: var(--fpt-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpt-main { flex: 999 1 560px; min-width: 0; box-sizing: border-box; padding: 28px 40px 48px; display: flex; flex-direction: column; gap: var(--fpt-s6); }
@media (max-width: 767.98px) { .fpt-main { padding: var(--fpt-s5) var(--fpt-s4) var(--fpt-s8); } }

/* --- Capçalera de pàgina ------------------------------------------------------ */
.fpt-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--fpt-s4); }
.fpt-head__title { margin: 0; font-family: var(--fpt-font-display); font-weight: 700; font-size: 30px; line-height: 1.2; letter-spacing: -.3px; color: var(--fpt-ink); }
.fpt-head__sub { margin: 6px 0 0; font-size: 15px; color: var(--fpt-text-2); }
.fpt-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fpt-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--fpt-text-2); }
.fpt-crumbs a { font-weight: 500; text-decoration: none; }

/* --- Targetes ------------------------------------------------------------------- */
.fpt-card { background: var(--fpt-surface); border: 1px solid var(--fpt-hairline); border-radius: var(--fpt-r-lg); overflow: hidden; min-width: 0; }
.fpt-card--pad { padding: var(--fpt-s6); }
.fpt-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: var(--fpt-s4) var(--fpt-s5); border-bottom: 1px solid var(--fpt-hairline); }
.fpt-card__title { margin: 0; font-family: var(--fpt-font-display); font-size: 16px; font-weight: 700; color: var(--fpt-ink); }
.fpt-card__body { padding: var(--fpt-s5); }
.fpt-stack { display: flex; flex-direction: column; gap: var(--fpt-s5); min-width: 0; }
.fpt-split { display: flex; flex-wrap: wrap; gap: var(--fpt-s5); align-items: flex-start; }
.fpt-split__main { flex: 999 1 520px; min-width: 0; }
.fpt-split__side { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: var(--fpt-s5); }

/* --- Botons ---------------------------------------------------------------------- */
.fpt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
    border: 1px solid transparent; border-radius: var(--fpt-r); font-family: var(--fpt-font); font-size: 15px; font-weight: 600;
    line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color var(--fpt-dur) ease, border-color var(--fpt-dur) ease, color var(--fpt-dur) ease;
}
.fpt-btn:hover { text-decoration: none; }
.fpt-btn:disabled, .fpt-btn.is-disabled { opacity: .5; cursor: not-allowed; }
.fpt-btn--primary { background: var(--fpt-ink); color: #FFFFFF; }
.fpt-btn--primary:hover, .fpt-btn--primary:focus { background: var(--fpt-ink-hover); color: #FFFFFF; }
.fpt-btn--secondary { background: var(--fpt-surface); border-color: var(--fpt-border); color: var(--fpt-ink); }
.fpt-btn--secondary:hover { background: var(--fpt-surface-2); color: var(--fpt-ink); }
.fpt-btn--ghost { background: transparent; color: var(--fpt-text-3); }
.fpt-btn--ghost:hover { background: var(--fpt-surface-2); color: var(--fpt-ink); }
.fpt-btn--danger { background: transparent; color: var(--fpt-danger); }
.fpt-btn--danger:hover { background: var(--fpt-danger-bg); color: var(--fpt-danger); }
.fpt-btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.fpt-btn--lg { min-height: 54px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.fpt-btn--block { width: 100%; }
.fpt-btn > i { font-size: 15px; }
.fpt-iconbtn {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0;
    border: 0; border-radius: 8px; background: transparent; color: var(--fpt-text-2); cursor: pointer; text-decoration: none;
}
.fpt-iconbtn:hover { background: var(--fpt-surface-2); color: var(--fpt-ink); text-decoration: none; }

/* Botons de Bootstrap (bootbox, modals) al mateix estil */
.fpt-modern .btn { border-radius: var(--fpt-r); font-family: var(--fpt-font); font-weight: 600; min-height: 40px; box-shadow: none; }
.fpt-modern .btn-primary,
.fpt-modern .btn-primary:not(:disabled):not(.disabled):active { background: var(--fpt-ink); border-color: var(--fpt-ink); color: #FFFFFF; box-shadow: none; }
.fpt-modern .btn-primary:hover, .fpt-modern .btn-primary:focus { background: var(--fpt-ink-hover); border-color: var(--fpt-ink-hover); color: #FFFFFF; }
.fpt-modern .btn-danger,
.fpt-modern .btn-danger:not(:disabled):not(.disabled):active { background: var(--fpt-danger); border-color: var(--fpt-danger); color: #FFFFFF; box-shadow: none; }
.fpt-modern .btn-danger:hover { background: #A51F1F; border-color: #A51F1F; color: #FFFFFF; }
.fpt-modern .btn-default, .fpt-modern .btn-secondary, .fpt-modern .btn-light, .fpt-modern .btn-outline-primary { background: var(--fpt-surface); border: 1px solid var(--fpt-border); color: var(--fpt-ink); }
.fpt-modern .btn-default:hover, .fpt-modern .btn-secondary:hover, .fpt-modern .btn-light:hover, .fpt-modern .btn-outline-primary:hover { background: var(--fpt-surface-2); color: var(--fpt-ink); }

/* --- Camps --------------------------------------------------------------------------- */
.fpt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fpt-label { margin: 0; font-size: 14px; font-weight: 600; color: #292524; }
.fpt-help { margin: 0; font-size: 13px; color: var(--fpt-text-2); }
.fpt-error { margin: 0; font-size: 13px; color: var(--fpt-danger); }
.fpt-input, .fpt-select, .fpt-modern .form-control {
    width: 100%; min-height: 44px; box-sizing: border-box; padding: 0 14px;
    border: 1px solid var(--fpt-control); border-radius: var(--fpt-r); background: var(--fpt-surface);
    font-family: var(--fpt-font); font-size: 15px; color: var(--fpt-ink); box-shadow: none;
    transition: border-color var(--fpt-dur) ease, box-shadow var(--fpt-dur) ease;
}
.fpt-modern textarea.form-control { padding: 10px 14px; }
.fpt-input:hover, .fpt-select:hover, .fpt-modern .form-control:hover { border-color: var(--fpt-text-3); }
.fpt-input:focus, .fpt-select:focus, .fpt-modern .form-control:focus { outline: 0; border-color: var(--fpt-brand-strong); box-shadow: 0 0 0 1px var(--fpt-brand-strong); }
.fpt-input--lg { min-height: 54px; font-size: 17px; border-radius: 12px; padding: 0 16px; }
.fpt-input--mono { font-family: var(--fpt-font-mono); letter-spacing: .02em; }
.fpt-input.is-invalid, .fpt-select.is-invalid, .fpt-modern .form-control.is-invalid, .fpt-modern .input-validation-error {
    border-color: var(--fpt-danger); box-shadow: 0 0 0 1px var(--fpt-danger);
}
.fpt-search { position: relative; }
.fpt-search > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--fpt-text-2); pointer-events: none; }
.fpt-search > .fpt-input { padding-left: 42px; }
.fpt-pass { position: relative; }
.fpt-pass > .fpt-input { padding-right: 88px; }
.fpt-pass > button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--fpt-surface-2); color: var(--fpt-text-3); font-family: var(--fpt-font); font-size: 14px; font-weight: 500; cursor: pointer; }
.fpt-modern .field-validation-error { display: block; font-size: 13px; color: var(--fpt-danger); }

/* --- Etiquetes ----------------------------------------------------------------------- */
.fpt-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--fpt-r-full);
    font-size: 13px; font-weight: 600; line-height: 1.35; white-space: nowrap; background: var(--fpt-neutral-bg); color: var(--fpt-neutral);
}
.fpt-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fpt-pill--success { background: var(--fpt-success-bg); color: var(--fpt-success); }
.fpt-pill--pending { background: var(--fpt-pending-bg); color: var(--fpt-pending); }
.fpt-pill--danger  { background: var(--fpt-danger-bg);  color: var(--fpt-danger); }
.fpt-pill--info    { background: var(--fpt-info-bg);    color: var(--fpt-info); }
.fpt-tag { display: inline-flex; padding: 4px 10px; border-radius: var(--fpt-r-sm); background: var(--fpt-surface-2); color: var(--fpt-text-3); font-size: 13px; font-weight: 500; white-space: nowrap; }
.fpt-tag--warning { background: var(--fpt-pending-bg); color: var(--fpt-pending); }

/* Filtres en pastilla (aria-pressed) */
.fpt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fpt-chip {
    min-height: 34px; padding: 0 14px; border-radius: var(--fpt-r-full); border: 1px solid var(--fpt-border);
    background: var(--fpt-surface); color: var(--fpt-ink); font-family: var(--fpt-font); font-size: 14px; font-weight: 500; cursor: pointer;
}
.fpt-chip:hover { background: var(--fpt-surface-2); }
.fpt-chip[aria-pressed="true"] { background: var(--fpt-ink); border-color: var(--fpt-ink); color: #FFFFFF; }
.fpt-chip:disabled { opacity: .5; cursor: not-allowed; }

/* Barres d'eines i files de filtres */
.fpt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: var(--fpt-s4); border-bottom: 1px solid var(--fpt-hairline); }
.fpt-toolbar > .fpt-search { flex: 1 1 280px; }
.fpt-toolbar > .fpt-select { flex: 0 1 240px; width: auto; }
.fpt-toolbar__meta { margin-left: auto; font-size: 14px; color: var(--fpt-text-2); }

/* Document en una fila de taula */
.fpt-doc { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fpt-doc__icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 9px; background: var(--fpt-brand-tint); color: var(--fpt-brand-strong); font-size: 17px; }
.fpt-doc__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fpt-doc__name { color: var(--fpt-ink); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.fpt-doc__name:hover { color: var(--fpt-brand-strong); text-decoration: underline; }
.fpt-doc__id { font-family: var(--fpt-font-mono); font-size: 12px; color: var(--fpt-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpt-date { display: flex; flex-direction: column; gap: 2px; }
.fpt-date__rel { font-size: 12px; color: var(--fpt-text-2); }

/* --- Llistes de definició ---------------------------------------------------------- */
.fpt-dl { margin: 0; display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 12px 16px; }
.fpt-dl dt { font-size: 13px; font-weight: 400; color: var(--fpt-text-2); }
.fpt-dl dd { margin: 0; font-size: 14px; color: var(--fpt-ink); overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .fpt-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .fpt-dl dd { margin-bottom: 10px; } }

/* --- Capçalera d'un document --------------------------------------------------------- */
.fpt-hero { display: flex; flex-wrap: wrap; gap: var(--fpt-s5); align-items: center; justify-content: space-between; padding: var(--fpt-s6); }
.fpt-hero__main { display: flex; gap: var(--fpt-s4); align-items: flex-start; min-width: 0; flex: 1 1 520px; }
.fpt-hero__icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 52px; height: 52px; border-radius: 12px; background: var(--fpt-brand-tint); color: var(--fpt-brand-strong); font-size: 22px; }
.fpt-hero__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fpt-hero__title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; font-family: var(--fpt-font-display); font-weight: 700; font-size: 26px; letter-spacing: -.2px; overflow-wrap: anywhere; }
.fpt-hero__meta { margin: 0; font-size: 14px; color: var(--fpt-text-2); }
.fpt-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fpt-code__label { font-size: 13px; font-weight: 600; color: var(--fpt-text-3); }
@media (max-width: 575.98px) {
    .fpt-hero { padding: var(--fpt-s4); }
    .fpt-hero__title { font-size: 20px; }
    .fpt-hero__icon { width: 40px; height: 40px; font-size: 18px; }
}
.fpt-code__value { font-family: var(--fpt-font-mono); font-size: 13px; padding: 4px 8px; border-radius: var(--fpt-r-sm); background: var(--fpt-surface-2); color: var(--fpt-ink); overflow-wrap: anywhere; }

/* --- Targeta de signatura --------------------------------------------------------------- */
.fpt-sig__head { display: flex; gap: 14px; align-items: center; padding: var(--fpt-s5); background: var(--fpt-success-bg); color: var(--fpt-success); }
.fpt-sig__seal { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: #FFFFFF; font-size: 20px; }
.fpt-sig__title { margin: 0; font-family: var(--fpt-font-display); font-size: 17px; font-weight: 700; color: inherit; }
.fpt-sig__text { display: block; font-size: 13px; color: inherit; }
.fpt-sig--warning .fpt-sig__head { background: var(--fpt-pending-bg); color: var(--fpt-pending); }
.fpt-sig--danger .fpt-sig__head { background: var(--fpt-danger-bg); color: var(--fpt-danger-strong); }
.fpt-meter { padding: 0 var(--fpt-s5) var(--fpt-s5); display: flex; flex-direction: column; gap: 8px; }
.fpt-meter__labels { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--fpt-text-2); }
.fpt-meter__track { height: 6px; border-radius: 3px; background: var(--fpt-hairline-2); overflow: hidden; }
.fpt-meter__fill { height: 100%; background: var(--fpt-success); }

/* --- Activitat ------------------------------------------------------------------------- */
.fpt-timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--fpt-s4); }
/* Dins d'una targeta, el padding: 0 de dalt anul·lava el de .fpt-card__body (mateixa especificitat, va després). */
.fpt-timeline.fpt-card__body { padding: var(--fpt-s5); }
.fpt-timeline li { display: flex; gap: 12px; }
.fpt-timeline__dot { width: 10px; height: 10px; margin-top: 5px; flex-shrink: 0; border-radius: 50%; background: #A8A29E; }
.fpt-timeline__dot--brand { background: var(--fpt-brand); }
.fpt-timeline__dot--success { background: var(--fpt-success); }
.fpt-timeline__title { display: block; font-size: 14px; font-weight: 600; }
.fpt-timeline__when { display: block; font-size: 13px; color: var(--fpt-text-2); }

/* --- Avisos ---------------------------------------------------------------------------- */
.fpt-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--fpt-r); font-size: 14px; line-height: 1.45; }
.fpt-alert > i { margin-top: 2px; }
.fpt-alert p { margin: 0; }
.fpt-alert--danger  { background: var(--fpt-danger-bg);  color: var(--fpt-danger-strong); }
.fpt-alert--success { background: var(--fpt-success-bg); color: var(--fpt-success); }
.fpt-alert--info    { background: var(--fpt-info-bg);    color: var(--fpt-info); }
.fpt-alert--warning { background: var(--fpt-pending-bg); color: var(--fpt-pending); }
.fpt-alert__title { display: block; font-weight: 600; }

/* --- Visor de document -------------------------------------------------------------------- */
.fpt-viewer { background: var(--fpt-surface-2); padding: var(--fpt-s6); }
/* Sense radi, ombra ni retall a l'<object>: el visor de PDF de Firefox (pdf.js) es pinta en una capa
   amb màscara i el quadre de cerca hi perd el fons. */
.fpt-viewer object { display: block; width: 100%; height: 78vh; min-height: 520px; border: 1px solid var(--fpt-hairline); }
.fpt-card--viewer { overflow: visible; }
.fpt-card--viewer .fpt-viewer { border-radius: 0 0 var(--fpt-r-lg) var(--fpt-r-lg); }
.fpt-viewer__fallback { padding: var(--fpt-s8); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
@media (max-width: 575.98px) { .fpt-viewer { padding: 0; } .fpt-viewer object { border: 0; } }

/* --- Targetes d'acció (inici) ------------------------------------------------------------- */
.fpt-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--fpt-s4); }
.fpt-action {
    display: flex; gap: var(--fpt-s4); align-items: flex-start; padding: var(--fpt-s6);
    background: var(--fpt-surface); border: 1px solid var(--fpt-hairline); border-radius: var(--fpt-r-lg);
    color: var(--fpt-ink); text-decoration: none; transition: border-color var(--fpt-dur) ease, box-shadow var(--fpt-dur) ease;
}
.fpt-action:hover { border-color: var(--fpt-border); box-shadow: var(--fpt-shadow); color: var(--fpt-ink); text-decoration: none; }
.fpt-action__icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--fpt-r); background: var(--fpt-brand-tint); color: var(--fpt-brand-strong); font-size: 19px; }
.fpt-action__title { display: block; margin: 0 0 4px; font-family: var(--fpt-font-display); font-size: 16px; font-weight: 700; }
.fpt-action__text { display: block; font-size: 14px; color: var(--fpt-text-2); }

/* --- Passos d'un formulari --------------------------------------------------------------- */
.fpt-step { display: flex; gap: var(--fpt-s4); padding: var(--fpt-s6); }
.fpt-step + .fpt-step { border-top: 1px solid var(--fpt-hairline); }
.fpt-step__num { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--fpt-ink); color: #FFFFFF; font-size: 14px; font-weight: 600; }
.fpt-step__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--fpt-s4); }
.fpt-step__title { margin: 3px 0 0; font-family: var(--fpt-font-display); font-size: 17px; font-weight: 700; }
.fpt-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--fpt-s4); }
.fpt-form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding: var(--fpt-s4) var(--fpt-s6); border-top: 1px solid var(--fpt-hairline); background: var(--fpt-bg); }

/* --- Zona per deixar un fitxer (accessible amb teclat) ------------------------------------ */
.fpt-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0;
    padding: var(--fpt-s10) var(--fpt-s6); border: 2px dashed var(--fpt-control); border-radius: var(--fpt-r-lg);
    background: var(--fpt-bg); text-align: center; cursor: pointer;
    transition: border-color var(--fpt-dur) ease, background-color var(--fpt-dur) ease;
}
.fpt-drop:hover, .fpt-drop.is-dragover { border-color: var(--fpt-brand-strong); background: var(--fpt-brand-tint); }
.fpt-drop:focus-within { outline: 2px solid var(--fpt-brand-strong); outline-offset: 2px; }
.fpt-drop__icon { font-size: 34px; color: var(--fpt-brand-strong); margin-bottom: 6px; }
.fpt-drop__title { font-size: 16px; font-weight: 600; color: var(--fpt-ink); }
.fpt-drop__sub { font-size: 14px; color: var(--fpt-text-2); }
.fpt-drop__link { color: var(--fpt-brand-strong); text-decoration: underline; font-weight: 600; }
.fpt-file { display: flex; align-items: center; gap: var(--fpt-s4); padding: 12px var(--fpt-s4); background: var(--fpt-surface); border: 1px solid var(--fpt-hairline); border-radius: var(--fpt-r); }
.fpt-file__info { flex: 1; min-width: 0; }
.fpt-file__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpt-file__size { font-size: 13px; color: var(--fpt-text-2); }

/* --- Modals (Bootstrap) -------------------------------------------------------------------- */
.fpt-modern .modal-content { border: 0; border-radius: var(--fpt-r-xl); box-shadow: var(--fpt-shadow-lg); }
.fpt-modern .modal-header { padding: var(--fpt-s5) var(--fpt-s6); border-bottom: 1px solid var(--fpt-hairline); }
.fpt-modern .modal-title { font-family: var(--fpt-font-display); font-weight: 700; font-size: 18px; color: var(--fpt-ink); }
.fpt-modern .modal-body { padding: var(--fpt-s6); }
.fpt-modern .modal-footer { border-top: 1px solid var(--fpt-hairline); }

/* --- Login ---------------------------------------------------------------------------------- */
.fpt-login { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--fpt-bg); }
.fpt-login__brand {
    flex: 1 1 520px; box-sizing: border-box; padding: var(--fpt-s14) 64px; background: var(--fpt-ink); color: #F5F5F4;
    display: flex; flex-direction: column; justify-content: space-between; gap: var(--fpt-s12);
}
.fpt-login__logo { display: flex; align-items: center; gap: 12px; }
.fpt-login__logo img { width: 36px; height: 36px; border-radius: 8px; background: #FFFFFF; padding: 3px; box-sizing: border-box; }
.fpt-login__org { display: block; font-family: var(--fpt-font-display); font-weight: 700; font-size: 16px; color: #FAFAF9; }
.fpt-login__app { display: block; font-size: 13px; color: #D6D3D1; }
.fpt-login__pitch { display: flex; flex-direction: column; gap: var(--fpt-s5); max-width: 520px; }
.fpt-login__eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--fpt-brand); }  /* 6,1:1 sobre la tinta */
.fpt-login__title { margin: 0; font-family: var(--fpt-font-display); font-weight: 700; font-size: 44px; line-height: 1.12; letter-spacing: -.5px; color: #FAFAF9; }
.fpt-login__text { margin: 0; font-size: 17px; line-height: 1.6; color: #D6D3D1; }
.fpt-login__copy { margin: 0; font-size: 13px; color: #A8A29E; }
.fpt-login__main { flex: 1 1 480px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: var(--fpt-s14) var(--fpt-s6); }
.fpt-login__form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; }
.fpt-login__formtitle { margin: 0; font-family: var(--fpt-font-display); font-weight: 700; font-size: 30px; letter-spacing: -.3px; }
.fpt-login__formtext { margin: 8px 0 0; font-size: 15px; color: var(--fpt-text-2); }
.fpt-login__foot { margin: 8px 0 0; padding-top: 18px; border-top: 1px solid var(--fpt-hairline); font-size: 13px; line-height: 1.5; color: var(--fpt-text-2); }
@media (max-width: 991.98px) {
    .fpt-login__brand { padding: var(--fpt-s8) var(--fpt-s6); gap: var(--fpt-s6); }
    .fpt-login__title { font-size: 30px; }
    .fpt-login__text, .fpt-login__copy { display: none; }
    .fpt-login__main { padding: var(--fpt-s8) var(--fpt-s5); }
}

/* --- Validador públic ------------------------------------------------------------------------ */
.fpt-pub { display: flex; flex-direction: column; min-height: 100vh; }
.fpt-pub__header { background: var(--fpt-surface); border-bottom: 1px solid var(--fpt-hairline); }
.fpt-pub__wrap { max-width: 1040px; margin: 0 auto; padding-left: var(--fpt-s6); padding-right: var(--fpt-s6); box-sizing: border-box; }
.fpt-pub__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--fpt-s4); padding-top: 14px; padding-bottom: 14px; }
.fpt-pub__logo { height: 40px; width: auto; }
.fpt-pub__service { font-size: 14px; color: var(--fpt-text-2); }
.fpt-pub__main { flex: 1; width: 100%; padding-top: var(--fpt-s14); padding-bottom: 64px; display: flex; flex-direction: column; gap: 28px; }
.fpt-pub__title { margin: 0; font-family: var(--fpt-font-display); font-weight: 700; font-size: 40px; line-height: 1.12; letter-spacing: -.5px; }
.fpt-pub__lead { margin: 12px 0 0; max-width: 720px; font-size: 17px; line-height: 1.6; color: var(--fpt-text-2); }
.fpt-pub__footer { border-top: 1px solid var(--fpt-hairline); background: var(--fpt-surface); font-size: 13px; color: var(--fpt-text-2); }
.fpt-pub__footer .fpt-pub__wrap { padding-top: 18px; padding-bottom: 18px; }
.fpt-csv { display: flex; flex-direction: column; gap: 8px; padding: var(--fpt-s5); }
.fpt-csv__row { display: flex; flex-wrap: wrap; gap: 10px; }
.fpt-csv__row > .fpt-input { flex: 1 1 360px; width: auto; }
.fpt-result__head { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; padding: var(--fpt-s6); background: var(--fpt-success-bg); color: var(--fpt-success); }
.fpt-result__head .fpt-sig__seal { width: 56px; height: 56px; font-size: 26px; }
.fpt-result__title { margin: 0; font-family: var(--fpt-font-display); font-size: 22px; font-weight: 700; color: inherit; }
.fpt-result__text { display: block; margin-top: 4px; font-size: 15px; color: inherit; }
.fpt-result--warning .fpt-result__head { background: var(--fpt-pending-bg); color: var(--fpt-pending); }
.fpt-details { padding: 18px var(--fpt-s5); }
.fpt-details summary { cursor: pointer; font-size: 15px; font-weight: 600; color: var(--fpt-brand-strong); }
.fpt-details p { margin: 12px 0 0; font-size: 15px; line-height: 1.6; color: var(--fpt-text-3); }
@media (max-width: 575.98px) { .fpt-pub__title { font-size: 30px; } .fpt-pub__main { padding-top: var(--fpt-s8); } }

/* --- Estat buit (taules i llistes) ---------------------------------------------------------- */
.fpt-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; padding: var(--fpt-s12) var(--fpt-s4); text-align: center; }
.fpt-empty__icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 4px; border-radius: 50%; background: var(--fpt-surface-2); color: var(--fpt-text-2); font-size: 20px; }
.fpt-empty__title { margin: 0; font-family: var(--fpt-font-display); font-size: 16px; font-weight: 700; color: var(--fpt-ink); }
.fpt-empty__text { margin: 0; max-width: 440px; font-size: 14px; line-height: 1.5; color: var(--fpt-text-2); }

/* --- Càrrega: una signatura que es dibuixa ----------------------------------------------------- */
.fpt-loader { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: var(--fpt-s4); background: rgba(250, 250, 249, .78); }
.fpt-loader[hidden] { display: none; }
.fpt-loader__card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: var(--fpt-s6) var(--fpt-s8) var(--fpt-s5); background: var(--fpt-surface); border: 1px solid var(--fpt-hairline); border-radius: var(--fpt-r-xl); box-shadow: var(--fpt-shadow-lg); }
.fpt-loader__sign { display: block; width: 168px; height: 64px; overflow: visible; }
.fpt-loader__stroke { fill: none; stroke: var(--fpt-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100 102; stroke-dashoffset: 101; animation: fpt-signa 1.8s ease-in-out infinite; }
.fpt-loader__line { stroke: var(--fpt-brand); stroke-width: 2.5; stroke-linecap: round; transform-box: fill-box; transform-origin: 0 50%; animation: fpt-ratlla 1.8s ease-in-out infinite; }
.fpt-loader__text { font-size: 14px; font-weight: 500; color: var(--fpt-text-2); }
@keyframes fpt-signa { 0% { stroke-dashoffset: 101; opacity: 1; } 60% { stroke-dashoffset: 0; opacity: 1; } 85% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes fpt-ratlla { 0%, 25% { transform: scaleX(0); } 70%, 100% { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
    .fpt-btn, .fpt-nav__link, .fpt-action, .fpt-drop, .fpt-input, .fpt-select, .fpt-modern .form-control { transition: none; }
    .fpt-loader__stroke { animation: none; stroke-dashoffset: 0; }
    .fpt-loader__line { animation: none; }
}
