/* =====================================================================
   Plateforme Malongui Consulting – charte inspirée de malongui.ch
   Bleu marine + doré, cartes arrondies à bordure dorée, boutons pilule
   ===================================================================== */
:root {
    --navy: #0b2d6b;
    --navy-dark: #071f4d;
    --gold: #c49a55;
    --gold-light: #f6eedf;
    --gold-border: #e8d5b0;
    --bg: #fbfaf7;
    --text: #1d2433;
    --muted: #6b7280;
    --line: #ece7dc;
    --green: #2f7d4f;
    --red: #b3261e;
    --orange: #b86e12;
    --radius: 18px;
    --shadow: 0 6px 24px rgba(11, 45, 107, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Urbanist", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 15.5px; line-height: 1.55; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* ---------- En-tête ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.logo-mark { font-family: Georgia, serif; font-style: italic; font-size: 1.7rem; color: var(--gold); line-height: 1; padding-right: 10px; border-right: 1px solid var(--gold-border); }
.logo-text { font-family: Georgia, serif; font-size: .95rem; letter-spacing: .08em; color: var(--gold); line-height: 1.05; }
.logo-text small { display: block; font-size: .58rem; letter-spacing: .25em; }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 30px; color: var(--navy); font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--gold-light); color: var(--navy); }
.nav a.active { background: var(--navy); color: #fff; }
.user-box { display: flex; align-items: center; gap: 12px; }
.user-name { font-weight: 600; color: var(--navy); text-align: right; line-height: 1.2; }
.user-name small { display: block; color: var(--gold); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.burger { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--navy); cursor: pointer; }

/* ---------- Mise en page ---------- */
.container { max-width: 1320px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.accent-line { width: 46px; height: 4px; background: var(--gold); border-radius: 4px; margin-bottom: 14px; }
.subtitle { color: var(--navy); margin: 6px 0 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-side { grid-template-columns: 2fr 1fr; }
.stack > * + * { margin-top: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Cartes ---------- */
.card { background: #fff; border: 1px solid var(--gold-border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); position: relative; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-title h2, .card-title h3 { margin: 0; }
.card-num { position: absolute; top: -14px; left: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .9rem; box-shadow: 0 0 0 4px var(--bg); }
.card-link { display: block; color: inherit; transition: transform .15s, box-shadow .15s; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(11, 45, 107, .1); color: inherit; }
.card-head { display: flex; gap: 14px; align-items: flex-start; }
.card-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--gold-light); color: var(--navy); display: grid; place-items: center; flex-shrink: 0; font-size: 1.2rem; }
.card-head h3 { margin: 0; }
.card-head .gold { font-weight: 600; }
.arrow { position: absolute; right: 18px; bottom: 18px; width: 32px; height: 32px; border: 1px solid var(--gold); border-radius: 50%; display: grid; place-items: center; color: var(--gold); }

.stat { text-align: left; }
.stat-value { font-size: 2.1rem; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { color: var(--muted); margin-top: 6px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 600; padding: 11px 22px; border-radius: 40px; background: var(--navy); color: #fff; box-shadow: 0 4px 14px rgba(11, 45, 107, .25); transition: background .15s; white-space: nowrap; }
.btn:hover { background: var(--navy-dark); color: #fff; }
.btn-gold { background: var(--gold); box-shadow: 0 4px 14px rgba(196, 154, 85, .3); }
.btn-gold:hover { background: #ad8544; }
.btn-outline { background: #fff; color: var(--navy); border: 1px solid var(--gold-border); box-shadow: none; }
.btn-outline:hover { background: var(--gold-light); color: var(--navy); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f0c7c4; box-shadow: none; }
.btn-danger:hover { background: #fdf0ef; color: var(--red); }
.btn-sm { padding: 6px 14px; font-size: .88rem; }
.btn-block { width: 100%; justify-content: center; }
.inline { display: inline; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gold); font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--gold-border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fdfbf6; }
td.actions { text-align: right; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 30px; }

/* ---------- Badges statut ---------- */
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.b-blue   { background: #e7eefb; color: var(--navy); }
.b-gold   { background: var(--gold-light); color: #8a6526; }
.b-orange { background: #fdf0de; color: var(--orange); }
.b-green  { background: #e3f3e8; color: var(--green); }
.b-grey   { background: #eeeeee; color: #555; }
.b-red    { background: #fbe7e5; color: var(--red); }

/* Barre d'avancement (client) */
.progress { height: 8px; background: var(--gold-light); border-radius: 8px; overflow: hidden; margin: 14px 0 6px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--navy)); border-radius: 8px; }
.steps { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.steps .on { color: var(--navy); font-weight: 700; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; color: var(--navy); margin-bottom: 6px; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
    width: 100%; font: inherit; padding: 11px 14px; border: 1px solid #ddd5c5; border-radius: 12px; background: #fff; color: var(--text); transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(196, 154, 85, .18); }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 0; }
legend { color: var(--gold); font-weight: 700; padding: 0 8px; text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters input, .filters select { width: auto; min-width: 160px; padding: 9px 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* Zone de dépôt glisser-déposer */
.dropzone { display: block; border: 2px dashed var(--gold-border); border-radius: var(--radius); background: #fffdf8; padding: 28px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone.over { background: var(--gold-light); border-color: var(--gold); }
.dropzone strong { color: var(--navy); }
.dropzone input[type=file] { display: none; }
.dropzone .files { margin-top: 10px; font-size: .9rem; color: var(--navy); }

/* ---------- Messages ---------- */
.flash { padding: 14px 18px; border-radius: 14px; margin-bottom: 22px; font-weight: 500; border: 1px solid; }
.flash-success { background: #eef8f1; border-color: #c3e4cf; color: var(--green); }
.flash-error { background: #fdf0ef; border-color: #f0c7c4; color: var(--red); }
.errors { margin: 0 0 18px; padding: 14px 18px 14px 36px; background: #fdf0ef; border: 1px solid #f0c7c4; border-radius: 14px; color: var(--red); }

/* ---------- Listes ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--navy); }
.date-pill { background: var(--gold-light); color: var(--navy); border-radius: 12px; padding: 6px 10px; text-align: center; min-width: 58px; line-height: 1.1; font-weight: 700; }
.date-pill small { display: block; font-weight: 500; font-size: .7rem; color: #8a6526; text-transform: uppercase; }
.note { background: #fffdf8; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 12px 16px; }
.note.interne { border-left-color: var(--navy); background: #f7f9fd; }
.note + .note { margin-top: 10px; }
.note-meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
dl.info { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; font-weight: 500; }

/* Créneaux */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.slot { border: 1px solid var(--gold-border); border-radius: 14px; padding: 12px; text-align: center; background: #fff; }
.slot .h { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.day-title { margin: 22px 0 10px; color: var(--gold); font-weight: 700; }

/* Aperçu document */
.preview { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 14px; background: #f3f3f3; }
img.preview { height: auto; max-height: 640px; object-fit: contain; }

/* ---------- Connexion ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-visual { background: radial-gradient(circle at 85% 15%, rgba(196,154,85,.25), transparent 45%), linear-gradient(160deg, #0b2d6b, #071f4d); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; }
.auth-visual h1 { color: #fff; font-size: 2.6rem; }
.auth-visual h1 span { color: var(--gold); display: block; }
.auth-visual p { max-width: 460px; opacity: .9; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-form .card { width: 100%; max-width: 420px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .user-name { display: none; }
}
@media (max-width: 980px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-side { grid-template-columns: 1fr; }
    .burger { display: block; margin-left: auto; }
    .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px 24px 20px; border-bottom: 1px solid var(--line); }
    .nav.open { display: flex; }
    .user-name { display: none; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-visual { padding: 40px 28px; }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
    .container { padding: 22px 16px 48px; }
    h1 { font-size: 1.6rem; }
    dl.info { grid-template-columns: 1fr; }
    dl.info dd { margin-bottom: 8px; }
}
