/* ============================================================
   PartagePass – charte Cristal'ID
   Orange #fc941d · Bleu nuit #20456a · Fond #fffffd / #f5f9ff
   Polices Inter + Outfit (auto-hébergées)
   ============================================================ */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(assets/inter-latin.woff2) format('woff2'); }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 600 800; font-display: swap; src: url(assets/outfit-latin.woff2) format('woff2'); }

:root {
  --fond: #fffffd;
  --fond2: #f5f9ff;
  --text: #1f2933;
  --muted: #5d6b7a;
  --orange: #fc941d;
  --orange-dark: #e07f0a;
  --orange-light: #fff1de;
  --navy: #20456a;
  --navy-dark: #162f49;
  --footer: #2c3e50;
  --line: #dde5ee;
  --ok: #1f9d55;
  --err: #d64545;
  --radius: 7px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(32, 69, 106, .06);
  --shadow-md: 0 8px 24px rgba(32, 69, 106, .10);
  --shadow-lg: 0 16px 48px rgba(32, 69, 106, .14);
  --shadow-orange: 0 8px 24px rgba(252, 148, 29, .30);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-title: 'Outfit', 'Inter', sans-serif;
  --mono: 'Cascadia Code', Consolas, 'Courier New', monospace;
  --ease: cubic-bezier(.25, .8, .25, 1);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); color: var(--text); line-height: 1.6; overflow-x: hidden;
  background:
    radial-gradient(900px 420px at 85% -80px, rgba(252, 148, 29, .13), transparent 70%),
    radial-gradient(800px 460px at -10% 20%, rgba(32, 69, 106, .08), transparent 70%),
    var(--fond2);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
.aura { display: none; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 253, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm);
  padding: 12px max(20px, calc((100% - 1100px) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--navy); }
.brand-logo { display: block; height: 40px; width: auto; }
.brand-name { font-family: var(--font-title); font-weight: 700; font-size: 1.15rem; padding-left: 14px; border-left: 2px solid var(--orange); line-height: 1.1; }
.brand-name b { color: var(--orange); font-weight: 800; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.badge {
  font-size: .78rem; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: var(--orange-light); color: var(--orange-dark); white-space: nowrap;
}

/* ---------- Mise en page ---------- */
.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 36px 20px 48px; display: grid; gap: 24px; flex: 1; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 36px; box-shadow: var(--shadow-md); animation: rise .5s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.hero { text-align: center; margin-bottom: 28px; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--orange-dark); background: var(--orange-light); padding: 5px 14px; border-radius: 999px; margin-bottom: 14px;
}
.hero h2, .h3 { font-family: var(--font-title); color: var(--navy); }
.hero h2 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 700; }
.grad { color: var(--orange); }
.lead { color: var(--muted); margin: 0 auto; max-width: 540px; }
.h3 { font-size: 1.2rem; margin: 0 0 14px; font-weight: 700; }

/* ---------- Raccourcis CRM ---------- */
.presets { margin: 0 0 22px; padding: 14px 16px; background: var(--fond2); border: 1px dashed var(--line); border-radius: var(--radius); }
.presets-title { font-size: .8rem; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--navy); background: #fff; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; transition: all .25s var(--ease);
}
.chip:hover, .chip.active { border-color: var(--orange); background: var(--orange-light); color: var(--orange-dark); transform: translateY(-1px); }
.crm-note { display: flex; gap: 10px; align-items: center; margin: 0 0 18px; padding: 10px 14px; font-size: .86rem; border-radius: var(--radius); background: #eaf2fb; color: var(--navy); border: 1px solid #cfe0f2; }

/* ---------- Formulaire ---------- */
.field { margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
label, legend { display: block; font-size: .88rem; font-weight: 600; color: var(--navy); margin-bottom: 8px; padding: 0; }
.opt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row label { margin-bottom: 8px; }
.actions { display: flex; gap: 14px; }
.link-btn { background: none; border: 0; color: var(--orange-dark); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; padding: 0; transition: color .2s; }
.link-btn:hover { color: var(--navy); text-decoration: underline; }
.link-btn.danger { color: var(--err); }

input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: #fff;
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: #9aa7b5; }
textarea { resize: vertical; min-height: 88px; font-family: var(--mono); font-size: .92rem; }
input:focus, textarea:focus, select:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(252, 148, 29, .16); }
input[readonly] { background: var(--fond2); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.masked { -webkit-text-security: disc; text-security: disc; font-family: var(--mono); }
.hint { margin-top: 6px; font-size: .78rem; color: var(--muted); }
.center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; } .card { padding: 24px 20px; }
  .badge { display: none; } .brand-name { font-size: 1rem; }
}

