/* =========================================================
   MENU COMPTE
========================================================= */

.account-nav-wrap{

  margin-left:0;

  display:flex;

  align-items:center;

}

.account-nav-button{

  display:inline-flex;

  align-items:center;

  gap:8px;

  height:42px;

  padding:0 14px;

  border-radius:10px;

  text-decoration:none;

  color:#e8edf2;

  background:rgba(255,255,255,.06);

  border:1px solid rgba(255,255,255,.09);

  transition:.2s;

}

.account-nav-button:hover{

  background:rgba(0,188,212,.16);

  border-color:rgba(0,188,212,.3);

  transform:translateY(-1px);

}

.account-nav-user{

  padding-right:12px;

}

.account-nav-avatar,

.account-nav-initials{

  width:26px;

  height:26px;

  min-width:26px;

  min-height:26px;

  max-width:26px;

  max-height:26px;

  border-radius:50%;

  object-fit:cover;

  flex:none;

}

.account-nav-avatar{

  display:block;

}

.account-nav-initials{

  display:grid;

  place-items:center;

  background:rgba(0,188,212,.18);

  font-size:10px;

  font-weight:700;

}


/* =========================================================
   PAGES COMPTE
========================================================= */

.auth-page,
.profile-page{

  width:min(900px,92%);

  margin:25px auto 50px;

}

.auth-box,
.profile-box,
.settings-box{

  background:rgba(255,255,255,.05);

  border:1px solid rgba(255,255,255,.08);

  border-radius:20px;

  padding:28px;

  backdrop-filter:blur(12px);

  text-align:left;

  box-shadow:0 20px 70px rgba(0,0,0,.25);

}

.auth-box{

  width:min(480px,100%);

  margin:30px auto;

}

.auth-title,
.profile-title{

  font-family:"Barlow Condensed",sans-serif;

  text-transform:uppercase;

  letter-spacing:2px;

  font-size:30px;

}

.auth-subtitle{

  color:rgba(232,237,242,.55);

  font-size:13px;

  margin:7px 0 22px;

}


/* =========================================================
   GOOGLE / TWITCH
========================================================= */

.auth-provider-grid{

  display:grid;

  grid-template-columns:1fr 1fr;

  gap:10px;

}

.auth-provider{

  height:44px;

  border-radius:10px;

  border:1px solid rgba(255,255,255,.1);

  background:rgba(255,255,255,.06);

  color:#e8edf2;

  cursor:pointer;

  font-weight:700;

}

.auth-provider:hover{

  background:rgba(0,188,212,.14);

}

.auth-provider:disabled{

  opacity:.6;

  cursor:wait;

}


/* =========================================================
   SEPARATION
========================================================= */

.auth-divider{

  display:flex;

  align-items:center;

  gap:10px;

  color:rgba(232,237,242,.35);

  font-size:11px;

  margin:20px 0;

}

.auth-divider:before,
.auth-divider:after{

  content:"";

  height:1px;

  background:rgba(255,255,255,.1);

  flex:1;

}


/* =========================================================
   CHAMPS
========================================================= */

.auth-field{

  display:flex;

  flex-direction:column;

  gap:6px;

  margin-bottom:14px;

}

.auth-field label{

  font-size:11px;

  text-transform:uppercase;

  letter-spacing:.1em;

  color:rgba(232,237,242,.55);

}

.auth-field input{

  height:44px;

  border-radius:10px;

  border:1px solid rgba(255,255,255,.1);

  background:rgba(0,0,0,.2);

  color:#fff;

  padding:0 13px;

  outline:none;

  box-sizing:border-box;

}

.auth-field input:focus{

  border-color:rgba(0,188,212,.55);

}


/* =========================================================
   BOUTONS COMPTE
   Même apparence partout
========================================================= */

