/* ── Tokens Dubut Assurances — charte « C Éditorial » ──────────────────────
   Exposés au :root pour usage global (hors composants MudBlazor).
   Le thème MudBlazor (DubutTheme.cs) mappe ces mêmes valeurs sur la palette.
   Login.razor.css redéclare ses propres tokens scopés sur .lg-root : c'est
   intentionnel (doublon assumé — voir lot-theme-auth-global.md §B.3, décision D1).
   ────────────────────────────────────────────────────────────────────────── */
:root {
    --da-red: #a6261a;
    --da-red-deep: #7e1b12;
    --da-red-soft: #f6e9e6;
    --da-ink: #1e1a18;
    --da-gray: #6e7173;
    --da-muted: #5c544e;
    --da-bg: #f4f1ec;
    --da-line: #e9e1da;
    --da-white: #ffffff;
    --da-error: #c0392b;
    --da-warn: #b9770e;
    --da-warn-deep: #8a5808;
    --da-warn-bg: #fdf4e3;
    --da-warn-line: #f0d9a8;
    --da-signal-yellow: #ffd600;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0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Q5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Utilitaires communs — pages Account (hors Login) ────────────────────────
   Centrage vertical pour les pages Account simples (Lockout, AccessDenied, etc.)
   Ces classes sont utilisées dans les pages statiques Account/** qui ne peuvent
   pas bénéficier de CSS isolation (le scoping Blazor ne traverse pas les layouts).
   ────────────────────────────────────────────────────────────────────────── */
.ac-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.ac-card {
    max-width: 520px;
    width: 100%;
    padding: 3rem 2rem;
    border: 1px solid var(--da-line) !important;
    border-radius: 12px !important;
    background: var(--da-white) !important;
}

/* ── Formulaire Account — layout compact centré ──────────────────────────── */
.ac-form {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 0;
}

/* code de récupération 2FA */
.recovery-code {
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    background: var(--da-bg);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    display: inline-block;
}

/* bouton SSO (ExternalLoginPicker) — cohérent avec Login */
.btn-da-sso {
    display: block;
    width: 100%;
    padding: 0.65rem 1.25rem;
    font-family: "Figtree", "Helvetica Neue", sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--da-ink);
    background: var(--da-white);
    border: 1.5px solid var(--da-line);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.btn-da-sso:hover {
    border-color: var(--da-red);
    background: var(--da-red-soft, #f6e9e6);
}

/* ── Champs Account — miroir éditorial des champs Login ──────────────────────
   Utilisés sur les pages Account/** statiques (SSR) qui ne bénéficient pas de
   l'isolation CSS de Login.razor.css. Les classes .ac-* sont équivalentes aux
   classes .fld / .lg-input / .lg-validation-message de la page de connexion.
   Les InputText Blazor rendus à l'intérieur ne portent pas l'attribut de scope :
   on applique les styles globalement ici (pas besoin de ::deep en CSS global).
   ────────────────────────────────────────────────────────────────────────── */
.ac-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ac-label {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--da-ink);
}

.ac-input {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 16px;
    background: var(--da-white);
    border: 1.5px solid var(--da-line);
    border-radius: 10px;
    font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    color: var(--da-ink);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ac-input::placeholder {
    color: var(--da-muted);
}

.ac-input:hover {
    border-color: var(--da-gray);
}

.ac-input:focus {
    border-color: var(--da-red);
    box-shadow: 0 0 0 3px rgba(166, 38, 26, 0.1);
}

.ac-input:disabled {
    background: var(--da-bg);
    color: var(--da-muted);
    cursor: not-allowed;
    border-color: var(--da-line);
}

.ac-validation {
    font-size: 13.5px;
    color: var(--da-error);
    margin-top: 2px;
}

/* Checkbox stylée — harmonisée avec .lg-checkbox de Login */
.ac-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--da-line);
    background: var(--da-white);
    cursor: pointer;
    flex: none;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
    vertical-align: middle;
}

.ac-checkbox:checked {
    background: var(--da-red);
    border-color: var(--da-red);
}

.ac-checkbox:checked::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 5px;
    width: 6px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(42deg);
}

