/* PLINK : styles des comptes (connexion.html, compte.html). S'ajoute après plink.css. */
[data-msg]:empty, [data-compte-msg]:empty { display: none; }
.account-body { display: grid; gap: 20px; }
.account-head { display: grid; gap: 4px; }
.account-plan { display: grid; gap: 10px; justify-items: start; }
.account-plan p { margin: 0; }
.account .btn-ghost { justify-self: start; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Mot de passe : œil et règles ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 52px; }
.pw-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.pw-eye:hover { color: var(--text); background: var(--surface); }
.pw-eye:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.pw-eye svg { width: 20px; height: 20px; }
.pw-rules { list-style: none; margin: -4px 0 4px; padding: 0; display: grid; gap: 4px; font-size: 14px; line-height: 20px; color: var(--text-2); }
.pw-rules li { display: flex; align-items: center; gap: 8px; }
.pw-rules li::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 10px no-repeat; }

/* ---------- E-mail de confirmation envoyé ---------- */
.confirm-mail { border: 2px solid var(--err); }
.confirm-mail > span { display: grid; gap: 8px; }
.confirm-mail strong { font-size: 16px; line-height: 24px; }
.confirm-adresse { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; color: var(--text); background: var(--bg); padding: 8px 12px; border-radius: var(--r-ctrl); }
.confirm-btn { margin-top: 4px; text-decoration: none; }

/* =====================================================================
   Mon compte : tableau de bord
   ===================================================================== */
.cpt-section { padding-top: 32px; }
.cpt { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.cpt-nav { position: sticky; top: 96px; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-raised); }
.cpt-nav a, .cpt-nav button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: none; color: var(--text-2); font: 600 15px/20px var(--font); text-decoration: none; cursor: pointer; transition: background-color var(--t-hover) var(--ease), color var(--t-hover) var(--ease); }
.cpt-nav a:hover, .cpt-nav button:hover { background: var(--surface); color: var(--text); }
.cpt-nav a[aria-current="true"] { background: var(--select); color: var(--accent-text); }
.cpt-nav svg { width: 20px; height: 20px; flex: none; }
.cpt-nav .cpt-nav-sortir { margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; color: var(--err); }
.cpt-main { display: grid; gap: 20px; min-width: 0; }
.cpt-main > section[id] { scroll-margin-top: 96px; }
.cpt-card { display: grid; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-raised); box-shadow: var(--shadow); }
.cpt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cpt-card-head h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; line-height: 28px; }
.cpt-card-head h2 svg { width: 22px; height: 22px; color: var(--plink-blue); }
.cpt-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Carte d'identité */
.cpt-hero { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; overflow: hidden; position: relative; }
.cpt-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--plink-blue), #5B8CFF); }
.cpt-avatar { position: relative; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--plink-blue); color: #fff; font-size: 34px; font-weight: 700; box-shadow: 0 0 0 4px var(--surface-raised), 0 0 0 6px var(--select); overflow: hidden; }
.cpt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cpt-id { display: grid; gap: 6px; min-width: 0; }
.cpt-nom-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cpt-nom-row h1 { font-size: 28px; line-height: 36px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpt-nom-row .icon-btn { width: 36px; height: 36px; }
.cpt-nom-row .icon-btn svg { width: 18px; height: 18px; }
.cpt-pseudo { display: flex; gap: 8px; flex-wrap: wrap; }
.cpt-pseudo input { flex: 1 1 180px; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: var(--r-ctrl); background: var(--bg); color: var(--text); font: 600 18px var(--font); }
.cpt-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Statistiques */
.cpt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cpt-stat { display: grid; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-raised); }
.cpt-stat-val { font-size: 30px; line-height: 36px; font-weight: 700; color: var(--plink-blue); font-variant-numeric: tabular-nums; }
.cpt-stat-lbl { color: var(--text-2); font-size: 13px; line-height: 18px; }

