:root {
  --navy: #14213d;
  --orange: #f28c28;
  --orange-soft: #fde9d4;
  --bg: #eef1f6;
  --card: #fff;
  --ink: #1c2233;
  --muted: #667085;
  --line: #dde3ec;
  --ok: #12a150;
  --bad: #e5484d;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #dfe4ec;
  color: var(--ink);
}
button { font: inherit; }

.app {
  max-width: 460px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; background: var(--bg);
  box-shadow: 0 0 40px rgba(20, 33, 61, .08);
}

/* --- Barre du haut --- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 14px; background: var(--navy); color: #fff;
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand small { display: block; opacity: .7; font-size: 12px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px; background: var(--orange);
  display: grid; place-items: center; font-weight: 800; color: var(--navy);
}
.roles { display: flex; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 3px; }
.role-btn {
  border: 0; background: none; color: #fff; padding: 7px 12px; border-radius: 999px;
  font-weight: 600; cursor: pointer; font-size: 13px;
}
.role-btn.on { background: #fff; color: var(--navy); }

main { flex: 1; padding: 14px 14px 96px; }

/* --- Barre d'onglets --- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 460px; display: flex; background: #fff;
  border-top: 1px solid var(--line); z-index: 5;
}
.tabbar button {
  flex: 1; border: 0; background: none; padding: 15px 4px;
  font-weight: 600; color: var(--muted); cursor: pointer; font-size: 14px;
}
.tabbar button.on { color: var(--navy); box-shadow: inset 0 3px 0 var(--orange); }
.badge-count:not(:empty) {
  background: var(--orange); color: #fff; border-radius: 999px;
  padding: 1px 7px; font-size: 12px; margin-left: 6px;
}

/* --- Sélecteur d'offre (recruteur) --- */
.offer-picker { margin-bottom: 10px; }
.offer-picker label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
select, input, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font: inherit; color: var(--ink);
}
textarea { resize: vertical; }

