:root {
  --bg: #f3f1f6; --paper: #ffffff; --ink: #2b2236; --muted: #6f6680; --line: #e2dde9; --accent: #6b4f8a; --pair: #a4506b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #18151d; --paper: #221e29; --ink: #ece7f3; --muted: #a59cb3; --line: #363040; --accent: #b9a0d8; --pair: #e595b0; }
}
html { background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; display: grid; place-items: center; box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { width: 100%; max-width: 340px; display: grid; justify-items: center; gap: 12px; }
img { border-radius: 18px; }
h1 { margin: 0 0 8px; font: 400 2rem/1.1 "Young Serif", Georgia, "Times New Roman", serif; }
form { width: 100%; box-sizing: border-box; display: grid; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
label { font-weight: 600; font-size: 13px; color: var(--muted); }
/* 16px minimum : en dessous, iOS zoome sur la page au focus. */
input { width: 100%; box-sizing: border-box; font: 16px/1.5 system-ui, -apple-system, sans-serif; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#error { margin: 0; color: var(--pair); font-size: 13px; }
button { margin-top: 4px; border: 0; border-radius: 999px; padding: 10px 14px; background: var(--accent); color: var(--paper); font: 600 15px system-ui, -apple-system, sans-serif; cursor: pointer; }
button.secondary { background: none; color: var(--accent); }
button:disabled { opacity: .6; cursor: default; }

.password { position: relative; }
.password input { padding-right: 84px; }
.password .reveal { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); margin: 0; padding: 6px 10px; background: none; color: var(--accent); font-size: 13px; }
