/* ============================================================
   COCOLOVE — Mon profil
   Fichier : Profil/profil.css
   Style sobre / professionnel, cohérent avec inscription.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-dark:        #0d0d14;
  --bg-card:        #161622;
  --bg-card-hover:  #1c1c2a;
  --primary-pink:   #ff3366;
  --primary-orange: #ff6666;
  --text-light:     #ffffff;
  --text-secondary: #b8b8c8;
  --text-muted:     #8e8e9f;
  --border-color:   #2a2a35;
  --success:        #10B981;
  --danger:         #ff5577;
  --warning:        #F59E0B;
  --radius:         10px;
  --radius-md:      14px;
  --radius-lg:      18px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
}

/* ─── Topbar (identique au reste du site) ───────────────────── */
.cl-topbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.4);
}
.cl-back-btn {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-light);
  text-decoration: none;
  transition: background .2s;
}
.cl-back-btn:hover { background: rgba(255,255,255,.08); }
.cl-back-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.cl-topbar-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-light);
}

/* ─── Page wrapper ───────────────────────────────────────────── */
.pf-page {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  padding: 24px 14px 100px;
}
.pf-page { gap: 0; }
.pf-header-card, .pf-quick-actions, .pf-section, .pf-logout-btn { width: 100%; }

/* En mobile, ces wrappers ne changent rien au flux : ils s'effacent */
.pf-left-col, .pf-right-col { display: contents; }

/* ─── Identité (avatar + nom compacts, côte à côte) ──────────── */
.pf-header-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 4px 30px;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 16px;
  position: relative;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.pf-avatar-wrap { position: relative; margin-bottom: 0; flex-shrink: 0; }
.pf-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-pink), var(--primary-orange));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.pf-avatar-initials { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: .5px; }
.pf-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.pf-avatar.uploading { opacity: .55; }