.ac-checkbox:focus-visible {
    outline: 2px solid var(--da-red);
    outline-offset: 2px;
}

/* ── Gestion devis RCP — suivi et validation ─────────────────────────────── */
.rcp-manager-header {
    gap: 16px;
    flex-wrap: wrap;
}

.rcp-manager-header--light .rcp-manager-header__title {
    font-weight: 500;
    color: var(--da-ink);
    opacity: 0.92;
}

.rcp-manager-header--light .rcp-manager-header__subtitle {
    color: var(--da-muted);
    opacity: 0.85;
}

.rcp-manager-header__actions,
.rcp-section-toolbar__actions,
.rcp-youtrust-actions {
    flex-wrap: wrap;
    align-items: center;
}

.rcp-manager-header__actions {
    justify-content: flex-end;
}

.rcp-section-toolbar {
    gap: 12px;
    flex-wrap: wrap;
}

.rcp-section-toolbar__actions {
    justify-content: flex-end;
}

.rcp-editor-heading {
    margin-bottom: 24px;
}

.rcp-editor-heading__eyebrow {
    margin-bottom: 4px;
    color: var(--da-red);
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rcp-editor-heading__title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rcp-editor-heading__title {
    color: var(--da-ink);
    font-family: "Lora", serif;
    font-size: 27px;
    font-weight: 600;
    line-height: 1.25;
}

.gd-fieldset.rcp-fieldset-spaced,
.rcp-manager-form-layout {
    margin-bottom: 24px;
}

.rcp-form-row--top {
    margin-top: 16px;
}

.rcp-form-row--bottom {
    margin-bottom: 16px;
}

.gd-3col.rcp-address-grid {
    grid-template-columns: minmax(0, 2fr) minmax(88px, 100px) minmax(0, 1fr);
    margin-top: 16px;
    margin-bottom: 16px;
}

.rcp-choice-grid {
    display: grid;
    gap: 12px;
}

.rcp-choice-grid--scope {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-top: 16px;
}

.rcp-choice-grid--pjp {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.rcp-choice-grid--history {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 16px;
}

.rcp-choice-grid--consents {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.rcp-created-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.rcp-editor-submit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
    gap: 16px;
    align-items: end;
}

.rcp-editor-submit {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rcp-editor-submit__button {
    height: 46px;
}

.rcp-editor-submit__hint {
    margin: 0;
    color: var(--da-gray);
    font-size: 13px;
    line-height: 1.35;
    text-align: center;
}

.rcp-public-unavailable {
    max-width: 720px;
    margin: 48px auto;
    padding: 28px;
}

.rcp-public-unavailable h1 {
    margin: 0 0 10px;
    color: var(--da-ink);
    font-family: "Lora", serif;
    font-size: 31.5px;
    line-height: 1.2;
}

.rcp-public-unavailable p {
    max-width: 56ch;
    margin: 0 0 20px;
    color: var(--da-muted);
    font-size: 17px;
    line-height: 1.5;
}

.rcp-follow-summary {
    padding: 18px;
    border: 1px solid var(--da-line);
    border-radius: 8px;
    background: var(--da-white);
}

.rcp-follow-summary__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr) minmax(320px, 1.35fr);
    gap: 18px;
    align-items: stretch;
}

.rcp-follow-summary__section {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    padding-right: 18px;
    border-right: 1px solid var(--da-line);
}

.rcp-follow-summary__section:last-child {
    padding-right: 0;
    border-right: none;
}

.rcp-follow-summary__section--status {
    gap: 12px;
}

.rcp-follow-summary__item {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.rcp-follow-summary__item--wide {
    grid-column: 1 / -1;
}

.rcp-follow-summary__client-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 14px 16px;
    border-radius: 8px;
    background: rgb(229, 241, 208);
}

.rcp-follow-summary__client-card .rcp-follow-summary__label,
.rcp-follow-summary__client-card .rcp-follow-summary__value {
    color: #1f2d13;
}

.rcp-follow-summary__split,
.rcp-follow-summary__status-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
}

