/* ==========================================================================
   v1.1 · Comptes liés (js/auth.js) : boutons Google et clé d'accès, feuilles
   de liaison, de connexion et de bascule, section « Connexion » du profil.
   Mêmes règles que app.css : boutons en pilule, panneaux 16 px, un seul accent.
   ========================================================================== */

/* ---------------------------------------------------------------- boutons de connexion */
.auth-opts { display: grid; gap: 10px; width: 100%; max-width: 400px; margin-inline: auto; }
.auth-opts__google { position: relative; display: grid; place-items: center; min-height: 44px; border-radius: 999px; }
.auth-opts__google.is-ready { min-height: 40px; }
.auth-opts__google iframe { color-scheme: normal; }
.auth-gsi-skel {
  display: block; width: 100%; height: 44px; border-radius: 999px;
  background: linear-gradient(100deg, var(--bg-elev) 30%, var(--bg-elev-2) 50%, var(--bg-elev) 70%) 0 0 / 300% 100%;
  animation: skel 1.4s linear infinite;
}
.auth-opts__off { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); min-height: 44px; }
.auth-opts__off .ico { width: 18px; height: 18px; }

.auth-btn {
  width: 100%; min-height: 44px; padding: 0 18px; gap: 10px;
  background: oklch(0.14 0.008 262); border-color: var(--line); color: var(--ink);
  font-weight: 600; font-size: 15px;
}
@media (hover: hover) and (pointer: fine) { .auth-btn:hover:not(:disabled) { background: oklch(0.19 0.012 262); border-color: var(--ink-3); } }
.auth-btn .ico { width: 21px; height: 21px; }
.auth-btn span { overflow: hidden; text-overflow: ellipsis; }
.auth-btn--passkey .ico { color: var(--ink); }
.auth-btn--mock { border-style: dashed; color: var(--ink-2); background: transparent; }
.auth-btn--mock .ico { color: var(--ink-3); }

.auth-opts.is-busy .auth-opts__google { opacity: 0.45; pointer-events: none; transition: opacity 0.2s var(--ease); }
.auth-opts__status { font-size: 13.5px; color: var(--ink-2); text-align: center; text-wrap: pretty; }
.auth-opts__status.is-bad { color: oklch(0.8 0.12 27); font-weight: 500; }

/* ---------------------------------------------------------------- feuilles */
.sheet--auth .sheet__panel { max-width: 480px; }
.sheet--switch .sheet__panel { max-width: 560px; }
.auth-sheet__lead { font-size: 15px; color: var(--ink-2); text-wrap: pretty; }
.auth-sheet__opts { display: grid; gap: 10px; }
.auth-sheet__opts.is-done .auth-opts { opacity: 0.4; pointer-events: none; transition: opacity 0.3s var(--ease); }
.auth-sheet__alt { font-size: 13.5px; color: var(--ink-3); text-align: center; }
.auth-sheet__alt .link { font-size: 13.5px; }
.auth-fine { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); text-wrap: pretty; }
.auth-fine .ico { width: 15px; height: 15px; margin-top: 1px; }
.auth-or { margin: 2px 0; }
.auth-code { display: grid; gap: 8px; }

/* récompense de la première liaison : seul usage de l'or ici (récompense, comme le Pass) */
.auth-reward {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px; border-radius: 12px; font-size: 13.5px; line-height: 1.3; font-weight: 600; color: var(--gold-hi);
  background: linear-gradient(100deg, oklch(0.3 0.045 80), oklch(0.235 0.018 262) 75%);
  border: 1px solid oklch(0.7 0.11 82 / 0.45);
}
.auth-reward .ico { width: 18px; height: 18px; color: var(--gold); }