.pf-avatar-edit {
  position: absolute;
  right: -2px; bottom: -2px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 2px solid var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  transition: background .2s, transform .15s;
}
.pf-avatar-edit:hover { background: #1c1c2a; }
.pf-avatar-edit:active { transform: scale(.94); }
.pf-avatar-edit svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.1; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.pf-identity { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.pf-name-row { display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.pf-name { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }

.pf-premium-badge {
  display: none;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: linear-gradient(90deg, #F59E0B, #FFD166);
  color: #241a00;
}
.pf-premium-badge.show { display: inline-flex; }
.pf-premium-badge svg { width: 11px; height: 11px; stroke: #241a00; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.pf-email { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.pf-edit-name-btn {
  margin-top: 0;
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  background: transparent;
  border: none;
  color: var(--primary-pink);
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 700;
  padding: 6px 4px;
  cursor: pointer;
  transition: opacity .2s;
  align-self: center;
}
.pf-edit-name-btn:hover { opacity: .8; }
.pf-edit-name-btn svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2.1; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Actions rapides (plates, façon YouTube) ────────────────── */
.pf-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-bottom: 28px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}
.pf-qa {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 14px 6px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer;
  transition: background .15s;
  font-family: 'Inter', sans-serif;
}
.pf-qa:hover { background: rgba(255,255,255,.05); }
.pf-qa:active { background: rgba(255,255,255,.08); }
.pf-qa-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.pf-qa-icon svg { width: 19px; height: 19px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-qa-icon-publish { background: linear-gradient(135deg, var(--primary-pink), var(--primary-orange)); }
.pf-qa-icon-premium { background: linear-gradient(135deg, #F59E0B, #FFD166); }
.pf-qa-icon-premium svg { stroke: #241a00; }
.pf-qa-icon-credits { background: linear-gradient(135deg, #6366F1, #818CF8); }
.pf-qa-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }

/* ─── Sections listes (plates, lignes de séparation, façon YouTube) ─ */
.pf-section { display: flex; flex-direction: column; gap: 2px; margin-bottom: 34px; padding-bottom: 4px; border-bottom: 1px solid var(--border-color); }
.pf-section:last-of-type { border-bottom: none; }
.pf-section-title {
  font-size: 12px; font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 4px 14px;
}
.pf-list {
  background: transparent;
  border: none;
}
.pf-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 2px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-light);
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.pf-list .pf-row:last-child { border-bottom: none; }
.pf-row:hover { background: rgba(255,255,255,.04); }
.pf-row-icon {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.pf-row-icon svg { width: 20px; height: 20px; stroke: var(--text-secondary); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pf-row-label { flex: 1; }
.pf-row-chevron { width: 16px; height: 16px; stroke: var(--text-muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ─── Déconnexion (ligne plate) ───────────────────────────────── */
.pf-logout-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: transparent;
  border: none;
  color: var(--danger);
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 700;
  padding: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.pf-logout-btn:hover { background: rgba(255,85,119,.07); }
.pf-logout-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Modale générique (édition, premium, crédits, mdp) ──────── */
.pf-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,5,10,.72);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 500;
}
.pf-modal-overlay.open { opacity: 1; pointer-events: auto; }
.pf-modal {
  width: 100%; max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 28px;
  transform: translateY(24px);
  transition: transform .25s;
  max-height: 86vh;
  overflow-y: auto;
}
.pf-modal-overlay.open .pf-modal { transform: translateY(0); }
.pf-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.pf-modal-title { font-size: 17px; font-weight: 800; }
.pf-modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: none;
  color: var(--text-light);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.pf-modal-close svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pf-modal-body { display: flex; flex-direction: column; gap: 16px; }

/* Champs de formulaire dans les modales (réutilise le style cl-input) */
.pf-field { display: flex; flex-direction: column; gap: 7px; }
.pf-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.pf-input {
  width: 100%; height: 46px;
  padding: 0 4px;
  border: none;
  border-bottom: 1.5px solid var(--border-color);
  font-size: 14.5px;
  font-family: 'Inter', sans-serif;
  color: var(--text-light);
  background: transparent;
  outline: none;
  transition: border-color .2s;
}
.pf-input:focus { border-bottom-color: var(--primary-pink); border-bottom-width: 2px; }
.pf-err { font-size: 12px; color: var(--danger); font-weight: 600; min-height: 15px; }

.pf-modal-btn {
  height: 48px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(90deg, var(--primary-pink), var(--primary-orange));
  color: #fff;
  font-size: 14.5px; font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .2s, transform .15s;
  position: relative;
}
.pf-modal-btn:hover { opacity: .92; }
.pf-modal-btn:active { transform: scale(.98); }
.pf-modal-btn:disabled { opacity: .5; cursor: not-allowed; }
.pf-modal-loader {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pf-spin .7s linear infinite;
}
@keyframes pf-spin { to { transform: rotate(360deg); } }
.pf-modal-btn.loading .pf-modal-loader { display: inline-block; }
.pf-modal-btn.loading .pf-modal-btn-txt { opacity: .5; }

/* Cartes options (plans premium / packs crédits) */
.pf-option-list { display: flex; flex-direction: column; gap: 10px; }
.pf-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.pf-option.selected { border-color: var(--primary-pink); background: rgba(255,51,102,.07); }
.pf-option-left { display: flex; flex-direction: column; gap: 2px; }
.pf-option-title { font-size: 14px; font-weight: 700; }
.pf-option-sub { font-size: 12px; color: var(--text-muted); }
.pf-option-price { font-size: 14.5px; font-weight: 800; color: var(--primary-pink); white-space: nowrap; }
.pf-option-tag {
  font-size: 10px; font-weight: 800;
  background: linear-gradient(90deg, #F59E0B, #FFD166);
  color: #241a00;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 8px;
}
.pf-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; text-align: center; }

/* Ligne solde de crédits dans la modale */
.pf-credit-balance {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.3);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 14px; font-weight: 700;
}
.pf-credit-balance svg { width: 16px; height: 16px; stroke: #818CF8; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Modale de confirmation (déconnexion, etc.) ─────────────── */
.pf-confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(5,5,10,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 600;
}
.pf-confirm-overlay.open { opacity: 1; pointer-events: auto; }
.pf-confirm {
  width: 100%; max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  transform: scale(.94);
  transition: transform .2s;
}
.pf-confirm-overlay.open .pf-confirm { transform: scale(1); }
.pf-confirm-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.pf-confirm-text { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 20px; }
.pf-confirm-actions { display: flex; gap: 10px; }
.pf-confirm-cancel, .pf-confirm-ok {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px; font-weight: 700;
  cursor: pointer;
}
.pf-confirm-cancel { background: rgba(255,255,255,.06); color: var(--text-light); }
.pf-confirm-cancel:hover { background: rgba(255,255,255,.1); }
.pf-confirm-ok { background: var(--danger); color: #fff; }
.pf-confirm-ok:hover { opacity: .9; }

/* ─── Toast ──────────────────────────────────────────────────── */
.pf-toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  max-width: 90vw;
  text-align: center;
}
.pf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pf-toast.success { border-color: var(--success); }
.pf-toast.error   { border-color: var(--danger); }
.pf-toast.info    { border-color: #6366F1; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (min-width: 640px) {
  .pf-page { padding: 32px 24px 90px; }
}

/* Desktop : 2 colonnes — gauche = identité/actions (sticky), droite = listes */
@media (min-width: 900px) {
  .cl-topbar { padding: 0 40px; }

  .pf-page {
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    gap: 32px;
  }
  .pf-page > * { max-width: none; }

  /* Colonne gauche : identité + actions rapides, groupées et sticky */
  .pf-left-col {
    display: flex;
    width: 320px;
    flex-shrink: 0;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: 24px;
    align-self: start;
  }

  .pf-header-card {
    flex-direction: column;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 20px 26px;
    margin-bottom: 22px;
  }
  .pf-avatar-wrap { margin-bottom: 14px; }
  .pf-avatar { width: 88px; height: 88px; }
  .pf-avatar-initials { font-size: 30px; }
  .pf-avatar-edit { width: 32px; height: 32px; }
  .pf-avatar-edit svg { width: 15px; height: 15px; }

  .pf-identity { align-items: center; }
  .pf-name-row { justify-content: center; }
  .pf-name { font-size: 19px; }
  .pf-email { white-space: normal; }
  .pf-edit-name-btn { margin-top: 12px; align-self: center; }

  .pf-quick-actions { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

  /* Colonne droite : les sections (Mon compte / Paramètres / déconnexion) */
  .pf-right-col {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
  }
}
