/* welcome · espace hébergeur, console Visite Plus Médias et installateur */
@import url("fonts.css");
:root {
  --cream: #fff4e6; --paper: #ffffff;
  --orange: #e1592e; --orange-deep: #c2461f; --yellow: #f7b537; --yellow-soft: #fde4b0; --peach: #fbe1cf;
  --ink: #3b2416; --muted: #6e4c3b; --line: #efdcc4; --field: #e3cdb3;
  --ok: #1d6b40; --ok-soft: #dff3e7; --warn: #7a4b00; --warn-soft: #fdecc8; --err: #a3301f; --err-soft: #fbe3de;
  --display: "Fredoka", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--body); color: var(--ink); background: var(--cream); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.005em; margin: 0; text-wrap: balance; line-height: 1.2; }
a { color: var(--orange-deep); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
code { font: 700 13px ui-monospace, Menlo, monospace; background: var(--cream); border: 1px solid var(--line); padding: 1px 7px; border-radius: 8px; }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }
.disc-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: inline-grid; place-items: center; flex-shrink: 0; }
.disc-ico.sm { width: 28px; height: 28px; } .disc-ico.sm .ico { width: 15px; height: 15px; }
.with-ico { display: inline-flex; align-items: center; gap: 10px; }

/* Barre du haut */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--paper); box-shadow: 0 1px 0 var(--line); }
.topbar .tb-logo { height: 28px; width: auto; }
.topbar .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar .space { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; background: var(--yellow-soft); color: var(--ink); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
body.admin .topbar .space { background: var(--ink); color: #fff; }
.topbar b { font-family: var(--display); font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar a, .topbar button { color: var(--orange-deep); background: var(--cream); border: 0; border-radius: 999px; padding: 8px 14px; font: 800 13px var(--body); text-decoration: none; cursor: pointer; white-space: nowrap; }
@media (max-width: 640px) { .topbar { flex-wrap: wrap; gap: 8px; } .topbar .who { flex-basis: 100%; order: 3; } .topbar .tb-logo { margin-right: auto; height: 24px; } .topbar a, .topbar button { padding: 7px 11px; font-size: 12.5px; } }

/* Onglets */
.layout { max-width: 1120px; margin: 0 auto; padding: 20px 16px 120px; display: grid; gap: 20px; }
@media (min-width: 900px) { .layout { grid-template-columns: 220px minmax(0, 1fr); align-items: start; } .tabs { position: sticky; top: 80px; flex-direction: column; } }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; text-align: left; padding: 10px 14px; border-radius: 999px; font: 800 14px var(--body); color: var(--muted); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.tabs button::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.tabs button[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.tabs button[aria-current="page"]::before { background: var(--orange); box-shadow: 6px 0 0 var(--yellow); margin-right: 6px; }
.content { min-width: 0; display: grid; gap: 16px; }

/* Cartes et formulaires */
.card { background: var(--paper); border-radius: 22px; padding: 20px; min-width: 0; box-shadow: 0 1px 0 var(--line); }
.card > h2 { font-size: 21px; margin-bottom: 4px; }
.card > .help, .help { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; margin-top: 12px; min-width: 0; }
.field > span, label.lbl, .lbl { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.field label span { font-size: 13.5px; font-weight: 800; }
.field .count { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.field .fr-hint { font-size: 12.5px; color: var(--muted); background: var(--cream); border-radius: 10px; padding: 7px 10px; white-space: pre-line; }
input, select, textarea { font: 600 15px var(--body); color: var(--ink); background: #fff; border: 2px solid var(--field); border-radius: 14px; padding: 10px 13px; width: 100%; min-width: 0; }
textarea { resize: vertical; min-height: 88px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); }
label.check { display: flex; gap: 10px; align-items: center; font-size: 14.5px; font-weight: 700; margin-top: 12px; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--orange-deep); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--cream); color: var(--orange-deep); border-radius: 999px; padding: 10px 16px; font: 800 14px var(--body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--orange-deep); color: #fff; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.danger { color: var(--err); background: var(--err-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.seg { display: inline-flex; background: var(--cream); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; font: 800 12.5px var(--body); padding: 7px 12px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--orange-deep); color: #fff; }

/* Listes éditables */
.item { border-radius: 18px; padding: 16px; margin-top: 12px; background: #fffaf3; box-shadow: inset 0 0 0 2px var(--line); }
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item-head b { font-family: var(--display); font-weight: 600; font-size: 16px; }
.item-tools { display: flex; gap: 4px; }
.icon-btn { border: 0; background: var(--paper); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font: 800 14px var(--body); color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); }
.icon-btn:hover { color: var(--orange-deep); }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; margin-top: 10px; }
.photo { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--peach); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .tools { position: absolute; inset: auto 6px 6px 6px; display: flex; justify-content: space-between; gap: 4px; }
.photo .tools button { border: 0; background: rgba(59, 36, 22, .78); color: #fff; border-radius: 999px; font: 800 12px var(--body); padding: 4px 9px; cursor: pointer; }
.add-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 4 / 3; border: 2px dashed var(--orange); border-radius: 16px; color: var(--orange-deep); font-size: 13px; font-weight: 800; cursor: pointer; text-align: center; padding: 6px; background: #fffaf3; }
.add-photo input { display: none; }
.add-photo .plus { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-size: 22px; line-height: 1; }

/* Tableaux */
.table-wrap { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 11px 8px; border-bottom: 1px solid #f6e9d8; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.err { background: var(--err-soft); color: var(--err); }
.tag.mute { background: #f3eadf; color: var(--muted); }
.tag.prem { background: var(--yellow); color: var(--ink); }
.tag.std { background: var(--peach); color: var(--orange-deep); }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--paper); border-radius: 22px; padding: 16px 18px; position: relative; overflow: hidden; box-shadow: 0 1px 0 var(--line); }
.kpi::after { content: ""; position: absolute; right: -22px; top: -22px; width: 64px; height: 64px; border-radius: 50%; background: var(--yellow-soft); }
.kpi:nth-child(2n)::after { background: var(--peach); }
.kpi small { color: var(--muted); font-size: 13px; font-weight: 700; position: relative; z-index: 1; display: block; padding-right: 30px; }
.kpi b { display: block; font: 600 32px var(--display); margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--orange-deep); position: relative; z-index: 1; }
.kpi span { font-size: 12.5px; color: var(--muted); position: relative; z-index: 1; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; margin-top: 14px; border-bottom: 2px solid var(--line); }
.bars div { flex: 1; background: var(--orange); border-radius: 6px 6px 0 0; min-height: 2px; }
.bars div:last-child { background: var(--yellow); }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 700; }
.lang-row { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; margin-top: 10px; }
.lang-row i { display: block; height: 12px; border-radius: 999px; background: var(--orange); }
.lang-row .tr { background: var(--cream); border-radius: 999px; overflow: hidden; }
.lang-row .pc { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }

/* Messages */
.notice { border-radius: 16px; padding: 13px 16px; font-size: 14.5px; line-height: 1.5; }
.notice p { margin: 0 0 4px; } .notice p:last-child { margin: 0; }
.notice.ok { background: var(--ok-soft); color: #164d31; }
.notice.warn { background: var(--warn-soft); color: #5f3b00; }
.notice.err { background: var(--err-soft); color: var(--err); }
.alerts { display: grid; gap: 8px; }

/* Barre d'enregistrement */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--paper); box-shadow: 0 -6px 24px rgba(59, 36, 22, .1); border-radius: 22px 22px 0 0; }
.savebar .in { width: 100%; max-width: 1120px; display: flex; align-items: center; gap: 10px; }
.savebar .msg { flex: 1; font-size: 14.5px; font-weight: 800; color: var(--orange-deep); display: flex; align-items: center; gap: 8px; }
.savebar .msg::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); flex-shrink: 0; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login::before { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; background: var(--orange); left: -120px; bottom: -110px; }
.login::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: var(--yellow); right: -60px; top: -50px; }
.login .card { width: 100%; max-width: 400px; position: relative; z-index: 1; padding: 26px; box-shadow: 0 20px 50px rgba(59, 36, 22, .12); }
.login .lg-logo { height: 40px; width: auto; display: block; margin-bottom: 18px; }
.login h1 { font-size: 26px; margin-bottom: 4px; }
.login .brand { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--orange-deep); margin-bottom: 6px; }
.login .btn.primary { width: 100%; margin-top: 18px; padding: 13px; font-size: 15px; }

