/* ==========================================================================
   btpfreelance.com : styles globaux (portail formateur Civil Horizon)

   Inspiration : tableau de bord Amazon KDP.
   Barre supérieure gris foncé, navigation blanche à onglets soulignés,
   contenu blanc en blocs à fine bordure grise, titres et chiffres en serif,
   texte courant en sans-serif, couleur d'action bleu-vert.
   Polices système uniquement (aucun fichier de police à charger).
   ========================================================================== */

:root {
    --bar:        #333333;   /* barre supérieure */
    --bar-text:   #ffffff;
    --page:       #ffffff;
    --side:       #f7f7f7;   /* menu latéral */
    --soft:       #f5f6f6;   /* zones secondaires */
    --text:       #0f1111;
    --text-2:     #565959;
    --text-3:     #6f7373;
    --border:     #d5d9d9;   /* bordure des blocs */
    --rule:       #e3e6e6;   /* séparateurs */
    --tab-rule:   #dddddd;   /* soulignement des onglets inactifs */

    --teal:       #007185;   /* liens, onglet actif */
    --teal-btn:   #0b7285;   /* boutons */
    --teal-dk:    #005a6a;
    --teal-soft:  #e6f2f4;

    --green:  #067d62;  --green-soft: #e8f5f1;
    --red:    #b12704;  --red-soft:   #fcefea;
    --amber:  #8a5a00;  --amber-soft: #fdf4e3;

    --sans:  "Amazon Ember", Arial, "Helvetica Neue", Helvetica, sans-serif;
    --serif: Georgia, "Times New Roman", Times, serif;

    --fs-xs:  .75rem;
    --fs-sm:  .8125rem;
    --fs-base: .9375rem;
    --fs-md:  1.0625rem;
    --fs-lg:  1.3125rem;
    --fs-xl:  1.75rem;
    --fs-2xl: clamp(2rem, 3.6vw, 2.6rem);
    --fs-kpi: clamp(1.9rem, 3vw, 2.3rem);

    --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem;
    --s5: 1.5rem; --s6: 2rem; --s7: 3rem;  --s8: 4rem;

    --radius: 4px;
    --container: 1180px;
    --measure: 72ch;
    --bar-h: 56px;
    --header-h: 56px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 7rem; }
body {
    margin: 0;
    font-family: var(--sans);
    font-size: var(--fs-base);
    line-height: 1.5;
    color: var(--text);
    background: var(--page);
}
img, svg { max-width: 100%; height: auto; display: block; }

/* Titres de page : serif, poids normal (comme « Dashboard ») */
h1 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-2xl); line-height: 1.15; margin: 0 0 var(--s3); letter-spacing: -.01em; }
/* Titres de blocs : sans-serif gras (comme « Estimated royalties ») */
h2, h3, h4 { font-family: var(--sans); font-weight: 700; line-height: 1.25; margin: 0 0 var(--s3); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
h4 { font-size: var(--fs-base); }
p { margin: 0 0 var(--s3); max-width: var(--measure); }
ul, ol { margin: 0 0 var(--s3); padding-left: 1.25rem; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dk); text-decoration: underline; }
strong { font-weight: 700; }
small { font-size: var(--fs-sm); }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.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;
}
.skip-link { position: absolute; left: var(--s4); top: -100px; z-index: 100; background: var(--bar); color: #fff; padding: var(--s2) var(--s4); }
.skip-link:focus { top: var(--s2); color: #fff; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s5); }
.container--narrow { max-width: 880px; }
.mt { margin-top: var(--s4); }
.note { color: var(--text-2); font-size: var(--fs-sm); }
.req { color: var(--red); }
.link { font-weight: 700; }
.link-sm { font-size: var(--fs-sm); }
.inline-form { display: inline; margin: 0; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
    min-height: 36px; padding: .45rem 1rem;
    font: 400 var(--fs-base)/1.2 var(--sans);
    border: 1px solid transparent; border-radius: var(--radius);
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--teal-btn); border-color: var(--teal-btn); color: #fff; }
.btn--primary:hover { background: var(--teal-dk); border-color: var(--teal-dk); color: #fff; }
.btn--ghost { background: #fff; border-color: var(--teal-btn); color: var(--teal-btn); }
.btn--ghost:hover { background: var(--teal-soft); color: var(--teal-dk); }
.btn--light { background: #fff; border-color: #fff; color: var(--text); }
.btn--light:hover { background: var(--soft); color: var(--text); }
.btn--sm { min-height: 30px; padding: .3rem .75rem; font-size: var(--fs-sm); }
.btn--lg { min-height: 42px; padding: .55rem 1.3rem; font-size: var(--fs-md); }
.btn--block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* ---------- En-tête public : barre foncée + navigation à onglets ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bar); }
.site-header__inner {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s5);
    min-height: var(--bar-h);
}
.site-header__logo img { height: 30px; width: auto; filter: brightness(0) invert(1); }
.site-nav ul { display: flex; justify-content: center; gap: var(--s5); list-style: none; margin: 0; padding: 0; }
.site-nav a {
    display: block; padding: 1rem 0 .85rem;
    color: #e6e6e6; font-size: var(--fs-base);
    border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: #fff; border-bottom-color: #8fd3dc; text-decoration: none; }
.site-header__actions { display: flex; align-items: center; gap: var(--s2); }
.site-header .btn--ghost { background: transparent; border-color: #9a9a9a; color: #fff; }
.site-header .btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }
.site-header__burger { display: none; }

.site-header__burger, .studio-header__menu {
    width: 40px; height: 40px; padding: 11px 9px; border: 1px solid #777; border-radius: var(--radius);
    background: transparent; cursor: pointer; flex-direction: column; justify-content: space-between;
}
.site-header__burger span, .studio-header__menu span { display: block; height: 2px; background: #fff; }

@media (max-width: 960px) {
    .site-header__burger { display: flex; justify-self: end; }
    .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--border); padding: var(--s2) var(--s5); }
    .site-nav.is-open { display: block; }
    .site-nav ul { flex-direction: column; gap: 0; }
    .site-nav a { color: var(--text); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
    .site-nav a:hover { color: var(--teal); border-bottom-color: var(--rule); }
    .site-header__actions { grid-column: 1 / -1; justify-content: flex-end; padding-bottom: var(--s3); }
}
@media (max-width: 520px) { .site-header__actions .btn { flex: 1; } }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--side); border-top: 1px solid var(--rule); color: var(--text-2); margin-top: var(--s8); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s6); padding-block: var(--s6) var(--s5); }
.site-footer__brand img { height: 28px; width: auto; margin-bottom: var(--s3); }
.site-footer__brand p { font-size: var(--fs-sm); max-width: 36ch; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-content: flex-start; }
.site-footer__links a { font-size: var(--fs-sm); }
.site-footer__legal { border-top: 1px solid var(--rule); padding-block: var(--s4); font-size: var(--fs-xs); color: var(--text-3); }
.site-footer__legal p { margin: 0; }