.mini-button,
.auth-submit,
.danger-button,
.secondary-button,
.identity-action,
.forgot-password{

  display:inline-flex;

  align-items:center;

  justify-content:center;

  box-sizing:border-box;

  min-height:44px;

  padding:0 18px;

  border-radius:10px;

  border:1px solid rgba(0,188,212,.35);

  background:rgba(0,188,212,.18);

  color:#e8edf2;

  font:inherit;

  font-weight:700;

  cursor:pointer;

  transition:
    background .2s,
    border-color .2s,
    transform .2s,
    opacity .2s;

}

.mini-button:hover,
.auth-submit:hover,
.secondary-button:hover,
.identity-action:hover,
.forgot-password:hover{

  background:rgba(0,188,212,.28);

  border-color:rgba(0,188,212,.5);

  transform:translateY(-1px);

}

.mini-button:disabled,
.auth-submit:disabled,
.secondary-button:disabled,
.identity-action:disabled,
.forgot-password:disabled{

  opacity:.5;

  cursor:wait;

  transform:none;

}


/* =========================================================
   BOUTON CONNEXION
========================================================= */

.auth-submit{

  width:100%;

}


/* =========================================================
   MOT DE PASSE OUBLIÉ
========================================================= */

.forgot-password{

  width:100%;

  margin-bottom:10px;

}


/* IMPORTANT :
   hidden doit réellement cacher l'élément */

.auth-field[hidden],
.forgot-password[hidden]{

  display:none !important;

}


/* =========================================================
   BOUTON CRÉER UN COMPTE
========================================================= */

.auth-switch{

  display:block;

  margin:14px auto 0;

  background:none;

  border:0;

  color:#7de5f0;

  cursor:pointer;

  font:inherit;

}

.auth-switch:hover{

  text-decoration:underline;

}


/* =========================================================
   STATUS
========================================================= */

.auth-status{

  min-height:20px;

  margin-top:12px;

  font-size:13px;

}

.auth-status.error{

  color:#ff8e8e;

}

.auth-status.success{

  color:#83e7a4;

}


/* =========================================================
   PROFIL
========================================================= */

.profile-head{

  position:relative;

  display:flex;

  align-items:center;

  gap:18px;

}

.profile-avatar{

  width:88px;

  height:88px;

  min-width:88px;

  min-height:88px;

  max-width:88px;

  max-height:88px;

  border-radius:50%;

  overflow:hidden;

  border:2px solid rgba(0,188,212,.3);

  background:rgba(255,255,255,.06);

  display:flex;

  align-items:center;

  justify-content:center;

  flex:0 0 88px;

}

.profile-avatar img{

  display:block;

  width:100% !important;

  height:100% !important;

  min-width:0 !important;

  min-height:0 !important;

  max-width:100% !important;

  max-height:100% !important;

  object-fit:cover !important;

  object-position:center;

  border-radius:50%;

}

.profile-avatar-fallback{

  display:grid;

  place-items:center;

  font-size:28px;

  font-weight:700;

}

.profile-head-info{

  min-width:0;

}

.profile-meta{

  color:rgba(232,237,242,.5);

  font-size:13px;

  margin-top:4px;

}

.edit-profile-button{

  margin-left:auto;

  white-space:nowrap;

}

.profile-stats{

  display:grid;

  grid-template-columns:repeat(3,1fr);

  gap:10px;

  margin:24px 0;

}

.profile-stat{

  padding:15px;

  border-radius:12px;

  background:rgba(255,255,255,.04);

  border:1px solid rgba(255,255,255,.06);

}

.profile-stat strong{

  display:block;

  font-size:22px;

}

.profile-stat span{

  font-size:11px;

  color:rgba(232,237,242,.45);

}

.profile-section{

  margin-top:26px;

}

.profile-section h3{

  font-family:"Barlow Condensed",sans-serif;

  text-transform:uppercase;

  letter-spacing:1.5px;

  margin-bottom:12px;

}

.favorite-list{

  display:grid;

  grid-template-columns:repeat(auto-fill,minmax(210px,1fr));

  gap:10px;

}

.favorite-item{

  position:relative;

  padding:13px 50px 13px 13px;

  border-radius:12px;

  background:rgba(255,255,255,.04);

  border:1px solid rgba(255,255,255,.06);

  min-height:50px;

  box-sizing:border-box;

}

