/* v2.7 : couleurs ExoDrive. Clair = blanc + violet (bouton principal jaune) ; sombre = violet adouci + jaune.
   Par defaut : suit le telephone ; data-theme="light"/"dark" (theme.js) force un mode. */
:root {
  color-scheme: light;
  --bg: #ffffff; --card: #ffffff; --ink: #1f1a2e; --muted: #5f5873; --brand: #5b33a8; --brand-ink: #ffffff;
  --line: #e8e2f3; --err: #b3261e; --ok: #1e7a46;
  --head: #4b2a8c; --head-ink: #ffffff; --head-muted: #e2d9f5;
  --accent: #ffc233; --accent-ink: #2a1650; --field: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --bg: #2b2147; --card: #3a2d60; --ink: #ffffff; --muted: #cfc6ea; --brand: #ffd666; --brand-ink: #2a1650;
    --line: #4e4078; --err: #ffb4ab; --ok: #8fe0ae;
    --head: #3a2c63; --head-ink: #ffffff; --head-muted: #d4caee;
    --accent: #ffc233; --accent-ink: #2a1650; --field: #2b2147;
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #2b2147; --card: #3a2d60; --ink: #ffffff; --muted: #cfc6ea; --brand: #ffd666; --brand-ink: #2a1650;
  --line: #4e4078; --err: #ffb4ab; --ok: #8fe0ae;
  --head: #3a2c63; --head-ink: #ffffff; --head-muted: #d4caee;
  --accent: #ffc233; --accent-ink: #2a1650; --field: #2b2147;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
body { max-width: 560px; margin: 0 auto; padding: 16px; }
header { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
header h1 { margin: 0; font-size: 1.5rem; }
header p { margin: 0; color: var(--muted); font-size: .95rem; }
h2 { font-size: 1.2rem; margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
button, .button { display: block; width: 100%; margin: 12px 0 0; padding: 12px 14px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; text-align: center; }
button:disabled { opacity: .5; cursor: default; }
button.second { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
button.link { background: none; color: var(--brand); padding: 6px 0; width: auto; font-weight: 500; text-decoration: underline; }
button.small { display: inline-block; width: auto; margin: 0 0 0 8px; padding: 6px 10px; font-size: .9rem; }
button.danger { background: var(--err); color: #fff; }
input[type=text], textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--field); color: var(--ink); font: inherit; }
input[type=text] { text-transform: uppercase; letter-spacing: .1em; font-family: ui-monospace, monospace; }
label { display: block; margin: 10px 0 4px; }
label.check { display: flex; gap: 8px; align-items: center; }
.key { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; margin: 12px 0; padding: 12px;
  border: 1px dashed var(--brand); border-radius: 10px; font-family: ui-monospace, monospace; font-size: 1.1rem; }
.key b { color: var(--muted); font-weight: 400; display: inline-block; min-width: 2.2em; }
.err { color: var(--err); min-height: 1em; }
.ok { color: var(--ok); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.files { list-style: none; margin: 12px 0 0; padding: 0; }
.files li { padding: 10px 0; border-top: 1px solid var(--line); }
.files .name { font-weight: 600; word-break: break-word; }
.files .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.files .actions { white-space: nowrap; }
progress { width: 100%; height: 10px; margin-top: 8px; }
input[type=file] { display: none; }
footer { margin: 18px 0; }
footer textarea { margin-top: 4px; }
header img.logo { border-radius: 10px; }
/* v2.2 : code de passage et lien-bouton */
.key.code { display: block; text-align: center; font-size: 1.8rem; letter-spacing: .15em; }
a.button { text-decoration: none; }
ol.steps { margin: 8px 0; padding-left: 1.2em; }
ol.steps li { margin: 4px 0; }
/* v2.2.1 : page de test */
.diag-card { margin-top: 12px; }
ul.diag { list-style: none; padding: 0; margin: 0; font-size: .9rem; word-break: break-word; }
ul.diag li { padding: 2px 0; }
img.diag-img { max-width: 100%; margin-top: 8px; border-radius: 8px; }
/* v2.2.2 : 2e page de test */
input[type=file].visible { display: block; margin-top: 8px; }
iframe.diag-pdf { width: 100%; height: 260px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
/* v2.3 */
.key.code.small-code { font-size: 1.2rem; padding: 8px; }
details.code-box { margin-top: 14px; }
details.code-box summary { color: var(--brand); cursor: pointer; }
/* v2.4 : arabe (droite a gauche) : cle, codes et champs restent de gauche a droite */
[dir=rtl] .key, [dir=rtl] input[type=text], [dir=rtl] #restore-input { direction: ltr; }
[dir=rtl] ol.steps { padding-left: 0; padding-right: 1.2em; }
[dir=rtl] button.small { margin: 0 8px 0 0; }
/* v2.5 : pages confidentialite / conditions */
.legal-links { text-align: center; margin: 8px 0 0; }
.legal-links a, .legal a { color: var(--brand); }
.legal a.button { color: var(--accent-ink); margin-top: 18px; }
.legal h2 { margin-top: 4px; }
.legal h3 { font-size: 1.02rem; margin: 18px 0 6px; }
.legal p, .legal li { margin: 6px 0; }
.legal ul { padding-inline-start: 1.2em; margin: 6px 0; }
.legal .langs { line-height: 1.9; }
.legal .langs a[aria-current] { font-weight: 700; text-decoration: none; }
/* v2.7 : bandeau violet sur toute la largeur, logo, bouton Auto / Clair / Sombre */
header { background: var(--head); color: var(--head-ink); margin: -16px -16px 16px; padding: 22px 16px 20px;
  box-shadow: 0 0 0 100vmax var(--head); clip-path: inset(0 -100vmax); }
header p { color: var(--head-muted); }
header img.logo { border-radius: 12px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
button.danger { color: #fff; }
:root[data-theme=dark] button.danger { background: #b3261e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) button.danger { background: #b3261e; } }
a { color: var(--brand); }
.theme-switch { display: flex; justify-content: center; gap: 0; margin: 14px auto 0; width: max-content;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.theme-switch button { display: inline-block; width: auto; margin: 0; padding: 8px 14px; min-height: 40px; border-radius: 0;
  background: transparent; color: var(--muted); font-size: .9rem; font-weight: 500; }
.theme-switch button + button { border-inline-start: 1px solid var(--line); }
.theme-switch button[aria-pressed=true] { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
progress, input[type=checkbox] { accent-color: var(--brand); }