/* --- Pile de cartes --- */
.deck-info { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.deck { position: relative; height: clamp(460px, calc(100vh - 250px), 600px); }
.card {
  position: absolute; inset: 0; background: var(--card); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(20, 33, 61, .12); padding: 18px;
  overflow: hidden; touch-action: none; user-select: none;
  transition: transform .26s ease, opacity .26s ease;
  display: flex; flex-direction: column; gap: 9px; cursor: grab;
}
.card.under { transform: scale(.95) translateY(14px); opacity: .6; pointer-events: none; }
.card.dragging { transition: none; cursor: grabbing; }
.card.fly-right { transform: translateX(140%) rotate(18deg) !important; opacity: 0; }
.card.fly-left  { transform: translateX(-140%) rotate(-18deg) !important; opacity: 0; }

.stamp {
  position: absolute; top: 80px; padding: 4px 10px; border: 3px solid; border-radius: 8px;
  font-weight: 800; letter-spacing: 1px; pointer-events: none; background: rgba(255,255,255,.85);
}
.stamp.like { left: 18px; color: var(--ok); transform: rotate(-12deg); opacity: var(--like, 0); }
.stamp.pass { right: 18px; color: var(--bad); transform: rotate(12deg); opacity: var(--pass, 0); }

.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tag {
  background: var(--orange-soft); color: #9a4d00; font-size: 12px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
}
.card h2 { margin: 2px 0 0; font-size: 20px; line-height: 1.25; color: var(--navy); }
.org { margin: 0; color: var(--muted); font-size: 14px; }
.facts {
  list-style: none; padding: 0; margin: 4px 0; display: grid;
  grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13px;
}
.facts li { background: #f5f7fa; border-radius: 8px; padding: 6px 8px; }
.desc {
  margin: 0; font-size: 14px; line-height: 1.45; color: #344054;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tutor, .skills { margin: 0; font-size: 13px; color: #344054; }
.tutor { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); }

/* Anneau de score */
.ring {
  --p: 0; width: 54px; height: 54px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--orange) calc(var(--p) * 1%), #e9edf3 0);
  display: grid; place-items: center;
}
.ring b {
  width: 42px; height: 42px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; font-size: 13px; color: var(--navy);
}

/* Puces */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 10px; font-size: 12.5px; color: #344054;
}
.chip.hit { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips.pick .chip { cursor: pointer; }
.chips.pick .chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Boutons d'action */
.actions { display: flex; justify-content: center; gap: 28px; margin-top: 18px; }
.round {
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 26px; background: #fff; box-shadow: 0 6px 18px rgba(20, 33, 61, .15);
  transition: transform .12s;
}
.round:active { transform: scale(.92); }
.round.pass { color: var(--bad); }
.round.like { color: #fff; background: var(--orange); }

.btn {
  border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 700; cursor: pointer;
}
.btn.primary { background: var(--orange); color: #fff; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.small { padding: 7px 10px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 8px; }

/* États vides */
.empty {
  background: #fff; border-radius: var(--radius); padding: 24px; text-align: center;
  box-shadow: 0 6px 20px rgba(20, 33, 61, .06);
}
.empty h3 { margin: 0 0 6px; color: var(--navy); }
.empty p { color: var(--muted); }
.why { text-align: left; font-size: 14px; padding-left: 18px; color: #344054; }
.why li { margin: 4px 0; }

/* Matchs */
.section { color: var(--navy); font-size: 18px; margin: 4px 0 12px; }
.matches { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.matches li {
  background: #fff; border-radius: 14px; padding: 12px; display: flex; gap: 12px; align-items: center;
  cursor: pointer; box-shadow: 0 3px 12px rgba(20, 33, 61, .06);
}
.matches li > div { flex: 1; min-width: 0; }
.matches small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matches .last { color: #344054; font-style: italic; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.mail { text-decoration: none; font-size: 20px; color: var(--navy); }
.pending { color: var(--muted); font-size: 13px; text-align: center; margin-top: 16px; }

/* Messagerie */
.chat { display: flex; flex-direction: column; height: calc(100vh - 190px); }
.chat-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.chat-head small { display: block; color: var(--muted); font-size: 12px; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.msg {
  max-width: 78%; background: #fff; padding: 9px 12px; border-radius: 14px 14px 14px 4px;
  font-size: 14px; box-shadow: 0 2px 6px rgba(20, 33, 61, .06);
}
.msg.me { align-self: flex-end; background: var(--navy); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg time { display: block; font-size: 11px; opacity: .6; margin-top: 3px; }
.hint { color: var(--muted); text-align: center; font-size: 14px; }
.composer { display: flex; gap: 8px; margin-top: 8px; }

/* Formulaires */
.form { display: grid; gap: 12px; background: #fff; padding: 16px; border-radius: var(--radius); }
.form h2 { margin: 0; color: var(--navy); font-size: 18px; }
.form label { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.form legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 6px; }
.form legend small { opacity: .8; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; background: #f0f2f6; border-radius: 10px; padding: 3px; }
.seg button {
  flex: 1; border: 0; background: none; padding: 8px 4px; border-radius: 8px;
  cursor: pointer; font-size: 13px; color: #344054;
}
.seg button.on { background: #fff; color: var(--navy); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.live {
  background: var(--orange-soft); color: #7a3d00; border-radius: 10px; padding: 10px 12px; font-size: 14px;
}
.offer-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.offer-tabs .chip { cursor: pointer; }
.offer-tabs .chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }
.foot button { border: 0; background: none; color: var(--navy); text-decoration: underline; cursor: pointer; font-size: 12px; }

/* Fenêtre de match */
.modal {
  position: fixed; inset: 0; background: rgba(20, 33, 61, .65); z-index: 20;
  display: grid; place-items: center; padding: 20px;
}
.modal.hidden, .toast.hidden { display: none; }
.match-pop {
  background: #fff; border-radius: 22px; padding: 26px 22px; max-width: 380px; text-align: center;
  animation: pop .3s ease;
}
.match-pop h2 { color: var(--orange); margin: 4px 0 8px; font-size: 26px; }
.match-pop .spark { font-size: 40px; }
.match-pop .contact { background: #f5f7fa; border-radius: 10px; padding: 10px; font-size: 14px; }
.match-pop .row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 30;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
}

/* CV */
.cv-line { margin: 0; font-size: 13px; }
.muted { color: var(--muted); }
.cv-status { margin: 0; font-size: 13.5px; color: #344054; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font-size: 13px; }
button.mail { border: 0; background: none; cursor: pointer; padding: 0; }
input[type=file] { padding: 8px; font-size: 13px; }

/* Le pilote affiche uniquement la connexion tant que le compte est absent. */
.tabbar.hidden { display: none; }
.form input[type="checkbox"] { width: auto; }