/* carte « Ta collection » : ce qui est en jeu, et où elle vit */
.vault {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-panel);
  background: radial-gradient(120% 140% at 0% 0%, oklch(0.26 0.02 262), var(--bg) 70%);
  border: 1px solid var(--line-soft);
}
.vault__sign .sign { font-size: 28px; }
.vault__sign .sign__in { min-width: 1.5em; padding: 0.16em 0.32em 0.1em; }
.vault__body { display: grid; gap: 3px; min-width: 0; }
.vault__title { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault__meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.vault__state, .swcard__state {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 12.5px; font-weight: 600; color: oklch(0.82 0.1 60);
}
.vault__state .ico, .swcard__state .ico { width: 15px; height: 15px; }
.vault__state.is-safe, .swcard__state.is-safe { color: var(--good); }
.vault__stamp {
  display: none; justify-self: start; align-items: center; gap: 6px; margin-top: 6px; rotate: -4deg;
  padding: 3px 10px 1px 8px; border: 2px solid var(--good); border-radius: 7px;
  font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--good); background: color-mix(in srgb, var(--good) 8%, transparent);
}
.vault__stamp .ico { width: 16px; height: 16px; }
.vault.is-stamped .vault__stamp { display: inline-flex; }

/* ---------------------------------------------------------------- bascule : deux comptes côte à côte */
.swpair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 8px; }
.swpair__arrow {
  align-self: center; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  background: var(--bg-elev-2); border: 1px solid var(--line-soft); color: var(--ink-2);
}
.swpair__arrow .ico { width: 17px; height: 17px; }
.swcard {
  display: grid; justify-items: center; align-content: start; gap: 5px; min-width: 0;
  padding: 14px 10px 12px; border-radius: var(--r-panel); text-align: center;
  background: var(--bg); border: 1px solid var(--line-soft);
}
.swcard.is-target {
  border-color: color-mix(in srgb, var(--signal) 60%, var(--line));
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--signal) 12%, var(--bg)), var(--bg) 70%);
}
.swcard__label { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.swcard__sign { margin: 4px 0 2px; }
.swcard__sign .sign { font-size: 26px; }
.swcard__sign .sign__in { min-width: 1.5em; padding: 0.16em 0.32em 0.1em; }
.swcard__name { max-width: 100%; font-family: var(--font-display); font-weight: 700; font-size: 21px; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.swcard__place { font-size: 12.5px; line-height: 1.3; color: var(--ink-3); overflow-wrap: anywhere; }
.swcard__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; margin: 6px 0 0; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.swcard__stats div { display: grid; gap: 1px; }
.swcard__stats dt { font-size: 11px; color: var(--ink-3); }
.swcard__stats dd { margin: 0; font-family: var(--font-mono); font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.swcard__state { justify-self: center; font-size: 11.5px; }
.swcode { display: grid; gap: 8px; }
.swcode__intro { font-size: 14px; color: var(--ink-2); text-wrap: pretty; }
.swcode__box .savecode__code { font-size: 17px; }

/* ---------------------------------------------------------------- profil : section « Connexion » */
.auth-pf { display: grid; gap: 12px; }
.auth-methods { list-style: none; margin: 0; padding: 0 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-soft); }
.auth-method { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; }
.auth-method + .auth-method { border-top: 1px solid var(--line-soft); }
.auth-method__ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; background: var(--bg-elev-2); color: var(--ink); }
.auth-method__ico .ico { width: 20px; height: 20px; }
.auth-method__body { display: grid; gap: 2px; min-width: 0; }
.auth-method__name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.auth-method__meta { font-size: 12.5px; color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .auth-method__del:hover { color: oklch(0.8 0.12 27); border-color: oklch(0.55 0.15 27 / 0.6); } }
.auth-chip {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: var(--good); background: color-mix(in oklch, var(--good) 14%, transparent);
}
.auth-pf__addt { margin-top: 2px; }
.auth-pf__add .auth-opts { margin-inline: 0; }
.auth-devices {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line-soft);
}
.auth-devices__ico { display: grid; place-items: center; color: var(--ink-3); }
.auth-devices__ico .ico { width: 20px; height: 20px; }
.auth-devices__text { flex: 1; min-width: 150px; font-size: 14px; color: var(--ink-2); }
.auth-pf__logout { color: var(--ink-2); }

/* ---------------------------------------------------------------- écrans « Session inconnue » et « Déconnecté » */
.gate__auth { width: 100%; display: grid; margin-top: 6px; }
.gate__auth .auth-opts { max-width: 100%; }
