/* CreatifRH Coaching : charte issue de creatifrh.com (polices auto-hébergées, aucun appel à Google) */
@font-face { font-family: 'Montserrat'; font-weight: 400; font-display: swap; src: url(../fonts/montserrat-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url(../fonts/montserrat-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url(../fonts/montserrat-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Ubuntu'; font-weight: 700; font-display: swap; src: url(../fonts/ubuntu-latin-700-normal.woff2) format('woff2'); }

:root {
  --blue: #536295;
  --blue-dark: #3e4a75;
  --blue-soft: #eceef6;
  --coral: #ff9485;
  --coral-dark: #e8705f;
  --coral-soft: #fff0ed;
  --text: #313131;
  --muted: #747d88;
  --bg: #f7f7f8;
  --card: #ffffff;
  --line: #e3e5ec;
  --green: #2f9e6f; --yellow: #d9a400; --orange: #e57a1f; --red: #d23f3f;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(40, 50, 90, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Montserrat', Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.55; }
h1, h2, h3 { font-family: 'Ubuntu', 'Montserrat', sans-serif; font-weight: 700; color: var(--blue-dark); line-height: 1.25; }
h1 { font-size: 1.6rem; margin: 0 0 1.2rem; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 .8rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
a { color: var(--blue); }
small, .muted { color: var(--muted); }

/* Boutons et formulaires */
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 0; border-radius: 999px; padding: .7rem 1.4rem; font: 600 .95rem 'Montserrat', sans-serif; cursor: pointer; text-decoration: none; background: var(--blue); color: #fff; transition: background .15s; }
.btn:hover { background: var(--blue-dark); }
.btn--coral { background: var(--coral); color: #3a1d18; }
.btn--coral:hover { background: var(--coral-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn--ghost:hover { background: var(--blue-soft); }
.btn--danger { background: var(--red); }
.btn--sm { padding: .4rem .9rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .9rem 0 .3rem; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
textarea { resize: vertical; min-height: 120px; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; margin: .8rem 0; padding: .9rem 1rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.alert { padding: .9rem 1.1rem; border-radius: 10px; margin: 0 0 1rem; }
.alert--ok { background: #e8f6ef; color: #1d6b49; }
.alert--err { background: #fdecec; color: #9b2626; }
.alert--info { background: var(--blue-soft); color: var(--blue-dark); }
.alert--demo { background: #fff8e1; color: #6b5200; border: 1px dashed #d9a400; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; }
.pill { display: inline-block; padding: .15rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill--blue { background: var(--blue-soft); color: var(--blue-dark); }
.pill--green { background: #e3f4ec; color: #1d6b49; }
.pill--red { background: #fde2e2; color: #a12525; }
.pill--orange { background: #fdecd9; color: #9a4c09; }
.pill--yellow { background: #fbf2cf; color: #7a5d00; }
.pill--coral { background: var(--coral-soft); color: #b04434; }
.pill--grey { background: #eceef0; color: #5b636d; }

/* ---------- Pages d'accès (login) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth__visual { background: var(--blue); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth__visual::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 340px; height: 340px; border-radius: 50%; background: var(--coral); opacity: .25; }
.auth__visual img { width: 190px; border-radius: 8px; margin-bottom: 2rem; }
.auth__visual h1 { color: #fff; font-size: 2rem; }
.auth__visual p { opacity: .9; max-width: 420px; }
.auth__form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth__box { width: 100%; max-width: 420px; }
.auth__box h2 { margin-top: 0; }
.demo-accounts { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); }
.demo-accounts h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.demo-accounts form { display: inline; }
.demo-accounts button { margin: .2rem .2rem 0 0; }
.demo-list { display: grid; gap: .4rem; }
.demo-list button { width: 100%; justify-content: space-between; text-align: left; }
@media (max-width: 800px) { .auth { grid-template-columns: 1fr; } .auth__visual { padding: 2rem; } }

/* ---------- Espace coaché ---------- */
.u-header { background: var(--blue); color: #fff; display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.5rem; flex-wrap: wrap; }
.u-header__brand { display: flex; align-items: center; gap: .7rem; }
.u-header__crh { height: 46px; border-radius: 6px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); }
.u-header__co { height: 46px; width: 46px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.u-header__x { opacity: .6; }
.u-header__who { display: flex; flex-direction: column; line-height: 1.3; }
.u-header__who span { font-size: .82rem; opacity: .85; }
.u-header__nav { margin-left: auto; display: flex; gap: 1.1rem; flex-wrap: wrap; }
.u-header__nav a { color: #fff; text-decoration: none; font-size: .9rem; opacity: .9; }
.u-header__nav a:hover { opacity: 1; text-decoration: underline; }
.u-header__help { background: var(--coral); color: #3a1d18 !important; padding: .25rem .8rem; border-radius: 999px; opacity: 1 !important; font-weight: 600; }
.u-page { max-width: 860px; margin: 2rem auto; padding: 0 1rem; }

.chat { display: flex; flex-direction: column; height: calc(100vh - 62px); max-width: 860px; margin: 0 auto; }
.chat__top { padding: 1rem 1rem .5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.chat__step { font-size: .85rem; color: var(--muted); }
.chat__step strong { color: var(--blue-dark); display: block; font-size: 1rem; }
.chat__flow { flex: 1; overflow-y: auto; padding: 1rem; scroll-behavior: smooth; }
.msg { display: flex; gap: .7rem; margin: 0 0 1rem; max-width: 85%; animation: pop .25s ease; }
.msg__avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex: none; }
.msg__bubble { background: #fff; padding: .8rem 1rem; border-radius: 4px 16px 16px 16px; box-shadow: var(--shadow); white-space: pre-wrap; }
.msg--user { margin-left: auto; flex-direction: row-reverse; }
.msg--user .msg__avatar { background: var(--coral); color: #3a1d18; }
.msg--user .msg__bubble { background: var(--blue); color: #fff; border-radius: 16px 4px 16px 16px; }
.msg--typing .msg__bubble { color: var(--muted); }
.dots span { display: inline-block; width: 7px; height: 7px; margin-right: 3px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .2s; } .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step-divider { text-align: center; margin: 1.6rem 0; color: var(--blue-dark); font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: 1rem; }
.step-divider::before, .step-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.synthese { background: var(--coral-soft); border-left: 4px solid var(--coral); border-radius: 10px; padding: 1rem 1.2rem; margin: 1rem 0 1.4rem; }
.synthese h3 { color: #b04434; }
.synthese p { margin: .3rem 0; white-space: pre-wrap; }
.chat__input { padding: .8rem 1rem 1.2rem; }
.chat__box { display: flex; gap: .6rem; align-items: flex-end; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: .5rem .5rem .5rem 1rem; box-shadow: var(--shadow); }
.chat__box textarea { border: 0; min-height: 24px; max-height: 180px; padding: .45rem 0; box-shadow: none; }
.chat__box textarea:focus { box-shadow: none; }
.chat__hint { font-size: .78rem; color: var(--muted); text-align: center; margin-top: .5rem; }
.choice { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.emergency { background: #fff; border: 2px solid var(--red); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1rem 0; }
.emergency h3 { color: var(--red); }
.emergency ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.emergency a { font-weight: 700; color: var(--red); }
.done-card { text-align: center; padding: 2rem; }

/* ---------- Espace Jean-Marc ---------- */
.a-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.a-side { background: var(--blue); color: #fff; padding: 1.4rem 1rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.a-side__logo { width: 150px; border-radius: 6px; margin: 0 auto; display: block; }
.a-side__sub { text-align: center; font-size: .8rem; opacity: .8; margin: .4rem 0 1.4rem; text-transform: uppercase; letter-spacing: .08em; }
.a-side nav { display: flex; flex-direction: column; gap: .2rem; }
.a-side nav a { color: #fff; text-decoration: none; padding: .65rem .9rem; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; opacity: .88; font-weight: 600; font-size: .92rem; }
.a-side nav a:hover { background: rgba(255,255,255,.1); opacity: 1; }
.a-side nav a.is-active { background: #fff; color: var(--blue-dark); opacity: 1; }
.a-side__out { margin-top: auto; color: #fff; opacity: .7; font-size: .85rem; text-align: center; }
.badge { background: var(--coral); color: #3a1d18; border-radius: 999px; font-size: .75rem; padding: 0 .5rem; min-width: 22px; text-align: center; }
.badge--urgent { background: #fff; color: var(--red); box-shadow: 0 0 0 2px var(--red); }
.a-main { padding: 2rem 2.4rem; max-width: 1300px; }
.grid { display: grid; gap: 1.2rem; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } .grid--3, .grid--2 { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .a-layout { grid-template-columns: 1fr; } .a-side { position: static; height: auto; } .a-main { padding: 1.2rem; } }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.3rem; }
.kpi__label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi__value { font: 700 2rem 'Ubuntu', sans-serif; color: var(--blue-dark); margin-top: .2rem; }
.kpi__sub { font-size: .82rem; color: var(--muted); }
.kpi--alert .kpi__value { color: var(--red); }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfd; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.tbl td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.is-urgent td { background: #fff6f6; }
.tbl .co { display: flex; align-items: center; gap: .6rem; }
.tbl .co img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.toolbar { display: flex; gap: .7rem; align-items: end; flex-wrap: wrap; margin-bottom: 1.2rem; }
.toolbar label { margin: 0 0 .2rem; font-size: .78rem; }
.toolbar select, .toolbar input { width: auto; padding: .5rem .8rem; }
.seg { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: .4rem .9rem; border-radius: 999px; font: 600 .85rem 'Montserrat', sans-serif; color: var(--muted); cursor: pointer; }
.seg button.is-on { background: var(--blue); color: #fff; }
.chart-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; }
.chart-card h3 { font-size: .95rem; }
.chart-wrap { position: relative; height: 260px; }
.progress { display: flex; gap: 4px; }
.progress span { height: 6px; flex: 1; border-radius: 3px; background: var(--line); }
.progress span.on { background: var(--blue); }
.conv { max-height: 640px; overflow-y: auto; background: var(--bg); border-radius: var(--radius); padding: 1rem; }
.conv .msg { max-width: 92%; }
.hc-flag { font-size: .72rem; color: var(--orange); font-weight: 600; display: block; margin-top: .3rem; }
.notif { display: flex; gap: 1rem; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; margin-bottom: .8rem; border-left: 5px solid var(--line); align-items: flex-start; }
.notif--3 { border-left-color: var(--red); }
.notif--2 { border-left-color: var(--orange); }
.notif--1 { border-left-color: var(--yellow); }
.notif--relais { border-left-color: var(--coral); }
.notif__body { flex: 1; }
.notif__meta { font-size: .82rem; color: var(--muted); }
.notif form { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.logo-prev { width: 70px; height: 70px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 4px; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.def { display: grid; grid-template-columns: 160px 1fr; gap: .4rem 1rem; margin: 0; }
.def dt { color: var(--muted); font-size: .88rem; }
.def dd { margin: 0; font-weight: 600; }
