/* LANSLO Studio — charte : Nuit d'Anjou, Rouille, Canvas. Mobile d'abord. */

:root {
  --nuit:    #0F2526;
  --nuit-2:  #163334;
  --nuit-3:  #1E4142;
  --rouille: #B7410E;
  --rouille-clair: #D65A24;
  --canvas:  #FFF5ED;
  --canvas-2:#F2E4D8;
  --gris:    #8FA3A4;
  --vert:    #2E8B6F;
  --rouge:   #C0392B;
  --ambre:   #C8860D;

  --bg:      var(--nuit);
  --surface: var(--nuit-2);
  --surface-2: var(--nuit-3);
  --texte:   var(--canvas);
  --texte-2: var(--gris);
  --bord:    rgba(255,245,237,.12);

  --r:  14px;
  --r-s: 9px;
  --pad: 18px;
  --max: 1180px;
  --ombre: 0 8px 28px rgba(0,0,0,.32);
}

:root[data-theme="light"] {
  --bg:      var(--canvas);
  --surface: #fff;
  --surface-2: var(--canvas-2);
  --texte:   var(--nuit);
  --texte-2: #5C7071;
  --bord:    rgba(15,37,38,.14);
  --ombre: 0 8px 28px rgba(15,37,38,.10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--texte);
  font-family: Lexend, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Titan One", Lexend, system-ui, sans-serif; font-weight: 400; letter-spacing: .2px; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.02rem; }
p  { margin: 0 0 1em; }
a  { color: var(--rouille-clair); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .88em; }

/* ------------------------------------------------ mise en page */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
}
.topbar-in {
  max-width: var(--max); margin: 0 auto; padding: 10px var(--pad);
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texte); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--rouille), var(--rouille-clair));
  box-shadow: inset 0 0 0 2px rgba(255,245,237,.18);
}
.brand-name { font-family: "Titan One", Lexend, sans-serif; font-size: 1.02rem; }
.brand-sub { color: var(--texte-2); font-size: .76rem; display: none; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a, .nav button {
  color: var(--texte-2); text-decoration: none; font-size: .88rem;
  padding: 8px 11px; border-radius: var(--r-s); border: 0; background: transparent;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.nav a:hover, .nav button:hover { background: var(--surface); color: var(--texte); }
.nav a.on { background: var(--rouille); color: #fff; }

.main { flex: 1; max-width: var(--max); width: 100%; margin: 0 auto; padding: var(--pad); }

/* ------------------------------------------------ éléments */
.card {
  background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--r); padding: var(--pad); margin-bottom: 16px;
}
.card-tight { padding: 13px 15px; }
.card h2 { margin-bottom: .55em; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .brand-sub { display: block; }
  h1 { font-size: 1.9rem; }
}

.lede { color: var(--texte-2); }
.muted { color: var(--texte-2); font-size: .88rem; }
.hint { color: var(--texte-2); font-size: .82rem; margin: -4px 0 14px; }

/* statistiques */
.stat { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r); padding: 14px; }
.stat .v { font-family: "Titan One", Lexend, sans-serif; font-size: 1.75rem; line-height: 1.1; }
.stat .k { color: var(--texte-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.stat.accent .v { color: var(--rouille-clair); }

/* boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--r-s); border: 1px solid transparent;
  font-family: inherit; font-size: .93rem; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: filter .15s, background .15s; min-height: 46px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--rouille); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--surface-2); color: var(--texte); border-color: var(--bord); }
.btn-secondary:hover { background: var(--bord); }
.btn-ghost { background: transparent; color: var(--texte-2); border-color: var(--bord); }
.btn-danger { background: transparent; color: var(--rouge); border-color: color-mix(in srgb, var(--rouge) 45%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--rouge) 14%, transparent); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; min-height: 36px; font-size: .84rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-end { justify-content: flex-end; }
.spacer { flex: 1; }

/* formulaires */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .84rem; color: var(--texte-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 12px 13px; font-family: inherit; font-size: 1rem;
  background: var(--bg); color: var(--texte);
  border: 1px solid var(--bord); border-radius: var(--r-s); outline: none;
}
:root[data-theme="light"] input, :root[data-theme="light"] select, :root[data-theme="light"] textarea { background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--rouille); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rouille) 22%, transparent); }
textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.field-inline { display: flex; gap: 10px; align-items: center; }

/* alertes */
.alert { border-radius: var(--r-s); padding: 12px 14px; margin-bottom: 14px; font-size: .92rem; border: 1px solid; }
.alert-ok   { background: color-mix(in srgb, var(--vert) 14%, transparent);   border-color: color-mix(in srgb, var(--vert) 45%, transparent); }
.alert-err  { background: color-mix(in srgb, var(--rouge) 14%, transparent);  border-color: color-mix(in srgb, var(--rouge) 45%, transparent); }
.alert-warn { background: color-mix(in srgb, var(--ambre) 15%, transparent);  border-color: color-mix(in srgb, var(--ambre) 48%, transparent); }
.alert-info { background: color-mix(in srgb, var(--rouille) 12%, transparent);border-color: color-mix(in srgb, var(--rouille) 42%, transparent); }

/* badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .74rem; border: 1px solid var(--bord); color: var(--texte-2); }
.badge-ok   { background: color-mix(in srgb, var(--vert) 20%, transparent);  color: var(--texte); border-color: transparent; }
.badge-warn { background: color-mix(in srgb, var(--ambre) 22%, transparent); color: var(--texte); border-color: transparent; }
.badge-err  { background: color-mix(in srgb, var(--rouge) 22%, transparent); color: var(--texte); border-color: transparent; }

/* tableaux */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: top; }
th { color: var(--texte-2); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
tbody tr:hover { background: color-mix(in srgb, var(--rouille) 6%, transparent); }

/* connexion et installation */
.auth-body { display: flex; align-items: center; justify-content: center; padding: 22px; min-height: 100vh; }
.auth-card { width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r); padding: 28px; box-shadow: var(--ombre); }
.auth-card .brand { margin-bottom: 22px; }