.favorite-item small{

  display:block;

  color:rgba(232,237,242,.4);

  margin-bottom:3px;

  text-transform:uppercase;

  font-size:9px;

  letter-spacing:.12em;

}

.favorite-item strong{

  display:block;

}

.favorite-remove{

  position:absolute;

  top:50%;

  right:10px;

  transform:translateY(-50%);

  width:34px;

  height:34px;

  display:flex;

  align-items:center;

  justify-content:center;

  border-radius:50%;

  border:1px solid rgba(255,211,77,.3);

  background:rgba(255,211,77,.08);

  color:#ffd34d;

  font-size:19px;

  line-height:1;

  cursor:pointer;

  transition:.2s;

}

.favorite-remove:hover{

  background:rgba(255,211,77,.18);

  border-color:rgba(255,211,77,.55);

  transform:translateY(-50%) scale(1.06);

}

.empty-state{

  color:rgba(232,237,242,.4);

  font-size:13px;

  padding:10px 0;

}


/* =========================================================
   MODIFICATION PROFIL
========================================================= */

.profile-edit-panel{

  margin-top:18px;

  padding:16px;

  border-radius:13px;

  background:rgba(255,255,255,.035);

  border:1px solid rgba(255,255,255,.07);

}

.profile-edit-panel[hidden]{

  display:none;

}

.profile-edit-grid{

  display:grid;

  grid-template-columns:1fr 1fr;

  gap:14px;

}

.profile-edit-actions{

  display:flex;

  justify-content:flex-end;

  gap:8px;

  align-items:center;

}

.profile-save-button{

  width:auto;

  padding:0 18px;

}


/* =========================================================
   PARAMÈTRES
========================================================= */

.settings-grid{

  display:grid;

  grid-template-columns:1fr 1fr;

  gap:14px;

}

.settings-card{

  padding:18px;

  border-radius:14px;

  background:rgba(255,255,255,.04);

  border:1px solid rgba(255,255,255,.06);

}

.settings-card h3{

  font-size:15px;

  margin-bottom:12px;

}

.settings-card p{

  font-size:12px;

  color:rgba(232,237,242,.48);

  line-height:1.5;

}

.identity-row{

  display:flex;

  align-items:center;

  justify-content:space-between;

  gap:12px;

  padding:11px 0;

  border-bottom:1px solid rgba(255,255,255,.06);

}

.identity-row:last-child{

  border-bottom:0;

}

.identity-name{

  display:flex;

  gap:9px;

  align-items:center;

}

.identity-state{

  font-size:11px;

  color:#83e7a4;

}

.identity-detail{

  display:block;

  color:rgba(232,237,242,.45);

  font-size:11px;

  margin-top:3px;

}

.identity-action{

  min-height:38px;

  padding:0 14px;

  font-size:12px;

}

.identity-action:disabled{

  opacity:.45;

  cursor:not-allowed;

}

.settings-note{

  margin-top:10px;

}


/* =========================================================
   BOUTON DANGEREUX
========================================================= */

.danger-button{

  margin-top:12px;

  width:100%;

  background:rgba(255,70,70,.12);

  border-color:rgba(255,70,70,.25);

}

.danger-button:hover{

  background:rgba(255,70,70,.2);

  border-color:rgba(255,70,70,.4);

}


/* =========================================================
   MOT DE PASSE
========================================================= */

.password-wrap{

  display:flex;

  gap:8px;

  align-items:stretch;

}

.password-wrap input{

  flex:1;

  min-width:0;

}

.password-toggle{

  min-width:82px;

  border:1px solid rgba(255,255,255,.1);

  background:rgba(255,255,255,.05);

  color:#e8edf2;

  border-radius:10px;

  cursor:pointer;

  font-weight:600;

}

.password-toggle:hover{

  background:rgba(0,188,212,.12);

  border-color:rgba(0,188,212,.3);

}


