/* D.Majin — Page Compte (nakama hub) */

.page-compte {
  --cpt-turquoise: #00f5d4;
  --cpt-jaune: #fee440;
  --cpt-violet: #9b5cff;
  background: #08090c;
}

.page-compte .page-content {
  opacity: 1;
  animation: none;
}

.page-compte .page-section {
  padding-top: 0;
}

/* — Hero — */
.cpt-hero {
  position: relative;
  min-height: clamp(16rem, 42vh, 22rem);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding:
    max(5rem, calc(env(safe-area-inset-top) + 3.5rem))
    1.25rem
    max(1.75rem, env(safe-area-inset-bottom));
  overflow: hidden;
}

.cpt-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cpt-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  animation: cptKenBurns 20s ease-in-out infinite alternate;
}

.cpt-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 9, 12, 0.25) 0%, rgba(8, 9, 12, 0.65) 55%, rgba(8, 9, 12, 0.95) 100%),
    radial-gradient(ellipse 70% 50% at 80% 15%, rgba(155, 92, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 45% at 15% 70%, rgba(0, 245, 212, 0.14), transparent 50%);
}

.cpt-hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.cpt-hero-particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cpt-turquoise);
  box-shadow: 0 0 10px var(--cpt-turquoise);
  opacity: 0;
  animation: cptParticle 5.5s ease-in-out infinite;
}

.cpt-hero-particles span:nth-child(1) { left: 14%; top: 28%; animation-delay: 0s; }
.cpt-hero-particles span:nth-child(2) { left: 72%; top: 20%; animation-delay: 1.1s; background: var(--cpt-violet); box-shadow: 0 0 10px var(--cpt-violet); }
.cpt-hero-particles span:nth-child(3) { left: 48%; top: 42%; animation-delay: 2.2s; }
.cpt-hero-particles span:nth-child(4) { left: 86%; top: 58%; animation-delay: 0.6s; }
.cpt-hero-particles span:nth-child(5) { left: 10%; top: 62%; animation-delay: 2.8s; background: var(--cpt-jaune); box-shadow: 0 0 8px var(--cpt-jaune); }

.cpt-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 40rem;
  text-align: center;
}

.cpt-hero-kicker {
  display: inline-block;
  margin: 0 0 0.65rem;
  padding: 0.3rem 0.85rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cpt-turquoise);
  border: 1px solid rgba(0, 245, 212, 0.35);
  border-radius: 999px;
  background: rgba(0, 245, 212, 0.08);
}

.cpt-hero-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: #fff;
}

.cpt-hero-title span {
  display: block;
  background: linear-gradient(90deg, var(--cpt-turquoise), var(--cpt-jaune));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cpt-hero-lead {
  margin: 0 auto;
  max-width: 30rem;
  font-size: clamp(0.92rem, 2.4vw, 1.02rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.62);
}

.cpt-hero-lead--member {
  display: none;
}

body.cpt-logged-in .cpt-hero-lead--guest {
  display: none;
}

body.cpt-logged-in .cpt-hero-lead--member {
  display: block;
}

.cpt-hero-member-name {
  color: var(--cpt-turquoise);
  font-weight: 600;
}

.cpt-hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1rem;
}

body.cpt-logged-in .cpt-hero-pills {
  display: none;
}

.cpt-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
}

.cpt-hero-pill-ic {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--cpt-turquoise);
}

/* — Shell — */
.cpt-shell {
  position: relative;
  z-index: 1;
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.15rem max(2rem, env(safe-area-inset-bottom));
}

.section-compte {
  padding: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(0, 245, 212, 0.06), transparent 55%),
    #08090c;
}

.container-compte {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Toast fixe */
.cpt-toast-wrap {
  position: sticky;
  top: max(4.5rem, calc(env(safe-area-inset-top) + 3.5rem));
  z-index: 50;
  margin-bottom: 0.5rem;
}

.cpt-toast-wrap .auth-message {
  margin: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* — Auth hub (invité) — */
.cpt-auth-hub.auth-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 0.5rem;
}

.cpt-auth-card.auth-choice-btn {
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1.15rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(0, 245, 212, 0.08), transparent 55%),
    rgba(255, 255, 255, 0.03);
  gap: 0.35rem;
}