/* ---------- Messages ---------- */
.flash-stack { padding-top: var(--s4); }
.alert {
    display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4);
    padding: var(--s3) var(--s4); margin-bottom: var(--s4);
    border: 1px solid; border-radius: var(--radius);
}
.alert p { margin: 0; color: var(--text); }
.alert--success { background: var(--green-soft); border-color: #9fd3c4; }
.alert--info    { background: var(--teal-soft);  border-color: #9fcbd3; }
.alert--error   { background: var(--red-soft);   border-color: #e9b4a6; }
.alert__close { background: none; border: 0; font-size: 1.3rem; line-height: 1; color: var(--text-2); cursor: pointer; padding: 0 var(--s1); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 3px; font-size: var(--fs-xs); font-weight: 700; line-height: 1.7; white-space: nowrap; }
.badge--success { color: var(--green); background: var(--green-soft); }
.badge--warning { color: var(--amber); background: var(--amber-soft); }
.badge--danger  { color: var(--red);   background: var(--red-soft); }
.badge--info    { color: var(--teal);  background: var(--teal-soft); }
.badge--muted   { color: var(--text-2); background: #eeeeee; }

/* ---------- Formulaires ---------- */
.form-row { margin-bottom: var(--s5); border: 0; padding: 0; min-width: 0; }
.form-row > label, .form-row > legend, .form-row__label-line label { display: block; font-weight: 700; margin-bottom: var(--s2); }
.form-row__label-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.form-hint { color: var(--text-2); font-size: var(--fs-sm); margin: calc(-1 * var(--s1)) 0 var(--s2); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"],
input[type="number"], select, textarea {
    width: 100%; min-height: 36px; padding: .45rem .65rem;
    font: inherit; font-size: var(--fs-base); color: var(--text);
    background: #fff; border: 1px solid #888c8c; border-radius: 3px;
    box-shadow: 0 1px 2px rgba(15, 17, 17, .12) inset;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px #c8f3fa, 0 1px 2px rgba(15, 17, 17, .12) inset; }
::placeholder { color: #8a8e8e; }
[aria-invalid="true"] { border-color: var(--red) !important; }
.field-error { color: var(--red); font-size: var(--fs-sm); margin: var(--s1) 0 0; }
input[type="file"] { font: inherit; font-size: var(--fs-sm); }

.form-grid { display: grid; gap: 0 var(--s5); }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .form-grid--2, .form-grid--3 { grid-template-columns: 1fr; } }

.check { display: flex; gap: var(--s2); align-items: flex-start; cursor: pointer; font-weight: 400; }
.check input { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--teal); }

.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s3); }
.choice-card { position: relative; display: block; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice-card > span {
    display: flex; flex-direction: column; gap: 2px; height: 100%;
    padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.choice-card small { color: var(--text-2); }
.choice-card input:checked + span { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 1px var(--teal); }
.choice-card input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.choice-card input:disabled + span { opacity: .45; cursor: not-allowed; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s5); }
.form-actions .form-hint { margin: 0; }
.form-actions + .form-hint { margin-top: var(--s4); }
.char-counter { display: block; text-align: right; color: var(--text-3); font-size: var(--fs-xs); margin-top: var(--s1); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th, .table td { padding: var(--s3) var(--s4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.table thead th { background: var(--side); font-weight: 700; font-size: var(--fs-sm); }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table caption { caption-side: top; text-align: left; font-size: var(--fs-sm); color: var(--text-2); padding-bottom: var(--s2); }
.table--compact th, .table--compact td { padding: var(--s2) var(--s3); }
.table--compact thead th { background: transparent; }
.table__hint { font-size: var(--fs-sm); color: var(--text-2); margin: var(--s1) 0 0; }
.table__actions { text-align: right; white-space: nowrap; }
@media (max-width: 720px) {
    .table-wrap .table thead { display: none; }
    .table-wrap .table tr { display: block; border-bottom: 1px solid var(--rule); padding: var(--s3) 0; }
    .table-wrap .table tr:last-child { border-bottom: 0; }
    .table-wrap .table td { display: flex; justify-content: space-between; gap: var(--s4); border: 0; padding: var(--s1) var(--s4); }
    .table-wrap .table td[data-label]::before { content: attr(data-label); color: var(--text-2); font-size: var(--fs-sm); flex: none; }
    .table-wrap .table td[data-label="Formation"] { display: block; }
    .table-wrap .table td[data-label="Formation"]::before { display: none; }
    .table__actions { text-align: left; }
}

/* ---------- Encadrés ---------- */
.callout { margin: var(--s5) 0; padding: var(--s4) var(--s5); background: var(--soft); border: 1px solid var(--border); border-radius: var(--radius); }
.callout h3 { margin-bottom: var(--s2); }
.callout > :last-child { margin-bottom: 0; }
.callout--warning { background: var(--red-soft); border-color: #e9b4a6; }

.checklist { list-style: disc; padding-left: 1.2rem; }
.checklist li { margin-bottom: var(--s2); padding-left: var(--s1); }
.checklist li::marker { color: var(--text-3); }
.checklist--columns { columns: 2 320px; column-gap: var(--s7); }
.checklist--columns li { break-inside: avoid; }

/* ---------- Blocs de contenu ---------- */
.cards { display: grid; gap: var(--s4); margin-bottom: var(--s5); }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards--2, .cards--3 { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s5); }
.card h3 { margin-bottom: var(--s2); }
.card p { color: var(--text); }
.card > :last-child { margin-bottom: 0; }
.card--wide { margin-top: var(--s4); }
.card--muted { background: var(--soft); }

/* ---------- Connexion ---------- */
.auth__inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--s6); align-items: start; padding-block: var(--s7); }
.auth__card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: var(--s6); }
.auth__card h1 { font-size: var(--fs-xl); }
.auth__lead { color: var(--text-2); }
.auth__divider { display: flex; align-items: center; gap: var(--s3); margin: var(--s5) 0; color: var(--text-2); font-size: var(--fs-sm); }
.auth__divider::before, .auth__divider::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.auth__hint { color: var(--text-2); font-size: var(--fs-sm); margin-top: var(--s3); }
.auth__aside { padding: var(--s5) var(--s2); }
.auth__aside h2 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-xl); }
.mini-steps { padding-left: 1.3rem; }
.mini-steps li { margin-bottom: var(--s2); }
@media (max-width: 820px) { .auth__inner { grid-template-columns: 1fr; gap: var(--s4); } .auth__card { padding: var(--s5); } }

/* ---------- FAQ ---------- */
.faq { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 var(--s5); margin-bottom: var(--s6); }
.faq__group { margin-top: var(--s6); }
.faq__item + .faq__item { border-top: 1px solid var(--rule); }
.faq__item summary { list-style: none; cursor: pointer; padding: var(--s4) 2rem var(--s4) 0; font-weight: 700; position: relative; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
    content: ""; position: absolute; right: .3rem; top: 50%; width: .5rem; height: .5rem;
    border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2);
    transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.faq__item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq__item p { padding-bottom: var(--s4); margin: 0; }

/* ---------- Pages légales ---------- */
.legal__head { margin-bottom: var(--s5); }
.legal__meta { color: var(--text-2); font-size: var(--fs-sm); }
.legal__content { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s6); }
.legal__content h2 { margin-top: var(--s6); }
.legal__content h2:first-child { margin-top: 0; }
.legal__content h3 { margin-top: var(--s5); }
.legal__foot { margin-top: var(--s6); color: var(--text-2); }

/* ---------- Page d'erreur ---------- */
.error-page__inner { padding-block: var(--s8); }
.error-page__code { font-family: var(--serif); font-size: clamp(3.5rem, 10vw, 6rem); line-height: 1; color: #b9bdbd; margin-bottom: var(--s3); }
.error-page__message { color: var(--text-2); }
.error-page__actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}