/* Fenêtres */
dialog { border: 0; border-radius: 24px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 60px rgba(59, 36, 22, .3); color: var(--ink); }
dialog::backdrop { background: rgba(59, 36, 22, .45); }
dialog .dlg { padding: 22px; display: grid; gap: 12px; }
dialog .dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
dialog h2 { font-size: 21px; }
.qr-box { display: grid; place-items: center; gap: 10px; padding: 12px; background: var(--paper); }
.qr-box img { width: 240px; height: 240px; image-rendering: pixelated; border-radius: 12px; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(16px); background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; padding: 11px 18px; border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.demo-ribbon { background: var(--yellow-soft); color: var(--ink); text-align: center; font-size: 13px; font-weight: 700; padding: 7px 12px; }

/* Installateur et accueil du site */
.install-wrap { max-width: 660px; margin: 0 auto; padding: 32px 16px 60px; display: grid; gap: 16px; }
.install-wrap h1 { font-size: 30px; color: var(--orange); }
.install-wrap h2 { font-size: 19px; margin-top: 18px; }
.install-wrap .form label { display: block; font-size: 13.5px; font-weight: 800; margin: 12px 0 6px; }
.install-wrap .btn.primary { margin-top: 20px; }
.install-logo { height: 44px; width: auto; }
.checks { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 14.5px; font-weight: 700; }
.checks .ok { color: var(--ok); } .checks .ko { color: var(--err); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.card h3.sub { font-size: 17px; margin: 22px 0 2px; padding-top: 16px; border-top: 2px dotted var(--line); display: flex; align-items: baseline; gap: 8px; }
.card h3.sub .help { margin: 0; font-family: var(--body); font-size: 13px; }
