/* Pages publiques des outils gratuits (Components/Tools/), chargées par App.razor à la place de
   MudBlazor et d'app.min.css. Valeurs, en-tête et pied de page repris du site vitrine
   (wwwroot/landing/bordereau-de-pieces/index.html) : le visiteur doit se croire sur www.bordero.ch.
   Polices auto-hébergées, mêmes déclarations qu'app.scss. */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Source Serif 4';
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url('../fonts/source-serif-4-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Mêmes valeurs que le site vitrine */
:root {
    --primary: #1e3a5f;
    --primary-light: #2a4f7f;
    --primary-dark: #152a45;
    --secondary: #546e7a;
    --accent: #3b82f6;
    --success: #2e7d32;
    --success-bg: #edf7ee;
    --warning: #8a5a00;
    --warning-bg: #fff6e0;
    --danger: #b3261e;
    --danger-bg: #fdecea;
    --bg: #f5f7fa;
    --white: #ffffff;
    --text: #1a1a2e;
    --text-light: #475569;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.1);
    --radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.skip-link {
    position: absolute; top: -100%; left: 16px;
    background: var(--primary); color: var(--white);
    padding: 8px 16px; border-radius: 0 0 8px 8px;
    font-weight: 600; font-size: 0.9rem;
    z-index: 200; text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Blazor (FocusOnNavigate) pose le focus sur le titre au chargement : pas de cadre pour autant. */
h1:focus { outline: none; }

/* --- NAV (identique au site vitrine) --- */
#navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s;
}
#navbar.scrolled { box-shadow: var(--shadow); }
.nav-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; height: 64px;
}
.nav-logo {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.5rem; font-weight: 600; color: var(--primary);
    text-decoration: none; line-height: 1;
}
.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links a {
    text-decoration: none; color: var(--text-light); font-size: 0.9rem;
    font-weight: 500; transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }
.nav-login {
    color: var(--primary) !important; font-weight: 600 !important;
    padding: 4px 14px; border: 1.5px solid var(--primary);
    border-radius: 6px; transition: all 0.2s; font-size: 0.85rem;
}
.nav-login:hover { background: var(--primary); color: var(--white) !important; }
.nav-register {
    color: var(--white) !important; font-weight: 600 !important;
    padding: 4px 14px; background: var(--primary); border: 1.5px solid var(--primary);
    border-radius: 6px; transition: all 0.2s; font-size: 0.85rem;
}
.nav-register:hover { background: var(--primary-light); }
.nav-auth { display: flex; gap: 8px; align-items: center; }

.hamburger {
    display: none; background: none; border: none; cursor: pointer;
    width: 32px; height: 32px; flex-direction: column; align-items: stretch;
    justify-content: center; gap: 5px; padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.hamburger span {
    display: block; width: 100%; height: 2.5px; background: var(--primary); border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* --- COMMUN (mêmes valeurs que le site vitrine) --- */
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}
.section-label {
    font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: #1d4ed8; margin-bottom: 12px;
}
.section-title {
    font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em;
    color: var(--primary); line-height: 1.2;
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 28px; border-radius: 10px; border: none;
    font: inherit; font-size: 1rem; font-weight: 600;
    text-decoration: none; cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: var(--white); box-shadow: 0 2px 8px rgba(30,58,95,0.3); }
.btn-primary:hover:not(:disabled) { background: var(--primary-light); transform: translateY(-1px); }
.btn-secondary { background: var(--white); color: var(--primary); border: 2px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); background: var(--bg); }
.btn-small { padding: 7px 14px; font-size: 0.9rem; border-width: 1.5px; }
.btn-block { width: 100%; padding: 13px 16px; white-space: nowrap; }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-link {
    background: none; border: 0; padding: 0; font: inherit; font-size: 0.9rem;
    color: var(--text-light); text-decoration: underline; cursor: pointer;
}
.btn-link:hover { color: var(--text); }

/* --- EN-TÊTE (comme celui de l'accueil) --- */
.tool-hero {
    position: relative; overflow: hidden; text-align: center;
    padding: 136px 24px 136px;
    background: linear-gradient(160deg, var(--bg) 0%, var(--white) 50%, #eef2ff 100%);
}
.tool-hero::before {
    content: ''; position: absolute; top: -200px; right: -200px;
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,0.07) 0%, transparent 70%);
}
.tool-hero__inner { position: relative; max-width: 820px; margin: 0 auto; }
.tool-hero h1 {
    font-size: clamp(2.2rem, 4.6vw, 3.3rem); font-weight: 700;
    letter-spacing: -0.03em; line-height: 1.15; color: var(--primary);
    margin: 0 auto 20px;
}
.tool-hero h1 em {
    display: block; font-style: normal;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; color: transparent;
}
.tool-hero__lead {
    font-size: 1.15rem; color: var(--text-light); line-height: 1.7;
    max-width: 620px; margin: 0 auto 28px;
}
.tool-hero__points {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 12px; list-style: none;
}
.tool-hero__points li {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 999px;
    background: rgba(255,255,255,0.85); border: 1px solid var(--border);
    font-size: 0.9rem; font-weight: 500; color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.tool-hero__points svg { color: var(--success); }

/* --- PLAN DE TRAVAIL --- */
.workbench-wrap { position: relative; z-index: 2; max-width: 1152px; margin: -88px auto 0; padding: 0 24px; }
.workbench {
    position: relative; padding: 28px;
    background: var(--white); border: 1px solid var(--border); border-radius: 16px;
    box-shadow: 0 12px 40px rgba(30,58,95,0.10), 0 2px 6px rgba(30,58,95,0.04);
}
/* Des fichiers survolent le plan de travail : tout le cadre les accepte. */
.workbench--over::after {
    content: ''; position: absolute; inset: 8px; z-index: 3; pointer-events: none;
    border: 2px dashed var(--accent); border-radius: 12px; background: rgba(59,130,246,0.06);
}
.workbench__nojs { padding: 16px; margin-bottom: 16px; border-radius: 10px; background: var(--bg); }

.message {
    display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px;
    padding: 12px 16px; border-radius: 10px; border: 1px solid; font-size: 0.92rem;
}
.message ul { list-style: none; display: grid; gap: 4px; }
.message--error { background: var(--danger-bg); border-color: rgba(179,38,30,0.25); color: var(--danger); }
.message--notice { background: var(--warning-bg); border-color: rgba(138,90,0,0.25); color: var(--warning); }

/* Vide : zone d'ajout et étapes */
.drop {
    display: grid; justify-items: center; gap: 6px;
    padding: 44px 24px 40px; border: 2px dashed #c3cedd; border-radius: 12px;
    background: linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
    text-align: center; cursor: pointer; transition: border-color 0.15s, background-color 0.15s;
}
.drop:hover { border-color: var(--accent); background: #f3f7ff; }
.workbench:has(#pdf-input:focus-visible) .drop { outline: 3px solid var(--accent); outline-offset: 2px; }
.drop__art { margin-bottom: 10px; }
.drop__title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; color: var(--primary); }
.drop__hint { color: var(--text-light); }
.drop__button { margin-top: 14px; pointer-events: none; }
.steps-inline {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 36px;
    list-style: none; margin-top: 24px; color: var(--text-light); font-size: 0.95rem;
}
.steps-inline li { display: inline-flex; align-items: center; gap: 10px; }
.steps-inline__number {
    display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary); color: var(--white); font-size: 0.85rem; font-weight: 700;
}

/* Rempli : les pièces et le panneau */
.bench { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.bench__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.bench__title { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.bench__count {
    display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 8px;
    margin-left: 6px; vertical-align: 3px; border-radius: 999px;
    background: #eef2ff; color: #1d4ed8; font-size: 0.85rem;
}
.bench__actions { display: flex; align-items: center; gap: 16px; }
.bench__hint { margin: 6px 0 14px; color: var(--text-light); font-size: 0.9rem; }

.pieces { display: grid; gap: 8px; list-style: none; }
.piece {
    display: grid; grid-template-columns: 18px auto 44px minmax(0, 1fr) auto;
    align-items: center; gap: 12px; padding: 10px 10px 10px 8px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--white);
    cursor: grab; transition: border-color 0.15s, box-shadow 0.15s;
}
.piece:hover { border-color: #c3cedd; box-shadow: var(--shadow); }
.piece:active { cursor: grabbing; }
.piece.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.piece--dragged { opacity: 0.35; border-style: dashed; box-shadow: none; }
.piece__grip { display: grid; place-items: center; color: #94a3b8; }
.piece__number {
    min-width: 40px; padding: 4px 10px; border-radius: 8px;
    background: var(--primary); color: var(--white);
    font-size: 0.9rem; font-weight: 700; text-align: center; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.piece__thumb {
    display: grid; place-items: center; width: 44px; height: 56px; overflow: hidden;
    border: 1px solid var(--border); border-radius: 4px; background: var(--bg);
}
.piece__thumb canvas, .piece__thumb img { width: 100%; height: 100%; object-fit: contain; }
.piece__thumb canvas:not([data-pdf-drawn]) { visibility: hidden; }
.piece__text { display: grid; gap: 2px; min-width: 0; }
.piece__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.95rem; font-weight: 600; }
.piece__detail { font-size: 0.85rem; color: var(--text-light); }
.piece__tools { display: flex; gap: 2px; }
.icon-button {
    display: inline-grid; place-items: center; width: 34px; height: 34px;
    border: 0; border-radius: 8px; background: none; color: var(--text-light); cursor: pointer;
}
.icon-button:hover:not(:disabled) { background: var(--bg); color: var(--text); }
.icon-button--danger:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); }
.icon-button:disabled { opacity: 0.3; cursor: default; }

/* Une colonne ordinaire : un seul défilement, celui de la page. Le bouton est dans la barre d'action. */
.panel {
    display: grid; gap: 16px; padding: 20px;
    border: 1px solid var(--border); border-radius: 14px; background: var(--bg);
}
.panel__title { font-size: 1.05rem; font-weight: 700; color: var(--primary); }

.preview { display: grid; gap: 8px; }
.preview__box {
    position: relative; height: 190px; overflow: hidden; border-radius: 10px;
    background: linear-gradient(180deg, #e8edf4 0%, #dfe6ef 100%);
}
/* La feuille prend les proportions de la page (fixées par le script) ; la marque se pose sur son coin. */
.preview__sheet {
    position: absolute; inset: 0; margin: auto; width: 117px; height: 166px;
    background: #fff; box-shadow: 0 3px 12px rgba(30,58,95,0.2);
}
.preview__sheet canvas, .preview__sheet img { display: block; width: 100%; height: 100%; }
.preview__stamp {
    position: absolute; top: 7px; right: 7px; z-index: 1; max-width: calc(100% - 14px);
    padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    border: 1px solid #808080; background: #fff; color: #424242;
    font-size: 11px; font-weight: 700; line-height: 1.4;
}
.workbench[data-pdf-position="top-left"] .preview__stamp { right: auto; left: 7px; }
.workbench[data-pdf-position="bottom-right"] .preview__stamp { top: auto; bottom: 7px; }
.preview__caption {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.8rem; color: var(--text-light); text-align: center;
}

.panel__fields { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; min-width: 0; border: 0; }
.field__label { padding: 0; font-size: 0.85rem; font-weight: 600; color: var(--text); }
legend.field__label { margin-bottom: 8px; }
.field__help { font-size: 0.8rem; color: var(--text-light); line-height: 1.5; }
.field__help a { color: #1d4ed8; }
.field__error { font-size: 0.8rem; color: var(--danger); }
.field__custom { margin-top: 8px; }
.field__custom input {
    width: 100%; padding: 8px 10px; border: 1px solid #c3cedd; border-radius: 8px;
    background: var(--white); color: var(--text); font: inherit; font-size: 0.95rem;
}
.field__custom input[aria-invalid="true"] { border-color: var(--danger); }

.stepper {
    display: inline-flex; width: max-content; overflow: hidden;
    border: 1px solid #c3cedd; border-radius: 8px; background: var(--white);
}
.stepper:focus-within { outline: 3px solid rgba(59,130,246,0.35); outline-offset: 1px; }
.stepper input {
    width: 72px; padding: 6px 4px; border: 0; text-align: center;
    font: inherit; font-size: 1rem; font-weight: 600; color: var(--text); background: none;
}
.stepper input:focus { outline: none; }
.stepper input[aria-invalid="true"] { background: var(--danger-bg); color: var(--danger); }
.stepper__button {
    width: 38px; border: 0; background: var(--white); color: var(--primary);
    font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.stepper__button:hover { background: var(--bg); }

.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented--full { display: grid; grid-template-columns: 1fr 1fr; }
.segmented label, .corners label { position: relative; cursor: pointer; }
/* Les deux choix d'une même ligne gardent la même hauteur, même quand un libellé passe à la ligne. */
.segmented label { display: flex; }
.segmented label span { flex: 1; }
.segmented input, .corners input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.segmented span {
    display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 10px;
    border: 1px solid #c3cedd; border-radius: 8px; background: var(--white);
    font-size: 0.875rem; font-weight: 500; color: var(--text); text-align: center;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.segmented label:hover span { border-color: var(--primary-light); }
.segmented input:checked + span { border-color: var(--primary); background: var(--primary); color: var(--white); }
.segmented input:focus-visible + span,
.corners input:focus-visible + .corner { outline: 3px solid var(--accent); outline-offset: 2px; }

.corners { display: flex; gap: 10px; }
.corner {
    position: relative; display: block; width: 40px; height: 52px;
    border: 1px solid #c3cedd; border-radius: 4px; background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.corner::after {
    content: ''; position: absolute; width: 12px; height: 7px; border-radius: 1px; background: #c3cedd;
}
.corner--top-left::after { top: 5px; left: 5px; }
.corner--top-right::after { top: 5px; right: 5px; }
.corner--bottom-right::after { bottom: 5px; right: 5px; }
.corners label:hover .corner { border-color: var(--primary-light); }
.corners input:checked + .corner { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.corners input:checked + .corner::after { background: var(--primary); }

/* Barre d'action : collée en bas de l'écran tant que le plan de travail est visible. */
.actionbar {
    grid-column: 1 / -1; position: sticky; bottom: 0; z-index: 4;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin: -4px -28px -28px; padding: 14px 28px;
    border-top: 1px solid var(--border); border-radius: 0 0 16px 16px;
    background: rgba(255,255,255,0.96); backdrop-filter: blur(8px);
    box-shadow: 0 -6px 16px rgba(30,58,95,0.06);
}
.actionbar__info { display: grid; gap: 2px; min-width: 0; }
.actionbar__summary { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.actionbar__status { font-size: 0.85rem; color: var(--success); }
.actionbar__status:empty { display: none; }

.bench__offline {
    display: flex; align-items: flex-start; gap: 8px; margin-top: 14px;
    font-size: 0.8rem; color: var(--text-light); line-height: 1.5;
}
.bench__dot {
    flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%;
    background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
}

/* --- FUSIONNER ET ORGANISER : les pages en vignettes --- */
.sheets {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px; list-style: none;
}
.sheet {
    display: grid; gap: 6px; align-content: start; min-width: 0; padding: 8px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--white);
    cursor: grab; transition: border-color 0.15s, box-shadow 0.15s;
}
.sheet:hover { border-color: #c3cedd; box-shadow: var(--shadow); }
.sheet:active { cursor: grabbing; }
.sheet.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.18); background: #f7faff; }
.sheet--dragged { opacity: 0.35; border-style: dashed; box-shadow: none; }
/* Cadre carré : une page tournée d'un quart de tour y tient toujours. */
.sheet__thumb {
    position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0;
    border: 0; border-radius: 6px; background: var(--bg); cursor: pointer;
}
.sheet__page {
    position: absolute; inset: 0; margin: auto; width: 64%; height: 90%;
    background: #fff; box-shadow: 0 1px 4px rgba(30,58,95,0.18);
    transform: rotate(var(--turn, 0deg)); transition: transform 0.2s ease;
}
.sheet__page canvas, .sheet__page img { display: block; width: 100%; height: 100%; }
.sheet__page canvas:not([data-pdf-drawn]) { visibility: hidden; }
.sheet__rank {
    position: absolute; top: 6px; left: 6px; z-index: 1; min-width: 26px; padding: 1px 7px;
    border-radius: 6px; background: var(--primary); color: var(--white);
    font-size: 0.8rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.sheet__check {
    position: absolute; top: 6px; right: 6px; z-index: 1; display: grid; place-items: center;
    width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid #94a3b8; background: rgba(255,255,255,0.9); color: transparent;
}
.sheet.is-selected .sheet__check { border-color: var(--accent); background: var(--accent); color: var(--white); }
.sheet__meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.78rem; color: var(--text-light); }
.sheet__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.sheet__origin { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet__number { flex: none; margin-left: auto; font-weight: 600; color: var(--text); }
.sheet__tools { display: flex; justify-content: space-between; }
.sheet__tools .icon-button { width: 30px; height: 30px; }

.sources { display: grid; gap: 6px; list-style: none; }
.source {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
    padding: 8px 6px 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--white);
}
.source__text { display: grid; min-width: 0; }
.source__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; font-weight: 600; }
.source__detail { font-size: 0.78rem; color: var(--text-light); }

.panel__block { display: grid; gap: 8px; }
.selection__count { font-size: 0.88rem; color: var(--text); }
.selection__links { display: flex; gap: 16px; }
.selection__links .btn-link:disabled { opacity: 0.4; cursor: default; }
.selection__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.selection__actions .btn:disabled { opacity: 0.45; cursor: default; }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

.actionbar__buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.actionbar__buttons .btn { padding: 12px 20px; }

.other-tools { margin-top: 28px; font-size: 0.95rem; color: var(--text-light); }
.other-tools a { color: #1d4ed8; font-weight: 600; }

/* --- QUESTIONS FRÉQUENTES (comme sur l'accueil) --- */
.tool-section { padding: 96px 24px; }
.tool-section__inner { max-width: 1104px; margin: 0 auto; }
.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 36px; }
.faq-item { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.faq-item h3 { margin-bottom: 8px; font-size: 0.98rem; font-weight: 600; }
.faq-item p { font-size: 0.9rem; color: var(--text-light); line-height: 1.65; }
.faq-item a { color: #1d4ed8; }

/* --- APPEL À L'ACTION (comme sur l'accueil) --- */
.cta {
    padding: 96px 24px; text-align: center; color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.cta h2 { margin-bottom: 16px; font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.cta p { max-width: 640px; margin: 0 auto 32px; font-size: 1.05rem; line-height: 1.7; opacity: 0.9; }
.cta__buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; }
.cta .btn-primary { background: var(--white); color: var(--primary); box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
.cta .btn-primary:hover { background: var(--bg); }
.cta .btn-secondary { border-color: rgba(255,255,255,0.3); background: transparent; color: var(--white); }
.cta .btn-secondary:hover { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.05); }

/* --- FOOTER (identique au site vitrine) --- */
footer {
    background: var(--primary-dark); color: rgba(255,255,255,0.75);
    padding: 48px 24px;
}
.footer-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 24px;
}
.footer-logo {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1.35rem; font-weight: 600; color: var(--white);
    line-height: 1;
}
.footer-tagline { margin-top: 8px; }
footer p { font-size: 0.85rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; }
.footer-links a {
    color: rgba(255,255,255,0.6); text-decoration: none;
    font-size: 0.85rem; transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); }
.footer-country {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem; color: rgba(255,255,255,0.75);
}
.footer-legal {
    margin-top: 24px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 0.85rem; color: rgba(255,255,255,0.6);
}
.footer-legal p { margin-top: 4px; }

/* --- BANDEAU COOKIES (même apparence que le site vitrine) --- */
.cookie-consent {
    position: fixed; bottom: 16px; right: 16px; z-index: 9999; max-width: 340px;
    padding: 16px 20px; background: #fff; border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.12); border: 1px solid rgba(0,0,0,0.08);
    animation: cookie-slide-up .3s ease-out;
}
.cookie-consent p { color: #546e7a; font-size: 0.875rem; line-height: 1.5; }
.cookie-consent a { color: #546e7a; text-decoration: underline; }
.cookie-consent__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.cookie-consent button {
    padding: 6px 16px; border: none; border-radius: 4px;
    font: inherit; font-size: 0.8125rem; cursor: pointer;
}
.cookie-consent__decline { background: transparent; color: #546e7a; }
.cookie-consent__accept { background: #424242; color: #fff; }
@keyframes cookie-slide-up { from { transform: translateY(calc(100% + 16px)); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 1024px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .nav-links.open {
        display: flex; flex-direction: column; position: absolute;
        top: 64px; left: 0; right: 0; background: var(--white);
        padding: 20px 24px; gap: 12px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow); z-index: 200;
    }
    .nav-links.open a { display: block; padding: 10px 0; font-size: 1rem; }
    .nav-links.open .nav-auth { flex-direction: column; gap: 8px; margin-top: 8px; }
    .nav-links.open .nav-login,
    .nav-links.open .nav-register { text-align: center; display: block; padding: 6px 14px; }
}
@media (max-width: 768px) {
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .drop, .piece, .segmented span, .corner { transition: none; }
    .cookie-consent { animation: none; }
}

@media (pointer: coarse) {
    .icon-button { width: 40px; height: 40px; }
}

@media (max-width: 960px) {
    .bench { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .tool-hero { padding: 108px 20px 112px; }
    .workbench-wrap { margin-top: -72px; padding: 0 12px; }
    .workbench { padding: 18px; }
    .actionbar { margin: -4px -18px -18px; padding: 12px 18px; }
    .tool-section { padding: 64px 20px; }
    .section-title, .cta h2 { font-size: 1.8rem; }
    .faq-grid { grid-template-columns: 1fr; }
    .cta { padding: 64px 20px; }
}
@media (max-width: 600px) {
    .drop { padding: 32px 16px; }
    .steps-inline { flex-direction: column; align-items: flex-start; gap: 10px; padding-left: 8px; }
    /* Sur téléphone, les actions passent sous le nom : la ligne garde la largeur pour le texte. */
    .piece {
        grid-template-columns: auto 36px minmax(0, 1fr);
        grid-template-areas: "number thumb text" "number thumb tools";
        gap: 0 10px; padding: 8px 8px 4px;
    }
    .piece__grip { display: none; }
    .piece__number { grid-area: number; }
    .piece__thumb { grid-area: thumb; width: 36px; height: 46px; }
    .piece__text { grid-area: text; padding-top: 2px; }
    .piece__tools { grid-area: tools; justify-self: start; margin-left: -8px; }
    .bench__actions { width: 100%; justify-content: space-between; }
    .actionbar { flex-wrap: wrap; gap: 10px; }
    .actionbar .btn { flex: 1 1 100%; padding: 13px 16px; }
    .actionbar__buttons { width: 100%; }
    .sheets { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
    .cookie-consent { bottom: 8px; right: 8px; left: 8px; max-width: none; padding: 12px 14px; border-radius: 10px; }
}
