:root {
    --bg: #f7f7f8;
    --surface: #ffffff;
    --text: #1b1c1e;
    --muted: #5c6169;
    --border: #d9dce1;
    --brand: #1f5eff;
    --brand-ink: #ffffff;
    --ok: #1a7f37;
    --warn: #9a6700;
    --danger: #b42318;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a { color: var(--brand); }
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 3px solid #ffbf47;
    outline-offset: 1px;
}

.container { width: min(1080px, 92vw); margin: 0 auto; }

header.site {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
header.site .inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0; gap: 16px; flex-wrap: wrap;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.15rem; }
nav.site a { margin-right: 14px; text-decoration: none; color: var(--muted); }
nav.site a:hover { color: var(--brand); }

main { padding: 28px 0 60px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
}
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

h1 { font-size: 1.7rem; margin: 0 0 10px; }
h2 { font-size: 1.25rem; margin: 0 0 8px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
p.lead { font-size: 1.08rem; color: var(--muted); }

.btn {
    display: inline-block;
    background: var(--brand); color: var(--brand-ink);
    border: 1px solid var(--brand); border-radius: 8px;
    padding: 9px 15px; text-decoration: none; cursor: pointer;
    font-size: 0.95rem; font-weight: 600;
}
.btn:hover { filter: brightness(0.95); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=file], select, textarea {
    width: 100%; padding: 9px 10px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 0.95rem; background: #fff;
}
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { background: #f0f1f3; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--border); background: #f0f1f3; }
.badge.ok { color: var(--ok); border-color: #b7dfc2; background: #eaf7ed; }
.badge.warn { color: var(--warn); border-color: #f0d999; background: #fdf6e3; }
.badge.danger { color: var(--danger); border-color: #f0b6b0; background: #fdecea; }
.badge.info { color: #0b4bbd; border-color: #b9cdfb; background: #eaf1ff; }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash.status { background: #eaf7ed; border-color: #b7dfc2; color: var(--ok); }
.flash.error { background: #fdecea; border-color: #f0b6b0; color: var(--danger); }

.errors { margin: 0 0 14px; padding-left: 18px; color: var(--danger); }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

footer.site {
    border-top: 1px solid var(--border); background: var(--surface);
    padding: 18px 0; color: var(--muted); font-size: 0.85rem;
}

/* ---------- Filters ---------- */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.filters .field { margin-bottom: 0; }
.filters .btn { width: 100%; }

/* ---------- Problem bank ---------- */
.problem-list { display: grid; gap: 10px; }
.problem-row {
    display: grid; grid-template-columns: 140px 1fr auto; gap: 14px; align-items: center;
    text-decoration: none; color: var(--text); margin-bottom: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.problem-row:hover { border-color: var(--brand); box-shadow: 0 2px 12px rgba(31, 94, 255, 0.08); }
.problem-title { display: flex; flex-direction: column; gap: 2px; }
.lang-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
    font-size: 0.72rem; padding: 1px 7px; border-radius: 999px;
    border: 1px solid var(--border); background: #f7f8fa; color: var(--muted); font-weight: 600;
}

.problem-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 900px) { .problem-detail { grid-template-columns: 1fr; } .problem-row { grid-template-columns: 1fr; } }
.example { border-left: 3px solid var(--border); padding-left: 12px; margin: 10px 0; }
.prose { line-height: 1.6; }
.lesson-page { max-width: 820px; margin: 22px auto 0; }
.lesson-head { margin-bottom: 22px; }
.lesson-head h1 { margin-top: 10px; }
.lesson-list { padding-left: 22px; margin: 10px 0 22px; }
.lesson-list li { padding: 5px 0; }
.lesson-page details { border-top: 1px solid var(--border); padding-top: 12px; }
.lesson-page summary { cursor: pointer; font-weight: 600; }
.lesson-outline ol { margin: 8px 0 0; padding-left: 22px; columns: 2; }
.lesson-outline li { break-inside: avoid; padding: 3px 12px 3px 0; }
@media (max-width: 600px) { .lesson-outline ol { columns: 1; } }
.reading-row { padding: 12px 0; border-top: 1px solid var(--border); }
.reading-row progress { display: block; width: 100%; margin: 8px 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap; }
.tab {
    background: transparent; border: none; border-bottom: 2px solid transparent;
    padding: 7px 12px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 0.9rem;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0.4; } to { opacity: 1; } }

.code-block { position: relative; }
pre {
    background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 16px;
    overflow-x: auto; font-size: 0.83rem; line-height: 1.5; margin: 8px 0 12px;
}
pre code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }
.code-block .copy-btn { position: absolute; top: 8px; right: 8px; padding: 3px 9px; font-size: 0.75rem; }
.example code { background: #f0f1f3; padding: 1px 6px; border-radius: 5px; }

/* ---------- Pricing ---------- */
.price { font-size: 1.6rem; font-weight: 700; margin: 4px 0; }
.price .small { font-weight: 400; }

/* ---------- Job board ---------- */
.job-list { display: grid; gap: 12px; }
.job-card {
    display: block; text-decoration: none; color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.job-card:hover { border-color: var(--brand); box-shadow: 0 4px 18px rgba(31, 94, 255, 0.10); transform: translateY(-1px); }
.job-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.job-title { font-size: 1.12rem; font-weight: 700; margin: 0; }
.job-company { color: var(--muted); font-size: 0.92rem; }
.job-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.job-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fit-reasons { margin: 10px 0 0; padding-left: 18px; }
.fit-reasons li { font-size: 0.85rem; color: var(--muted); }
.salary { font-weight: 700; color: var(--ok); }

/* ---------- Résumé / generation ---------- */
.gen-panel { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; }
.gen-panel .btn { white-space: nowrap; }
.cover-letter { white-space: pre-wrap; font-family: inherit; }
.fact-suggestions { display: grid; gap: 6px; margin: 10px 0; }
.suggestion {
    display: flex; gap: 8px; align-items: flex-start; font-weight: 400;
    border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fafbfc;
}
.suggestion input { width: auto; margin-top: 3px; }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg a, .seg button { padding: 6px 12px; background: #fff; border: none; cursor: pointer; font-size: 0.85rem; }
.seg a.active, .seg button.active { background: var(--brand); color: #fff; }

