/* Fenêtre de connexion et bouton de déconnexion · langage Déclic (DESIGN.md §11), jetons de declic-system.css uniquement.
   Parcours en une fenêtre (22/10/2026) : créer un compte ou se connecter (LinkedIn ou e-mail), code à 4 chiffres, puis la suite. */
.login-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; padding: 28px 30px 22px; border: 1px solid var(--ink); border-radius: 0; background: var(--white); color: var(--ink); box-shadow: none; font: 400 13px/1.7 var(--mono); }
.login-dialog::backdrop { background: var(--ink); opacity: .55; }
.login-dialog h2 { margin: 0 0 10px; font: 800 clamp(30px, 6vw, 38px)/1.08 var(--display); letter-spacing: -.055em; }
dialog.login-dialog h2[tabindex]:focus, dialog.login-dialog h2[tabindex]:focus-visible { outline: none; }
.login-eyebrow { margin: 0 0 12px; font-size: 10px; letter-spacing: .13em; }
.login-lede { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: none; color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
.login-close:hover { background: var(--accent); }
.login-status { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); font-size: 12px; }
.login-status[data-kind="warn"] { border-left-color: var(--scan); }

.login-button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 48px; padding: 12px 18px; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--bg); font: 600 12px/1.5 var(--mono); letter-spacing: -.015em; text-decoration: none; cursor: pointer; transition: transform .2s ease, background .2s ease, color .2s ease; }
.login-button:hover { background: var(--accent); color: var(--ink); transform: translateY(-2px); }
.login-button:disabled { background: var(--surface); color: var(--muted); border-color: var(--line); cursor: not-allowed; transform: none; }
.login-linkedin { background: transparent; color: var(--ink); }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: 11px; }
.login-divider:before, .login-divider:after { content: ''; flex: 1; height: 1px; background: var(--line); }

.login-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.login-field label { font-size: 12px; font-weight: 600; }
.login-field input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--mono); }
.login-field input:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 2px; }
.login-error { min-height: 0; margin: 0 0 12px; font-size: 12px; line-height: 1.5; }
.login-error:empty { display: none; }
.login-aside { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 18px 0 0; font-size: 12px; }
.login-aside a { color: inherit; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; display: inline-flex; align-items: center; }
.login-aside a:hover { background: var(--accent); }

/* Sur l'inscription, la charte est déjà liée dans la case à cocher : le pied de fenêtre disparaît pour que le formulaire tienne à l'écran. */
.login-dialog[data-tab="signup"] .login-aside:not(.login-back) { display: none; }

/* Déconnexion : même présence qu'un .member-link, sans ressembler à un bouton principal. */
.member-logout { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
.member-logout:hover { background: var(--accent); }
.member-logout:disabled { color: var(--muted); cursor: wait; }
.client-nav-footer .member-logout, #agendaNav > .member-logout, #workspaceNav > .member-logout { margin-top: 8px; }
@media (max-width: 480px) { .login-dialog { padding: 28px 20px 22px; } }
@media (prefers-reduced-motion: reduce) { .login-button { transition: none; } .login-button:hover { transform: none; } }

/* ——— Parcours en une fenêtre : vues, onglets, champs, code ——— */
.login-view[hidden] { display: none; }
.login-view { animation: login-in .32s cubic-bezier(.22,.8,.24,1) both; }
@keyframes login-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.login-progress { display: flex; gap: 6px; margin: 0 0 14px; }
.login-progress[hidden] { display: none; }
.login-progress i { flex: 0 0 28px; height: 2px; background: var(--line); transition: background .3s; }
.login-progress i.is-on { background: var(--ink); }
.login-dialog.is-leaving { animation: login-out .34s cubic-bezier(.22,.8,.24,1) forwards; }
.login-dialog.is-leaving::backdrop { animation: login-fade .34s ease forwards; }
@keyframes login-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes login-fade { to { opacity: 0; } }

.login-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 14px; border: 1px solid var(--ink); }
.login-tabs button { min-height: 44px; padding: 8px 10px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: 600 12px/1.4 var(--mono); letter-spacing: -.015em; cursor: pointer; transition: background .2s, color .2s; }
.login-tabs button + button { border-left: 1px solid var(--ink); }
.login-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.login-tabs button:not([aria-selected="true"]):hover { background: var(--accent); }