/* =========================================================
   MENU DU COMPTE
========================================================= */

.account-dropdown{

  position:relative;

  display:inline-flex;

}

.account-nav-button{

  font:inherit;

}

.account-menu-toggle{

  cursor:pointer;

}

.account-chevron{

  font-size:11px;

  opacity:.7;

  margin-left:2px;

  transition:transform .2s;

}

.account-menu-toggle[aria-expanded="true"]
.account-chevron{

  transform:rotate(180deg);

}

.account-menu{

  position:absolute;

  right:0;

  top:calc(100% + 8px);

  width:190px;

  padding:6px;

  background:rgba(42,15,17,.98);

  border:1px solid rgba(255,255,255,.1);

  border-radius:12px;

  box-shadow:0 18px 45px rgba(0,0,0,.4);

  backdrop-filter:blur(14px);

  z-index:1000;

}

.account-menu[hidden]{

  display:none;

}

.account-menu a,
.account-menu button{

  width:100%;

  display:flex;

  align-items:center;

  gap:9px;

  padding:10px 11px;

  border:0;

  border-radius:8px;

  background:transparent;

  color:#e8edf2;

  text-decoration:none;

  text-align:left;

  font:inherit;

  font-size:13px;

  cursor:pointer;

}

.account-menu a:hover,
.account-menu button:hover{

  background:rgba(0,188,212,.12);

}

.account-menu button{

  color:#ffb0b0;

}


/* =========================================================
   FAVORIS / LIVRES LUS
========================================================= */

.favorite-toggle{

  position:absolute;

  top:10px;

  right:10px;

  width:38px;

  height:38px;

  display:inline-flex;

  align-items:center;

  justify-content:center;

  border-radius:50%;

  border:1px solid rgba(255,255,255,.16);

  background:rgba(20,8,8,.78);

  backdrop-filter:blur(8px);

  color:#fff;

  font-size:22px;

  line-height:1;

  cursor:pointer;

  z-index:20;

  box-shadow:0 5px 18px rgba(0,0,0,.25);

}

.favorite-toggle:hover{

  color:#ffd34d;

  border-color:rgba(255,211,77,.55);

  transform:scale(1.05);

}

.favorite-toggle.is-favorite{

  color:#ffd34d;

}

.read-toggle{

  margin-top:8px;

  width:100%;

  padding:9px 12px;

  border-radius:9px;

  border:1px solid rgba(255,255,255,.12);

  background:rgba(255,255,255,.05);

  color:rgba(232,237,242,.9);

  cursor:pointer;

  font-size:12px;

  font-weight:600;

}

