/* compte.css — Espace compte client (connexion, profil, mes-labels)          */
/* Tokens --ih-* et composants de base fournis par site.css                   */

/* ====================================================================
   BODY
   ==================================================================== */
.ih-body {
  font-family: var(--ih-sans);
  background: var(--ih-paper);
  color: var(--ih-ink);
}

/* ====================================================================
   CONNEXION — Split layout 45 / 55
   ==================================================================== */
.cx-layout {
  display: flex;
  min-height: calc(100dvh - 70px); /* sous le nav */
}

/* ── Panel gauche — branding sombre ─────────────────── */
.cx-left {
  flex: 0 0 44%;
  position: relative;
  overflow: hidden;
  background: var(--ih-gradient-dark);
  display: flex;
  flex-direction: column;
  padding: 3.5rem 3rem;
}

/* Grille de points */
.cx-left__dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(244, 12, 123, 0.18) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Glow */
.cx-left__glow {
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(244, 12, 123, 0.18) 0%, transparent 60%);
  pointer-events: none;
}

/* Noise */
.cx-left__noise {
  position: absolute;
  inset: 0;
  background-image: var(--ih-noise);
  opacity: 0.30;
  pointer-events: none;
}

/* Badge watermark */
.cx-left__watermark {
  position: absolute;
  bottom: -3rem;
  right: -3rem;
  width: 22rem;
  height: auto;
  opacity: 0.055;
  pointer-events: none;
  user-select: none;
}

/* Logo */
.cx-left__logo {
  position: relative;
  z-index: 1;
  height: 2.5rem;
  width: auto;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
  animation: fade-up 0.5s ease-out both;
}

/* Contenu textuel */
.cx-left__body {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: auto;
  padding: 2.5rem 0 1.5rem;
  animation: fade-up 0.5s 0.1s ease-out both;
}

.cx-left__eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 176, 203, 0.70);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cx-left__eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--ih-rose-vif);
  flex-shrink: 0;
}

.cx-left__title {
  font-family: var(--ih-serif);
  font-size: clamp(1.6rem, 2.8vw, 2.4rem);
  font-weight: 400;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 1.25rem;
}

.cx-left__title em {
  font-style: normal;
  background: var(--ih-gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cx-left__desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.7;
  max-width: 300px;
}

/* Lien retour en bas */
.cx-left__back {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.18s;
  animation: fade-up 0.5s 0.2s ease-out both;
}

.cx-left__back:hover { color: rgba(255, 255, 255, 0.70); }

.cx-left__back-icon {
  width: 13px;
  height: 13px;
}

/* ── Panel droit — formulaires ──────────────────────── */
.cx-right {
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
}

/* Ligne verticale décorative séparatrice — visible via border-left sur cx-right */
.cx-right::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--ih-border) 30%, var(--ih-border) 70%, transparent);
}

.cx-form-panel {
  width: 100%;
  max-width: 380px;
  animation: fade-up 0.45s 0.15s ease-out both;
}

/* En-tête du formulaire */
.cx-form-heading {
  margin-bottom: 2.25rem;
}

.cx-form-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(244, 12, 123, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(244, 12, 123, 0.15);
}

.cx-form-icon svg {
  width: 18px;
  height: 18px;
  color: var(--ih-rose-vif);
}

.cx-form-title {
  font-family: var(--ih-serif);
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--ih-ink);
  margin-bottom: 0.4rem;
  line-height: 1.15;
}

.cx-form-sub {
  font-size: 0.85rem;
  color: var(--ih-ink-soft);
  opacity: 0.70;
  line-height: 1.6;
}

/* Vues gérées par connexion.js via el.hidden — on les stylise ici         */
/* connexion.js fait showView(id) → el.hidden = v !== id sur les 4 vues    */

/* Input */
.cx-input {
  display: block;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--ih-border);
  border-radius: var(--ih-radius);
  font-family: var(--ih-sans);
  font-size: 0.9rem;
  color: var(--ih-ink);
  background: var(--ih-paper);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.cx-input:focus {
  border-color: var(--ih-rose-vif);
  box-shadow: 0 0 0 3px rgba(244, 12, 123, 0.12);
}

.cx-input::placeholder { color: #b09ab8; }

/* Label du champ */
.cx-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ih-ink-soft);
  margin-bottom: 0.5rem;
  opacity: 0.75;
}

/* Bouton principal du formulaire connexion */
.cx-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.88rem 1.5rem;
  background: var(--ih-rose-vif);
  color: #fff;
  border: none;
  border-radius: var(--ih-radius);
  font-family: var(--ih-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
  letter-spacing: 0.01em;
}