.cpt-auth-card.auth-choice-create {
  border-color: rgba(0, 245, 212, 0.28);
}

.cpt-auth-card.auth-choice-login {
  border-color: rgba(255, 255, 255, 0.12);
}

.cpt-auth-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 245, 212, 0.55);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.cpt-auth-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.cpt-auth-card-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.25);
  color: var(--cpt-turquoise);
  flex-shrink: 0;
}

.cpt-auth-card-ic svg {
  width: 1.15rem;
  height: 1.15rem;
}

.auth-choice-icon {
  display: none;
}

.cpt-auth-card .auth-choice-title {
  font-size: 1.15rem;
  color: #fff;
}

.cpt-auth-card .auth-choice-desc {
  font-size: 0.8rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.5);
  padding-left: 2.9rem;
}

/* Formulaires */
.cpt-form-card.auth-card {
  margin: 1rem 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(100% 80% at 100% 0%, rgba(155, 92, 255, 0.08), transparent 50%),
    rgba(255, 255, 255, 0.03);
  padding: 1.35rem 1.25rem;
}

.cpt-form-card h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.cpt-form-card h2 svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--cpt-turquoise);
}

.cpt-form-card .btn-toggle-pwd {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cpt-form-card .btn-toggle-pwd svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* — Dashboard connecté — */
.cpt-dashboard.profile-panel-v2 {
  margin: 1.15rem 0 0;
  gap: 0.85rem;
}

.cpt-profile-hero.profile-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(0, 245, 212, 0.25);
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(0, 245, 212, 0.12), transparent 55%),
    radial-gradient(60% 80% at 100% 100%, rgba(155, 92, 255, 0.1), transparent 50%),
    rgba(255, 255, 255, 0.03);
}

.cpt-profile-hero-text {
  min-width: 0;
}

.cpt-profile-hero .profile-hero-title {
  font-size: clamp(1.6rem, 5vw, 2rem);
  word-break: break-word;
}

.cpt-profile-hero .profile-email {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
}

.cpt-profile-hero-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 245, 212, 0.3);
  background: rgba(0, 245, 212, 0.08);
  color: var(--cpt-turquoise);
  flex-shrink: 0;
}

.cpt-profile-hero-badge svg {
  width: 1.65rem;
  height: 1.65rem;
}

.cpt-dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 0.85rem;
  align-items: start;
}

.cpt-dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cpt-card.profile-card {
  margin: 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 1.15rem 1.1rem;
}

.cpt-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.cpt-card-head svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--cpt-turquoise);
  flex-shrink: 0;
}

.cpt-card .profile-card-title {
  margin: 0;
}

.cpt-stat-grid.profile-stat-grid {
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin: 0.5rem 0 0.85rem;
}

.cpt-stat.profile-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.65rem;
  align-items: center;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.cpt-stat-ic {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.22);
  color: var(--cpt-turquoise);
}

.cpt-stat-ic svg {
  width: 1.15rem;
  height: 1.15rem;
}

.cpt-stat .profile-stat-label {
  margin: 0;
  align-self: end;
}

.cpt-stat .profile-stat-value,
.cpt-stat .profile-desc,
.cpt-stat .companion-profile-name {
  margin: 0;
  grid-column: 2;
  font-size: 0.95rem;
}

.cpt-stat .companion-profile-preview {
  grid-column: 2;
  margin: 0;
}

.cpt-stat .companion-profile-status {
  font-size: 0.72rem;
  margin: 0 0 0.1rem;
}

.cpt-stat .btn-small {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 0.35rem;
}

.cpt-stat--companion .cpt-stat-ic {
  background: rgba(155, 92, 255, 0.12);
  border-color: rgba(155, 92, 255, 0.28);
  color: #c4b5fd;
}

