/* Page de connexion d'un serveur client : Carnet, vermillon et encre sur fond blanc (décisions 0015, 0017).
   Mêmes jetons que extension/claude-carnet/carnet.css. Polices et dessins : ceux de l'extension,
   servis un par un par Caddy (deploy/serveur/modeles.ts, RESSOURCES_CONNEXION). */

@font-face { font-family: "EC Newsreader"; src: url("/connexion/polices/newsreader.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "EC Inter"; src: url("/connexion/polices/inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "EC Caveat"; src: url("/connexion/polices/caveat.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

:root {
  --ec-paper: #FFFFFF;
  --ec-paper-2: #F6F5F2;
  --ec-ink: #1F1D1A;
  --ec-ink-2: #48443E;
  --ec-muted: #6B6760;
  --ec-rule: #E7E3DC;
  --ec-rule-2: #D9D3C8;
  --ec-accent-ink: #C54119;
  --ec-accent-hover: #A3361A;
  --ec-accent-wash: #FDF3EE;
  --ec-error-ink: #8F2E12;
  --ec-serif: "EC Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --ec-sans: "EC Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ec-hand: "EC Caveat", "Segoe Print", "Bradley Hand", cursive;
  --ec-pen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M3 12.5c48-5 98-7.2 150-6.2 50 1 96 3.2 144-3' fill='none' stroke='%23E04A1C' stroke-width='3.4' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M34 17.5c40-3 92-4.2 142-3.2 34 .8 66 .6 98-2' fill='none' stroke='%23E04A1C' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke' opacity='.65'/%3E%3C/svg%3E");
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ec-paper);
  color: var(--ec-ink);
  font: 400 16px/1.6 var(--ec-sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--ec-accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--ec-accent-hover); }
:focus-visible { outline: 2px solid var(--ec-accent-ink); outline-offset: 3px; }

.cx { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; padding: 28px clamp(16px, 8vw, 116px); }
.cx-main { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: clamp(24px, 5vw, 72px); padding-block: 24px; }
.cx-text { display: grid; gap: 22px; align-content: center; }

.cx-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ec-ink); }
.cx-brand img { width: 40px; height: 40px; }
.cx-brand span { font: 500 1.6rem/1 var(--ec-serif); letter-spacing: -0.01em; }

.cx-eyebrow { margin: 0; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ec-muted); }
.cx-title { margin: 0; font: 500 clamp(2.4rem, 5.4vw, 3.6rem)/1.06 var(--ec-serif); letter-spacing: -0.02em; text-wrap: balance; }
.cx-pen { background: var(--ec-pen) no-repeat left 100% / 100% 0.32em; padding-bottom: 0.08em; }
.cx-lead { margin: 0; font-size: 1.08rem; color: var(--ec-ink-2); max-width: 30rem; }

.cx-form { display: grid; gap: 10px; max-width: 26rem; }
.cx-label { font-weight: 600; font-size: 0.95rem; }
.cx-field { position: relative; }
.cx-field input {
  width: 100%; height: 52px; padding: 0 96px 0 16px;
  border: 1.5px solid var(--ec-rule-2); border-radius: 10px;
  background: var(--ec-paper); color: var(--ec-ink);
  font: 400 1.05rem var(--ec-sans);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.cx-field input:focus { outline: none; border-color: var(--ec-accent-ink); box-shadow: 0 0 0 4px var(--ec-accent-wash); }
.cx-field input[aria-invalid="true"] { border-color: var(--ec-accent-ink); }
/* Edge ajoute son propre bouton pour voir le mot de passe : un seul suffit, celui de la page. */
.cx-field input::-ms-reveal, .cx-field input::-ms-clear { display: none; }
.cx-show {
  position: absolute; top: 6px; right: 6px; height: 40px; padding: 0 12px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ec-ink-2);
  font: 500 0.9rem var(--ec-sans); cursor: pointer;
}
.cx-show:hover { background: var(--ec-paper-2); color: var(--ec-ink); }
.cx-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cx-submit {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 28px; margin-top: 6px;
  border: 0; border-radius: 10px;
  background: var(--ec-accent-ink); color: #FFFFFF;
  font: 600 1.05rem var(--ec-sans); cursor: pointer;
  transition: background 120ms ease;
}
.cx-submit:hover { background: var(--ec-accent-hover); }
.cx-submit svg { width: 18px; height: 18px; }
.cx-submit[disabled] { opacity: 0.7; cursor: progress; }
.cx-error {
  display: none; margin: 2px 0 0; padding: 10px 12px; border-radius: 8px;
  background: var(--ec-accent-wash); color: var(--ec-error-ink); font-size: 0.95rem;
}
.cx-error.is-shown { display: block; }
.cx-help { margin: 4px 0 0; font-size: 0.92rem; color: var(--ec-muted); }
.cx-note { font: 500 1.35rem/1.2 var(--ec-hand); color: var(--ec-ink-2); display: inline-flex; align-items: center; gap: 10px; }
.cx-note svg { width: 42px; height: 18px; flex: none; }

.cx-art { position: relative; display: grid; justify-items: center; align-content: center; }
.cx-bubble {
  position: relative; margin: 0; padding: 14px 18px; max-width: 20rem; justify-self: end; margin-right: 4%;
  border: 1.5px solid var(--ec-ink); border-radius: 16px; background: var(--ec-paper);
  font: 400 1.12rem/1.45 var(--ec-serif); color: var(--ec-ink);
}
.cx-bubble strong { font-weight: 600; }
.cx-bubble::after {
  content: ""; position: absolute; left: 32%; bottom: -13px; width: 22px; height: 22px;
  background: var(--ec-paper); border-right: 1.5px solid var(--ec-ink); border-bottom: 1.5px solid var(--ec-ink);
  transform: rotate(45deg) skew(8deg, 8deg);
}
.cx-art img { width: min(100%, 400px); margin-top: -10px; }

@media (max-width: 52rem) {
  .cx { padding: 20px 16px; }
  .cx-main { grid-template-columns: 1fr; gap: 8px; padding-block: 12px 20px; align-content: start; }
  .cx-art { order: -1; grid-template-columns: 1fr auto; align-items: end; justify-items: start; }
  .cx-bubble { justify-self: start; margin: 0 0 40px; font-size: 1rem; max-width: 15rem; }
  .cx-bubble::after { left: auto; right: -12px; bottom: 18px; transform: rotate(-45deg) skew(8deg, 8deg); }
  .cx-art img { width: 150px; margin: -18px -20px -14px 0; }
  .cx-text { gap: 16px; }
  .cx-actions .cx-submit { flex: 1; justify-content: center; }
  .cx-note { display: none; }
}

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