.login-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.login-field .login-hint, .login-hint { color: var(--muted); font-size: 12px; line-height: 1.5; font-weight: 400; }
.login-optional { color: var(--muted); font-weight: 400; }
.login-pw { position: relative; display: block; }
.login-pw input { padding-right: 96px; }
.login-pw button { position: absolute; top: 0; right: 0; min-height: 46px; padding: 0 14px; border: 0; background: none; color: var(--ink); font: 500 12px/1 var(--mono); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.login-pw button:hover { background: var(--accent); }
.login-check { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 14px; font-size: 12px; line-height: 1.6; }
.login-check input { flex: 0 0 20px; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); }
.login-check a { color: inherit; text-underline-offset: 3px; }
.login-fine { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; max-width: 48ch; }
.login-form[hidden] { display: none; }

/* Champ de code à 4 chiffres : quatre cases, saisie automatique, collage et code reçu par le clavier acceptés. */
.otp { display: grid; grid-template-columns: repeat(4, minmax(0, 68px)); gap: 12px; justify-content: center; margin: 22px 0 10px; }
.otp-cell { width: 100%; min-height: 76px; padding: 0; border: 1px solid var(--ink); border-radius: 0; background: var(--white); color: var(--ink); font: 800 clamp(32px, 9vw, 44px)/1 var(--display); text-align: center; caret-color: var(--ink); transition: background .18s, color .18s, border-color .18s, transform .18s; -moz-appearance: textfield; }
.otp-cell[data-filled="1"] { background: var(--surface); }
.otp-cell:focus { background: var(--accent); outline: 2px solid var(--ink); outline-offset: 3px; transform: translateY(-2px); }
.otp[data-state="error"] .otp-cell { border-color: #8b2f27; color: #8b2f27; }
.otp[data-state="error"] { animation: otp-shake .42s cubic-bezier(.36,.07,.19,.97) both; }
.otp[data-state="ok"] .otp-cell { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: none; }
.otp[data-state="ok"] .otp-cell:nth-child(2) { transition-delay: .07s; }
.otp[data-state="ok"] .otp-cell:nth-child(3) { transition-delay: .14s; }
.otp[data-state="ok"] .otp-cell:nth-child(4) { transition-delay: .21s; }
.otp[data-state="busy"] .otp-cell { background: var(--surface); color: var(--muted); }
@keyframes otp-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.otp-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 18px; margin: 14px 0 0; font-size: 12px; }
.otp-meta button { min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.otp-meta button:hover:not(:disabled) { background: var(--accent); }
.otp-meta button:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.login-lede b { font-weight: 600; overflow-wrap: anywhere; }

.login-done { display: grid; justify-items: start; gap: 6px; padding: 6px 0 4px; }
.login-done svg { width: 72px; height: 72px; margin: 0 0 10px; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.login-done svg .ring { fill: var(--accent); stroke: var(--ink); stroke-width: 1.6; transform-origin: 50% 50%; animation: login-pop .4s cubic-bezier(.22,.8,.24,1) both; }
@keyframes login-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.login-done svg .tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: login-tick .5s .1s cubic-bezier(.22,.8,.24,1) forwards; }
@keyframes login-tick { to { stroke-dashoffset: 0; } }

@media (max-width: 480px) {
  .login-dialog { padding: 26px 18px 20px; }
  .otp { gap: 10px; margin-top: 18px; }
  .otp-cell { min-height: 68px; }
}
@media (max-width: 340px) { .login-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .login-view, .login-dialog.is-leaving, .login-dialog.is-leaving::backdrop, .otp[data-state="error"] { animation: none; }
  .login-dialog.is-leaving { opacity: 0; }
  .otp-cell, .login-tabs button { transition: none; }
  .otp-cell:focus { transform: none; }
  .login-done svg .tick, .login-done svg .ring { animation: none; stroke-dashoffset: 0; }
}