.cpt-stat--crew .cpt-stat-ic {
  background: rgba(254, 228, 64, 0.1);
  border-color: rgba(254, 228, 64, 0.28);
  color: var(--cpt-jaune);
}

/* Hub tiles */
.cpt-hub-tiles.profile-quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.cpt-hub-tile {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 0.82rem !important;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.cpt-hub-tile:hover {
  border-color: rgba(0, 245, 212, 0.45) !important;
  background: rgba(0, 245, 212, 0.08) !important;
  transform: translateY(-1px);
  color: #fff !important;
}

.cpt-hub-tile svg {
  width: 1rem;
  height: 1rem;
  color: var(--cpt-turquoise);
  flex-shrink: 0;
}

.cpt-logout-bar.profile-footer {
  margin-top: 0.25rem;
}

.cpt-logout-bar .btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: auto;
  min-width: 12rem;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
}

.cpt-logout-bar .btn-logout svg {
  width: 1rem;
  height: 1rem;
}

/* Explore (invité) */
.cpt-explore {
  margin: 1.5rem 0 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.cpt-logged-in .cpt-explore {
  display: none;
}

.cpt-explore-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.cpt-explore-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.cpt-explore-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 0.5rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.cpt-explore-card:hover {
  border-color: rgba(0, 245, 212, 0.4);
  transform: translateY(-2px);
  color: #fff;
}

.cpt-explore-card svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--cpt-turquoise);
}

.cpt-explore-card--accent {
  border-color: rgba(0, 245, 212, 0.28);
  background: rgba(0, 245, 212, 0.06);
}

.cpt-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

/* Reveal */
.cpt-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.cpt-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Animations */
@keyframes cptKenBurns {
  from { transform: scale(1.02); }
  to { transform: scale(1.08); }
}

@keyframes cptParticle {
  0%, 100% { opacity: 0; transform: translateY(0); }
  45% { opacity: 0.75; transform: translateY(-10px); }
}