/* Sélecteur segmenté */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .seg { grid-template-columns: 1fr; } }
.seg-item { position: relative; margin: 0; cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; }
.seg-item span {
  display: flex; flex-direction: column; gap: 2px; padding: 13px 16px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: #fff; transition: all .25s var(--ease); font-size: .92rem; color: var(--navy);
}
.seg-item small { color: var(--muted); font-size: .76rem; font-weight: 400; }
.seg-item:hover span { border-color: var(--orange); transform: translateY(-1px); }
.seg-item input:checked + span { border-color: var(--orange); background: var(--orange-light); box-shadow: 0 0 0 3px rgba(252, 148, 29, .15); }
.seg-item input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Force de la phrase de passe */
.strength { height: 5px; margin-top: 8px; border-radius: 3px; background: var(--line); overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .3s, background .3s; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .95rem; padding: 13px 24px; border-radius: var(--radius);
  border: 1.5px solid transparent; text-decoration: none; color: #fff; transition: all .3s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); box-shadow: 0 4px 14px rgba(252, 148, 29, .25); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(252, 148, 29, .38), 0 0 0 4px rgba(252, 148, 29, .12); filter: brightness(1.05); }
#create-btn, #reveal-btn, #btn-create-req, #btn-client-submit { width: 100%; padding: 15px; font-size: 1.02rem; }
#create-btn svg, #btn-create-req svg, #btn-client-submit svg { transition: transform .25s; }
#create-btn:hover svg, #btn-create-req:hover svg, #btn-client-submit:hover svg { transform: translateX(4px); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); background: var(--fond2); transform: translateY(-2px); }
.btn-ghost.btn-danger { color: var(--err); border-color: #f3c3c3; }
.btn-ghost.btn-danger:hover { background: #fdeeee; border-color: var(--err); color: var(--err); }
.copy-row { display: flex; gap: 10px; }
.copy-row input { font-family: var(--mono); font-size: .82rem; }
.actions-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; justify-content: center; }

/* ---------- Alertes ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: .88rem; margin-bottom: 16px; border: 1px solid; }
.alert-error { background: #fdeeee; border-color: #f3c3c3; color: #9b2c2c; }
.alert-info { background: #eaf2fb; border-color: #cfe0f2; color: var(--navy); margin: 0; }
.alert-ok { background: #e8f7ee; border-color: #b9e4c9; color: #176b3b; }
#recv-form .alert-info { margin-bottom: 16px; }

/* ---------- Icônes ---------- */
.success-icon, .lock-icon { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; }
.success-icon { background: #e8f7ee; border: 2px solid var(--ok); color: var(--ok); animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; font-weight: 700; }
.lock-icon { background: var(--orange-light); border: 2px solid var(--orange); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }

/* ---------- Réception ---------- */
.secret-box { background: var(--navy); border-radius: var(--radius-lg); padding: 22px; margin: 14px 0; box-shadow: var(--shadow-md); border-left: 5px solid var(--orange); }
.secret-text { font-family: var(--mono); font-size: 1.05rem; color: #fff; word-break: break-all; white-space: pre-wrap; user-select: none; }
.secret-text[data-masked="false"] { user-select: text; color: #ffd8a0; }
.meta { font-size: .86rem; color: var(--muted); text-align: center; }
.meta b { color: var(--navy); font-family: var(--font-title); font-size: 1.1rem; }
.link { color: var(--orange-dark); text-decoration: none; font-size: .9rem; font-weight: 600; }
.link:hover { text-decoration: underline; }
#recv-result { animation: rise .4s both; }

/* ---------- Mes envois ---------- */
.sent-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.sent-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--fond2); font-size: .9rem; color: var(--navy); }
.sent-list small { color: var(--muted); }
.sent-actions { display: flex; gap: 14px; flex-shrink: 0; }

/* ---------- Infos ---------- */
.info { padding: 28px 36px; box-shadow: var(--shadow-sm); }
.steps { margin: 0 0 14px; padding-left: 20px; color: var(--muted); font-size: .92rem; }
.steps li { margin-bottom: 6px; }
.steps b { color: var(--navy); }
code { font-family: var(--mono); background: var(--fond2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-size: .85em; color: var(--navy); }
details { font-size: .9rem; color: var(--muted); }
summary { cursor: pointer; color: var(--navy); font-weight: 600; }
details ul { padding-left: 20px; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--footer); color: #cfd8e3; text-align: center; font-size: .85rem; padding: 22px 20px; border-top: 4px solid var(--orange); }
.site-footer a { color: #fff; font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: var(--orange); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; z-index: 10;
  background: var(--navy); color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: .88rem; box-shadow: var(--shadow-lg); transition: all .3s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Case a cocher (envoi direct) */
.check { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; font-weight: 500; font-size: .84rem; cursor: pointer; }
.check input { width: auto; margin-top: 3px; accent-color: var(--orange); }
.hint.warn { color: #9a5b00; background: var(--orange-light); border-radius: var(--radius); padding: 8px 10px; }

/* Liens utiles (page de reception) */
.links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 22px 0 6px; padding-top: 20px; border-top: 1px solid var(--line); }
.links-title { width: 100%; text-align: center; font-family: var(--font-title); font-weight: 700; color: var(--navy); }

/* ---------- Navigation par onglets ---------- */
.nav-tabs {
  display: flex; gap: 8px; justify-content: center; margin: 0 auto 12px;
  background: rgba(32, 69, 106, .06); padding: 5px; border-radius: 999px;
  max-width: fit-content; border: 1px solid var(--line);
}
.nav-tab {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: .92rem; font-weight: 700; color: var(--muted);
  background: transparent; border: none; border-radius: 999px;
  padding: 9px 22px; cursor: pointer; transition: all .25s var(--ease);
}
.nav-tab:hover { color: var(--navy); }
.nav-tab.active {
  background: #fff; color: var(--orange-dark); box-shadow: var(--shadow-sm);
}
.nav-tab.active svg { stroke: var(--orange); }

/* ---------- Éditeur de champs dynamiques ---------- */
.field-list { display: grid; gap: 10px; margin-bottom: 12px; }
.field-row {
  display: flex; gap: 10px; align-items: center; background: var(--fond2);
  border: 1px solid var(--line); padding: 8px 12px; border-radius: var(--radius);
}
.field-row input[type="text"] {
  flex: 1; min-width: 140px; padding: 8px 12px; font-size: .9rem;
}
.field-type-toggle {
  display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600;
  color: var(--muted); cursor: pointer; white-space: nowrap; user-select: none;
}
.field-type-toggle input { accent-color: var(--orange); }
.btn-icon-del {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  padding: 6px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  transition: all .2s var(--ease);
}
.btn-icon-del:hover { color: var(--err); background: #fde8e8; }
.btn-add-field {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .85rem;
  font-weight: 600; color: var(--navy); background: #fff; border: 1px dashed var(--line);
  padding: 8px 14px; border-radius: var(--radius); cursor: pointer; transition: all .2s var(--ease);
}
.btn-add-field:hover { border-color: var(--orange); color: var(--orange-dark); background: var(--orange-light); }

/* ---------- Cartes de réponses reçues (propriétaire) ---------- */
.subs-list { display: grid; gap: 16px; margin: 20px 0; }
.sub-card {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--orange);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.sub-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; font-size: .86rem; color: var(--muted);
}
.sub-contact { font-weight: 700; color: var(--navy); font-size: .95rem; }
.sub-items { display: grid; gap: 10px; }
.sub-item {
  display: flex; flex-direction: column; gap: 4px; background: var(--fond2);
  padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line);
}
.sub-item-header { display: flex; justify-content: space-between; align-items: center; }
.sub-item-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sub-item-actions { display: flex; gap: 8px; }
.sub-item-val {
  font-family: var(--mono); font-size: .96rem; color: var(--navy); word-break: break-all;
  white-space: pre-wrap; padding: 2px 0;
}
.sub-item-val.masked { letter-spacing: 2px; }

/* Sub-onglets pour la section historique */
.history-tabs { display: flex; gap: 10px; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.history-tab {
  font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); background: none;
  border: none; cursor: pointer; padding: 4px 10px; border-radius: var(--radius); transition: all .2s var(--ease);
}
.history-tab:hover { color: var(--navy); }
.history-tab.active { color: var(--orange-dark); font-weight: 700; background: var(--orange-light); }