.cx-btn:hover { background: #d10a68; box-shadow: var(--ih-shadow-glow); }
.cx-btn:active { transform: scale(0.98); }
.cx-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.cx-btn-icon { width: 16px; height: 16px; }

/* Vue : lien envoyé */
.cx-sent-icon {
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(244, 12, 123, 0.07);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(244, 12, 123, 0.15);
}

.cx-sent-icon svg { width: 24px; height: 24px; color: var(--ih-rose-vif); }

.cx-view-title {
  font-family: var(--ih-serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--ih-ink);
  margin-bottom: 0.6rem;
  line-height: 1.25;
}

.cx-view-sub {
  font-size: 0.85rem;
  color: var(--ih-ink-soft);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

/* Lien discret */
.cx-link {
  font-size: 0.82rem;
  color: var(--ih-rose-neon);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.15s;
}

.cx-link:hover { color: var(--ih-rose-vif); }

/* Spinner */
.cx-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid var(--ih-border);
  border-top-color: var(--ih-rose-vif);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Vue : erreur */
.cx-error-icon {
  width: 3rem;
  height: 3rem;
  color: var(--ih-rose-vif);
  margin: 0 auto 1rem;
  display: block;
}

/* Bouton outline */
.cx-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  background: transparent;
  color: var(--ih-ink);
  border: 1.5px solid var(--ih-border);
  border-radius: var(--ih-radius);
  font-family: var(--ih-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s;
}

.cx-btn-outline:hover { border-color: var(--ih-rose-vif); color: var(--ih-rose-vif); }

/* ── Auth notice (shared with compte pages) ──────────── */
.ih-auth-notice {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 440px;
  margin: 0 auto;
}

/* ====================================================================
   COMPTE — Layout partagé (index.html + mes-labels.html)
   ==================================================================== */
.cp-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* Grille sidebar + main */
.cp-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* ── Sidebar ─────────────────────────────────────────── */
.cp-sidebar {
  position: sticky;
  top: 5rem;
}

.cp-sidebar__section {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ih-ink-soft);
  opacity: 0.50;
  padding: 0 0.5rem 0.6rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--ih-border);
  margin-bottom: 0.5rem;
}

.cp-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ih-ink-soft);
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--ih-sans);
}

.cp-nav-link:hover {
  background: rgba(244, 12, 123, 0.06);
  color: var(--ih-ink);
}

.cp-nav-link.active {
  background: rgba(244, 12, 123, 0.09);
  color: var(--ih-rose-vif);
  font-weight: 600;
}

.cp-nav-link--signout {
  color: var(--ih-ink-soft);
  opacity: 0.60;
  margin-top: 0.5rem;
}

.cp-nav-link--signout:hover { opacity: 1; color: var(--ih-ink); background: rgba(0,0,0,0.04); }

.cp-nav-icon { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Profil header — avatar + nom ────────────────────── */
.cp-profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--ih-border);
  animation: fade-up 0.4s ease-out both;
}

.cp-avatar {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background: var(--ih-gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ih-serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--ih-shadow-glow);
  user-select: none;
}

.cp-profile-name {
  font-family: var(--ih-serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ih-ink);
  line-height: 1.2;
}

.cp-profile-email {
  font-size: 0.8rem;
  color: var(--ih-ink-soft);
  opacity: 0.60;
  margin-top: 0.2rem;
}

/* ── Section titre page ──────────────────────────────── */
.cp-page-title {
  font-family: var(--ih-serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--ih-ink);
  margin-bottom: 1.75rem;
  line-height: 1.2;
  animation: fade-up 0.4s ease-out both;
}

/* ── Formulaire profil ───────────────────────────────── */
.cp-form-card {
  background: #fff;
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--ih-shadow-soft);
  animation: fade-up 0.4s 0.05s ease-out both;
}

.cp-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.cp-legend {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ih-ink-soft);
  opacity: 0.55;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ih-border);
  width: 100%;
  display: block;
}

.cp-field {
  margin-bottom: 1.1rem;
}

.cp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.cp-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ih-ink-soft);
  opacity: 0.75;
  margin-bottom: 0.4rem;
}