/* Mobile */
@media (max-width: 768px) {
  .page-compte .section-compte {
    padding: 0;
  }

  .page-compte .container-compte {
    padding: 0;
  }

  .page-compte .auth-choice-btn.cpt-auth-card {
    padding: 0.8rem 0.5rem 0.7rem;
  }

  .page-compte .page-section {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  /* Hero compact */
  .cpt-hero {
    min-height: 0;
    align-items: flex-end;
    padding:
      max(3.75rem, calc(env(safe-area-inset-top) + 2.75rem))
      0.85rem
      1.35rem;
  }

  body.cpt-view-form .cpt-hero {
    padding-bottom: 0.75rem;
  }

  body.cpt-view-profile .cpt-hero {
    padding-bottom: 1rem;
  }

  .cpt-hero-bg img {
    object-position: center 30%;
    animation: none;
  }

  .cpt-hero-particles {
    display: none;
  }

  .cpt-hero-kicker {
    margin-bottom: 0.4rem;
    padding: 0.22rem 0.65rem;
    font-size: 0.6rem;
  }

  .cpt-hero-title {
    font-size: clamp(1.85rem, 9vw, 2.35rem);
    margin-bottom: 0.25rem;
  }

  .cpt-hero-title span {
    display: inline;
    margin-left: 0.2rem;
  }

  .cpt-hero-lead--guest {
    display: none;
  }

  body.cpt-logged-in .cpt-hero-lead--member {
    font-size: 0.82rem;
    line-height: 1.4;
    max-width: 18rem;
  }

  .cpt-hero-pills {
    display: none;
  }

  /* Contenu remonté sous le hero */
  .cpt-shell {
    margin-top: -0.85rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }

  body.cpt-view-choice .cpt-shell {
    margin-top: -1.35rem;
  }

  .cpt-toast-wrap {
    top: max(3.75rem, calc(env(safe-area-inset-top) + 2.75rem));
    margin-bottom: 0.35rem;
  }

  /* Auth : 2 colonnes comme desktop, cartes compactes */
  .cpt-auth-hub.auth-choice {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0.35rem 0 0.25rem;
  }

  .cpt-auth-card.auth-choice-btn {
    padding: 0.8rem 0.5rem 0.7rem;
    align-items: center;
    text-align: center;
    border-radius: 14px;
    min-height: 0;
  }

  .cpt-auth-card-head {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
  }

  .cpt-auth-card-ic {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
  }

  .cpt-auth-card-ic svg {
    width: 1rem;
    height: 1rem;
  }

  .cpt-auth-card .auth-choice-title {
    font-size: 0.92rem;
    line-height: 1.1;
    letter-spacing: 0.04em;
  }

  .cpt-auth-card .auth-choice-desc {
    display: none;
  }

  /* Formulaires */
  .cpt-form-card.auth-card {
    margin: 0.35rem 0 0.5rem;
    padding: 1rem 0.9rem;
    border-radius: 14px;
  }

  .cpt-form-card h2 {
    font-size: 1.15rem;
    margin-bottom: 0.65rem;
  }

  /* Dashboard connecté */
  .cpt-dashboard.profile-panel-v2 {
    margin-top: 0.35rem;
    gap: 0.55rem;
  }

  .cpt-dashboard-main {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .cpt-profile-hero.profile-hero {
    grid-template-columns: 1fr auto;
    text-align: left;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
  }

  .cpt-profile-hero .profile-hero-kicker {
    font-size: 0.62rem;
  }

  .cpt-profile-hero .profile-hero-title {
    font-size: 1.45rem;
    line-height: 1;
  }

  .cpt-profile-hero .profile-email {
    font-size: 0.78rem;
    word-break: break-all;
  }

  .cpt-profile-hero-badge {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    border-radius: 11px;
  }

  .cpt-profile-hero-badge svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  .cpt-profile-hero .profile-status-badge {
    margin-left: 0;
    margin-right: 0;
    font-size: 0.62rem;
    padding: 0.25rem 0.55rem;
  }

  .cpt-card.profile-card {
    padding: 0.9rem 0.85rem;
    border-radius: 14px;
  }

  .cpt-card .profile-desc {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .profile-inline-save {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-inline-save .btn {
    width: 100%;
  }

  .cpt-stat.profile-stat {
    padding: 0.7rem 0.75rem;
  }

  .cpt-hub-tiles.profile-quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .cpt-hub-tile {
    padding: 0.62rem 0.55rem !important;
    font-size: 0.76rem !important;
    justify-content: flex-start;
  }

  .cpt-logout-bar .btn-logout {
    width: 100%;
    max-width: 100%;
  }

  /* Explore invité — 3 icônes en ligne */
  .cpt-explore {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
  }

  .cpt-explore-title {
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.08em;
  }

  .cpt-explore-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .cpt-explore-card {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.35rem;
    text-align: center;
    font-size: 0.65rem;
    line-height: 1.25;
    border-radius: 12px;
    min-height: 4.25rem;
  }

  .cpt-explore-card svg {
    width: 1.1rem;
    height: 1.1rem;
  }

  .cpt-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    font-size: 0.85rem;
  }

  /* Dressing */
  .dressing-hero {
    grid-template-columns: auto 1fr;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .dressing-preview-wrap {
    width: 72px;
    height: 72px;
  }

  .dressing-char-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .dressing-code-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dressing-code-row .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .cpt-hero-title {
    font-size: 1.75rem;
  }

  .cpt-auth-card .auth-choice-title {
    font-size: 0.86rem;
  }

  .cpt-explore-card {
    font-size: 0.6rem;
    min-height: 3.85rem;
  }
}

@media (max-width: 360px) {
  .cpt-auth-hub.auth-choice {
    gap: 0.4rem;
  }

  .cpt-auth-card.auth-choice-btn {
    padding: 0.7rem 0.35rem 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cpt-hero-bg img,
  .cpt-hero-particles span,
  .cpt-reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