.rcp-follow-summary__label {
    color: var(--da-muted);
    font-size: 13.5px;
    line-height: 1.2;
}

.rcp-follow-summary__value {
    min-width: 0;
    color: var(--da-ink);
    font-size: 15.5px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.rcp-follow-summary__hint {
    min-width: 0;
    color: var(--da-muted);
    font-size: 13.5px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.rcp-follow-summary__chip {
    width: fit-content;
    max-width: 100%;
}

.rcp-follow-summary__chip .status-dot__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rcp-pipeline-metrics {
    flex-wrap: wrap;
    align-items: center;
}

.rcp-pipeline-table .mud-table-cell {
    vertical-align: top;
}

.rcp-pipeline-table .mud-table-container {
    overflow-x: auto;
}

.rcp-pipeline-cell {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.rcp-pipeline-cell--single {
    justify-content: center;
    min-height: 36px;
}

.rcp-pipeline-chip {
    width: fit-content;
    max-width: 100%;
}

.rcp-pipeline-chip .status-dot__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rcp-profession-chip.mud-chip {
    width: fit-content;
    max-width: 100%;
    border: 1px solid var(--rcp-profession-color, var(--da-ink));
    background: var(--rcp-profession-color, var(--da-ink));
    color: #fff;
    font-weight: 600;
}

.rcp-profession-chip .mud-chip-content {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
}

.rcp-profession-chip--osteo {
    --rcp-profession-color: #1870cc;
}

.rcp-profession-chip--psy {
    --rcp-profession-color: #2E7D32;
}

.rcp-profession-chip--ortho {
    --rcp-profession-color: #7A4FB5;
}

.rcp-contract-chip.mud-chip {
    width: fit-content;
    max-width: 100%;
    border: 1px solid var(--rcp-contract-color, transparent);
    background: var(--rcp-contract-color, transparent);
    color: var(--da-ink);
    font-weight: 600;
}

.rcp-contract-chip .mud-chip-content {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
}

.rcp-contract-chip--rcp {
    --rcp-contract-color: #89AAFC;
}

.rcp-contract-chip--mrp {
    --rcp-contract-color: #E7ADBF;
}

.rcp-pipeline-actions {
    min-width: 168px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.rcp-youtrust-frame {
    width: 100%;
    height: calc(100vh - 330px);
    min-height: 560px;
    border: 1px solid var(--da-line);
    border-radius: 8px;
    background: var(--da-white);
}

@media (max-width: 1200px) {
    .rcp-follow-summary__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rcp-follow-summary__section:nth-child(2) {
        padding-right: 0;
        border-right: none;
    }

    .rcp-follow-summary__section--status {
        grid-column: 1 / -1;
        padding-top: 2px;
        padding-right: 0;
        border-top: 1px solid var(--da-line);
        border-right: none;
    }

    .rcp-editor-submit-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .rcp-follow-summary {
        padding: 14px;
    }

    .rcp-follow-summary__grid,
    .rcp-follow-summary__client-card,
    .rcp-follow-summary__split,
    .rcp-follow-summary__status-row {
        grid-template-columns: 1fr;
    }

    .rcp-follow-summary__section,
    .rcp-follow-summary__section:nth-child(2),
    .rcp-follow-summary__section--status {
        grid-column: auto;
        padding-top: 0;
        padding-right: 0;
        padding-bottom: 14px;
        border-top: none;
        border-right: none;
        border-bottom: 1px solid var(--da-line);
    }

    .rcp-follow-summary__section:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }

    .rcp-pipeline-actions {
        justify-content: flex-start;
    }

    .rcp-manager-header,
    .rcp-manager-header__actions,
    .rcp-section-toolbar,
    .rcp-section-toolbar__actions,
    .rcp-youtrust-actions {
        align-items: stretch;
    }

    .rcp-manager-header__actions,
    .rcp-section-toolbar__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .gd-3col.rcp-address-grid {
        grid-template-columns: 1fr;
    }

    .rcp-editor-heading__title {
        font-size: 23.5px;
    }

    .rcp-youtrust-frame {
        height: 62vh;
        min-height: 420px;
    }
}