/* Bouton « Marquer comme lu » sur les livres sortis */
.book-read-toggle{position:absolute;right:9px;top:9px;width:30px;height:30px;border-radius:8px;border:1px solid rgba(255,255,255,.14);background:rgba(0,0,0,.55);color:#e8edf2;font-size:16px;font-weight:700;cursor:pointer;z-index:20;transition:.2s;display:inline-flex;align-items:center;justify-content:center;padding:0}
.book-read-toggle:hover{background:rgba(0,188,212,.18);border-color:rgba(0,188,212,.4)}
.book-read-toggle.is-read{background:rgba(0,188,212,.16);border-color:rgba(0,188,212,.35);color:#dbfbff}

.read-toggle:hover{

  background:rgba(0,188,212,.12);

  border-color:rgba(0,188,212,.3);

}

.book-card,
.game-card,
.event-card{

  position:relative;

}

.book-card.is-read{

  opacity:.52;

  filter:saturate(.55);

}

.book-card.is-read:hover{

  opacity:.72;

}

.book-card.is-read .book-card-title{

  text-decoration:line-through;

  text-decoration-color:rgba(232,237,242,.4);

}


/* =========================================================
   FOND PAGES COMPTE
========================================================= */

html:has(body.account-page),
body.account-page{

  background:radial-gradient(
    circle at top,
    #3a090b 0%,
    #1a0203 42%,
    #070000 100%
  );

}

body.account-page{

  color:#e8edf2;

}

body.account-page .main-nav{

  background:rgba(55,18,20,.55);

}

body.account-page .auth-box,
body.account-page .profile-box,
body.account-page .settings-box{

  background:rgba(48,20,22,.72);

}


/* =========================================================
   OAUTH
========================================================= */

.oauth-help{

  margin-top:14px;

  padding:10px 12px;

  border-radius:10px;

  background:rgba(255,70,70,.08);

  border:1px solid rgba(255,100,100,.12);

  color:rgba(232,237,242,.55);

  font-size:11px;

  line-height:1.5;

}


/* =========================================================
   RESPONSIVE
========================================================= */

@media(max-width:650px){

  .auth-provider-grid,
  .settings-grid,
  .profile-stats{

    grid-template-columns:1fr;

  }


  .account-nav-wrap{

    margin-left:0;

  }


  .main-nav .account-nav-wrap{

    width:100%;

  }


  .account-nav-button{

    width:100%;

    justify-content:center;

  }


  .account-dropdown{

    width:100%;

  }


  .account-menu{

    left:0;

    right:0;

    width:auto;

  }


  .profile-head{

    align-items:flex-start;

    flex-wrap:wrap;

  }


  .edit-profile-button{

    width:100%;

    margin-left:0;

  }


  .profile-edit-grid{

    grid-template-columns:1fr;

  }


  .profile-edit-actions{

    flex-direction:column-reverse;

    align-items:stretch;

  }


  .profile-edit-actions .mini-button,
  .profile-edit-actions .auth-submit{

    width:100%;

  }


  .identity-row{

    align-items:flex-start;

    flex-direction:column;

  }


  .identity-action{

    width:100%;

  }

}

.auth-provider {
  display:flex; align-items:center; justify-content:center; gap:9px;
}
.auth-provider .provider-logo {
  width:17px; height:17px; object-fit:contain; flex:0 0 17px; filter:brightness(0) invert(1);
}

.identity-name .provider-logo{width:17px;height:17px;object-fit:contain;vertical-align:-3px;filter:brightness(0) invert(1);}


.profile-badges{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
.profile-badge-item{display:flex;align-items:center;gap:12px;padding:10px;border-radius:12px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.06)}
.profile-badge-item img{width:58px;height:58px;object-fit:contain;flex:none;border-radius:9px;background:rgba(0,0,0,.12)}
.profile-badge-item div{min-width:0;display:flex;flex-direction:column;gap:3px}.profile-badge-item small{font-size:10px;color:rgba(0,188,212,.75)}.profile-badge-item strong{font-family:"Barlow Condensed",sans-serif;text-transform:uppercase;letter-spacing:.4px;line-height:1.15}.profile-badge-item span{font-size:9px;color:rgba(232,237,242,.4);line-height:1.3}

/* Collections du profil : affichage en une ligne avec défilement horizontal */
.profile-section .favorite-list,
.profile-section .profile-badges {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}

.profile-section .profile-media-item {
  position: relative;
  flex: 0 0 118px;
  width: 118px;
  height: 150px;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  box-sizing: border-box;
}

.profile-section .profile-media-item img,
.profile-section .profile-media-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-section .profile-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 36px;
  background: rgba(255,255,255,.06);
}

.profile-section .profile-media-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 20px;
  line-height: 26px;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  opacity: 1;
  transition: transform .15s ease;
}

.profile-section .profile-media-remove:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.profile-section .profile-media-remove:hover {
  transform: scale(1.08);
}

.profile-section .profile-media-item .favorite-remove {
  z-index: 2;
  top: 8px;
  right: 8px;
  transform: none;
  width: 30px;
  height: 30px;
  font-size: 14px;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(5px);
}

.profile-section .profile-media-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.16);
}

.profile-section .profile-badge-item img {
  object-fit: contain;
  background: rgba(0,0,0,.12);
}

@media (max-width: 700px) {
  .profile-section .profile-media-item {
    flex-basis: 100px;
    width: 100px;
    height: 128px;
  }
}