/* choix de persona */
.persona-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .persona-grid { grid-template-columns: repeat(3, 1fr); } }
.persona-card {
  position: relative; border: 2px solid var(--bord); border-radius: var(--r);
  overflow: hidden; background: var(--surface); cursor: pointer; text-align: left;
  padding: 0; font-family: inherit; color: var(--texte); transition: border-color .15s, transform .15s;
}
.persona-card:hover { transform: translateY(-2px); }
.persona-card.on { border-color: var(--rouille); }
.persona-card img { width: 100%; height: 168px; object-fit: cover; display: block; background: var(--surface-2); }
.persona-body { padding: 13px 15px 16px; }
.persona-body .n { font-family: "Titan One", Lexend, sans-serif; font-size: 1.1rem; }
.persona-body .t { color: var(--rouille-clair); font-size: .82rem; margin-bottom: 8px; }
.persona-body .meta { color: var(--texte-2); font-size: .8rem; line-height: 1.45; }
.persona-body .q { font-style: italic; font-size: .85rem; margin-top: 9px; padding-left: 10px; border-left: 2px solid var(--rouille); }

/* déroulé de l'entretien */
.wizard-head { position: sticky; top: 53px; z-index: 30; background: var(--bg); padding: 12px 0 10px; border-bottom: 1px solid var(--bord); margin-bottom: 16px; }
.progress { height: 5px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--rouille), var(--rouille-clair)); transition: width .28s ease; }
.step-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; font-size: .82rem; color: var(--texte-2); }
.step-no { background: var(--rouille); color: #fff; padding: 2px 10px; border-radius: 999px; font-size: .76rem; }

.q-title { font-size: 1.22rem; line-height: 1.4; margin: 4px 0 14px; }
@media (min-width: 720px) { .q-title { font-size: 1.4rem; } }
.q-help { display: grid; gap: 8px; margin-top: 14px; }
.q-help .h { background: var(--surface-2); border-radius: var(--r-s); padding: 10px 12px; font-size: .84rem; color: var(--texte-2); }
.q-help .h b { color: var(--texte); font-weight: 500; }

.wizard-nav { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--bord); padding: 12px 0; margin-top: 18px; display: flex; gap: 10px; }
.wizard-nav .btn { flex: 1; }

/* configuration des modules */
.mod-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .mod-grid { grid-template-columns: 1fr 1fr; } }
.mod {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px;
  border: 2px solid var(--bord); border-radius: var(--r-s); cursor: pointer; background: var(--surface);
}
.mod.on { border-color: var(--rouille); background: color-mix(in srgb, var(--rouille) 10%, var(--surface)); }
.mod input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--rouille); flex: 0 0 auto; }
.mod .n { font-weight: 500; }
.mod .p { color: var(--rouille-clair); font-family: "Titan One", Lexend, sans-serif; }
.mod .u { color: var(--texte-2); font-size: .82rem; }
.total-bar { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; padding: 13px 15px; background: var(--surface-2); border-radius: var(--r-s); }
.total-bar .v { font-family: "Titan One", Lexend, sans-serif; font-size: 1.5rem; color: var(--rouille-clair); }

/* enregistrement */
.rec-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--gris); flex: 0 0 auto; }
.rec-dot.live { background: var(--rouge); animation: pulse 1.15s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.rec-time { font-family: "Titan One", Lexend, monospace; font-size: 1.15rem; }
video.preview, video.playback { width: 100%; max-height: 260px; border-radius: var(--r-s); background: #000; margin-top: 10px; }
audio.playback { width: 100%; margin-top: 10px; }

/* état de sauvegarde */
.save-state { font-size: .78rem; color: var(--texte-2); display: flex; align-items: center; gap: 6px; }
.save-state .d { width: 7px; height: 7px; border-radius: 50%; background: var(--vert); }
.save-state.pending .d { background: var(--ambre); }
.save-state.error .d { background: var(--rouge); }

/* onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 11px 15px; border: 0; background: transparent; color: var(--texte-2); cursor: pointer; font-family: inherit; font-size: .92rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--texte); border-bottom-color: var(--rouille); }

/* éditeur */
.editor-row { border: 1px solid var(--bord); border-radius: var(--r-s); margin-bottom: 10px; background: var(--surface); }
.editor-head { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; }
.editor-head .grab { color: var(--texte-2); cursor: grab; font-size: 1.1rem; user-select: none; }
.editor-head .no { background: var(--surface-2); border-radius: 6px; padding: 2px 8px; font-size: .78rem; color: var(--texte-2); }
.editor-head .ti { flex: 1; font-size: .92rem; }
.editor-body { padding: 0 13px 13px; display: none; }
.editor-row.open .editor-body { display: block; }
.editor-row.drag { opacity: .45; }

/* messages passagers */
.toast-zone { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--nuit-3); color: var(--canvas); border: 1px solid var(--bord); border-radius: var(--r-s); padding: 11px 17px; box-shadow: var(--ombre); font-size: .9rem; animation: rise .2s ease; max-width: 90vw; }
.toast.err { border-color: color-mix(in srgb, var(--rouge) 60%, transparent); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

@media print {
  .topbar, .wizard-nav, .nav, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