.cp-input {
  display: block;
  width: 100%;
  padding: 0.7rem 0.875rem;
  border: 1.5px solid var(--ih-border);
  border-radius: var(--ih-radius);
  font-family: var(--ih-sans);
  font-size: 0.88rem;
  color: var(--ih-ink);
  background: var(--ih-paper);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.cp-input:focus {
  border-color: var(--ih-rose-vif);
  box-shadow: 0 0 0 3px rgba(244, 12, 123, 0.10);
}

.cp-input:disabled {
  opacity: 0.50;
  cursor: not-allowed;
  background: #f5f0f5;
}

.cp-input::placeholder { color: #c0a8c8; }

.cp-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2383608c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.cp-hint {
  font-size: 0.73rem;
  color: var(--ih-ink-soft);
  opacity: 0.60;
  margin-top: 0.3rem;
  line-height: 1.5;
}

.cp-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.5rem;
  background: var(--ih-rose-vif);
  color: #fff;
  border: none;
  border-radius: var(--ih-radius);
  font-family: var(--ih-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
}

.cp-btn-save:hover { background: #d10a68; box-shadow: var(--ih-shadow-glow); }
.cp-btn-save:active { transform: scale(0.98); }

.cp-btn-icon { width: 15px; height: 15px; }

.cp-save-success {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #15803d;
  margin-top: 0.75rem;
  animation: fade-up 0.25s ease-out;
}

/* ── Labels — état chargement/erreur/vide/liste ──────── */
.cp-labels-wrap {
  animation: fade-up 0.4s 0.05s ease-out both;
}

.cp-labels-loader {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ih-ink-soft);
  opacity: 0.60;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.cp-labels-loader__spin {
  width: 1.75rem;
  height: 1.75rem;
  border: 2.5px solid var(--ih-border);
  border-top-color: var(--ih-rose-vif);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.cp-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.cp-empty__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  color: var(--ih-border);
}

.cp-empty__title {
  font-family: var(--ih-serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--ih-ink);
  margin-bottom: 0.5rem;
}

.cp-empty__sub {
  font-size: 0.85rem;
  color: var(--ih-ink-soft);
  opacity: 0.65;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ── Tableau labels ─────────────────────────────────────────────── */
.cp-labels-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.cp-labels-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ih-ink-soft);
  border-bottom: 2px solid var(--ih-border);
  white-space: nowrap;
}

.cp-labels-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--ih-border);
  vertical-align: middle;
  color: var(--ih-ink);
}

.cp-labels-table tr:last-child td { border-bottom: none; }

.cp-labels-table tr:hover td { background: var(--ih-paper); }

/* Statut badges */
.cp-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.cp-status--approved  { background: #dcfce7; color: #166534; }
.cp-status--pending   { background: #fef9c3; color: #854d0e; }
.cp-status--rejected  { background: #fee2e2; color: #991b1b; }
.cp-status--revoked   { background: #f1f5f9; color: #475569; }
.cp-status--under_review { background: #e0f2fe; color: #075985; }

/* ── Modal badges téléchargeables ─────────────────────────────── */
.cp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.cp-modal {
  background: #fff;
  border-radius: 1.25rem;
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
}

.cp-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ih-ink-soft);
  padding: 0.25rem;
}

.cp-modal__title {
  font-family: var(--ih-serif);
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.cp-modal__sub {
  font-size: 0.82rem;
  color: var(--ih-ink-soft);
  margin-bottom: 1.25rem;
}

.cp-badges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.cp-badge-item {
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius);
  padding: 0.75rem;
  text-align: center;
}

.cp-badge-item img {
  max-width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.cp-badge-item__name {
  font-size: 0.72rem;
  color: var(--ih-ink-soft);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.cp-badge-dl {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--ih-rose-vif);
  text-decoration: none;
  font-weight: 600;
}
.cp-badge-dl:hover { text-decoration: underline; }

/* Labels card container */
.cp-labels-card {
  background: #fff;
  border: 1px solid var(--ih-border);
  border-radius: var(--ih-radius-lg);
  overflow: hidden;
  box-shadow: var(--ih-shadow-soft);
}

.cp-labels-footer {
  font-size: 0.78rem;
  color: var(--ih-ink-soft);
  opacity: 0.60;
  margin-top: 1rem;
  line-height: 1.5;
}

/* ====================================================================
   UTILITY — classes attendues par les inline scripts
   ==================================================================== */
.font-semibold { font-weight: 600; }
.text-sm { font-size: 0.875rem; }

/* ====================================================================
   RESPONSIVE
   ==================================================================== */
@media (max-width: 768px) {
  /* Connexion : masquer le panel gauche */
  .cx-left { display: none; }
  .cx-right { padding: 2.5rem 1.5rem; min-height: calc(100dvh - 70px); }
  .cx-right::before { display: none; }

  /* Compte : sidebar en haut */
  .cp-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .cp-sidebar { position: static; }

  /* Sidebar nav horizontal sur mobile */
  .cp-sidebar > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
  }

  .cp-sidebar__section { display: none; }
}

@media (max-width: 480px) {
  .cp-form-card { padding: 1.25rem 1.1rem; }
  .cp-grid-2 { grid-template-columns: 1fr; }
  .cp-badges-grid { grid-template-columns: 1fr; }
  .cp-labels-table { font-size: 0.75rem; }
  .cp-labels-table th, .cp-labels-table td { padding: 0.5rem; }
}