/* Historique */
.cpt-filtres { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.cpt-filtres button { min-height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: none; color: var(--text-2); font: 600 13px/18px var(--font); cursor: pointer; }
.cpt-filtres button[aria-pressed="true"] { background: var(--plink-blue); color: #fff; }
.cpt-recherche { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--field); border-radius: var(--r-ctrl); background: var(--bg); color: var(--text); font: 400 15px var(--font); }
.cpt-recherche:focus-visible, .cpt-pseudo input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cpt-histo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cpt-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px; border-radius: 14px; transition: background-color var(--t-hover) var(--ease); }
.cpt-item:hover { background: var(--surface); }
.cpt-mini { position: relative; width: 96px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--surface); display: grid; place-items: center; color: var(--text-2); }
.cpt-mini img { width: 100%; height: 100%; object-fit: cover; }
.cpt-mini svg { width: 26px; height: 26px; }
.cpt-mini .dur { position: absolute; right: 4px; bottom: 4px; padding: 0 5px; border-radius: 5px; background: rgba(17, 19, 24, .82); color: #fff; font-size: 11px; line-height: 16px; font-weight: 600; }
.cpt-item-txt { display: grid; gap: 2px; min-width: 0; }
.cpt-item-txt strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 22px; }
.cpt-fmt { display: inline-block; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 700; line-height: 16px; color: #fff; }
.cpt-fmt-mp3 { background: #7A4DFF; }
.cpt-fmt-mp4 { background: var(--plink-blue); }
.cpt-item-act { display: flex; gap: 4px; }
.cpt-item-act .icon-btn { width: 38px; height: 38px; }
.cpt-item-act .icon-btn svg { width: 18px; height: 18px; }
.cpt-vide { display: grid; gap: 8px; justify-items: center; padding: 28px 12px; text-align: center; color: var(--text-2); }
.cpt-vide strong { color: var(--text); font-size: 16px; }
.cpt-vide .btn { margin-top: 6px; }
.link-btn.cpt-rouge { color: var(--err); }

/* Lignes de réglage */
.cpt-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.cpt-card-head + .cpt-row, [data-prefs] > .cpt-row:first-child { border-top: 0; padding-top: 0; }
.cpt-row > div:first-child { min-width: 0; }
.cpt-row strong { font-size: 15px; line-height: 22px; }
.cpt-row p { margin: 2px 0 0; }
.cpt-row .select { min-width: 190px; }
.cpt-interrupteur { cursor: pointer; }
.cpt-interrupteur input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background-color var(--t-state) var(--ease); }
.cpt-interrupteur input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--t-state) var(--ease); }
.cpt-interrupteur input:checked { background: var(--plink-blue); }
.cpt-interrupteur input:checked::after { transform: translateX(18px); }
.cpt-interrupteur input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[data-prefs] > .btn { margin-top: 8px; }
.cpt-sous { padding: 16px; border-radius: var(--r-ctrl); background: var(--surface); }
.cpt-danger strong { color: var(--err); }
.btn.cpt-btn-danger { background: var(--err); color: #fff; border: 0; }
.btn.cpt-btn-danger:hover { filter: brightness(1.08); }
.btn.cpt-btn-danger:disabled { opacity: .5; cursor: not-allowed; }
.cpt-dialog { max-width: 460px; width: calc(100% - 32px); padding: 24px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow); }
.cpt-dialog::backdrop { background: rgba(10, 12, 16, .55); }
.cpt-dialog form { display: grid; gap: 14px; }
.cpt-dialog h2 { font-size: 22px; line-height: 30px; }
.cpt-dialog .field { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
.cpt-dialog input { height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: var(--r-ctrl); background: var(--bg); color: var(--text); font: 600 16px var(--font); letter-spacing: .08em; }

/* Apparition en cascade (sobre : 10 px, 350 ms, sans rebond) */
.reveal-in { opacity: 0; transform: translateY(10px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.reveal-in.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal-in { opacity: 1; transform: none; transition: none; } }

@media (max-width: 980px) {
  .cpt { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cpt-nav { position: sticky; top: 72px; z-index: 5; display: flex; overflow-x: auto; scrollbar-width: none; padding: 6px; border-radius: var(--r-pill); }
  .cpt-nav::-webkit-scrollbar { display: none; }
  .cpt-nav a, .cpt-nav button { flex: none; min-height: 38px; border-radius: var(--r-pill); font-size: 14px; }
  .cpt-nav .cpt-nav-sortir { margin-top: 0; border-top: 0; border-radius: var(--r-pill); }
  .cpt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cpt-card { padding: 18px; }
  .cpt-hero { grid-template-columns: auto minmax(0, 1fr); }
  .cpt-hero-cta { grid-column: 1 / -1; }
  .cpt-avatar { width: 64px; height: 64px; font-size: 26px; }
  .cpt-nom-row h1 { font-size: 22px; line-height: 30px; }
  .cpt-item { grid-template-columns: 72px minmax(0, 1fr); }
  .cpt-mini { width: 72px; }
  .cpt-item-act { grid-column: 2; }
  .cpt-row { flex-wrap: wrap; }
  .cpt-row .select { min-width: 0; width: 100%; }
}
