/* ==========================================================================
   PROCANVAS — ESPACE CLIENT · NOUVEAU TABLEAU DE BORD
   --------------------------------------------------------------------------
   Ordre de la page (du haut vers le bas) :
     1. Bandeau d'accueil (photo)          → .dash-hero   [compte-design.css]
     2. Notification d'état du compte      → .ac-status   (AUCUN bouton)
     3. Ma commande (suivi + identifiants) → #acOrders
     4. Vos bonus offerts                  → #acBonus
     5. Offres réservées aux clients       → #acOffers
     6. Nous écrire (formulaire + réponses)→ #acMessages
     7. Aide & déconnexion                 → .ac-help
   Chargée EN DERNIER par compte.html.
   ========================================================================== */

/* Le attribut hidden doit toujours gagner, quelle que soit la page */
[hidden] { display: none !important; }

/* =========================== 2. NOTIFICATION ============================ */
.ac-status {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: var(--pp-r-lg);
  border: 1px solid transparent;
  box-shadow: var(--pp-sh-1);
  position: relative;
  overflow: hidden;
}
.ac-status::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .55), transparent 70%);
  pointer-events: none;
}
.ac-status[data-state="active"] {
  border-color: #BCEBD0;
  background:
    radial-gradient(80% 160% at 100% 0%, rgba(0, 196, 204, .22), transparent 60%),
    linear-gradient(135deg, #ECFDF3 0%, #F3FDFA 55%, #EAFBFC 100%);
  box-shadow: 0 18px 40px -30px rgba(18, 163, 74, .9);
}
.ac-status[data-state="progress"] {
  border-color: #B6EFF1;
  background:
    radial-gradient(80% 160% at 100% 0%, rgba(125, 42, 232, .16), transparent 60%),
    linear-gradient(135deg, #E6FBFC 0%, #F2FCFD 55%, #F7F4FF 100%);
}
.ac-status[data-state="waiting"] {
  border-color: #FBE4B3;
  background:
    radial-gradient(80% 160% at 100% 0%, rgba(255, 196, 61, .2), transparent 60%),
    linear-gradient(135deg, #FFF7E6 0%, #FFFCF3 55%, #FFF9EF 100%);
}
.ac-status[data-state="empty"] {
  border-color: #E4DBFB;
  background:
    radial-gradient(80% 160% at 100% 0%, rgba(125, 42, 232, .14), transparent 60%),
    linear-gradient(135deg, #F8F5FF 0%, #F4F7FF 60%, #EFFBFC 100%);
}
.ac-status-ic {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #9AA3BD, #7C86A8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 10px 22px -12px rgba(11, 16, 51, .7);
}
.ac-status[data-state="active"] .ac-status-ic { background: linear-gradient(135deg, #12A34A, #3ED598); box-shadow: 0 10px 22px -10px rgba(18, 163, 74, .9), inset 0 1px 0 rgba(255, 255, 255, .5); }
.ac-status[data-state="progress"] .ac-status-ic { background: linear-gradient(135deg, #7D2AE8, #00C4CC); box-shadow: 0 10px 22px -10px rgba(125, 42, 232, .8), inset 0 1px 0 rgba(255, 255, 255, .5); }
.ac-status[data-state="waiting"] .ac-status-ic { background: linear-gradient(135deg, #E9A200, #FFC93C); }
.ac-status-txt { min-width: 0; flex: 1; }
.ac-status-kicker {
  margin: 0 0 5px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--pp-muted);
}
.ac-status[data-state="active"] .ac-status-kicker { color: #0F7A3B; }
.ac-status-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--pp-ink);
  overflow-wrap: anywhere;
}
.ac-status-sub {
  margin: 7px 0 0;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--pp-muted);
}
.ac-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
.ac-status-meta li {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--pp-ink-2);
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(11, 16, 51, .07);
  border-radius: 999px;
  padding: 6px 13px;
}

/* ============================== PANNEAUX =============================== */
.ac-panel {
  margin-top: 18px;
  padding: 24px 26px 26px;
  background: #fff;
  border: 1px solid var(--pp-line);
  border-radius: var(--pp-r);
  box-shadow: var(--pp-sh-1);
}
.ac-panel--bonus {
  background:
    radial-gradient(70% 130% at 100% 0%, rgba(125, 42, 232, .1), transparent 62%),
    radial-gradient(60% 120% at 0% 100%, rgba(0, 196, 204, .1), transparent 60%),
    #fff;
}
.ac-panel--offers {
  background:
    radial-gradient(70% 130% at 100% 0%, rgba(255, 196, 61, .16), transparent 62%),
    #fff;
}
.ac-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.ac-head-ic {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.3rem;
  line-height: 1;
  background: linear-gradient(135deg, #F4EFFF, #EAFBFC);
  border: 1px solid #E7E0FF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}
.ac-head-txt { flex: 1; min-width: 0; }
.ac-head-txt h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--pp-ink);
}
.ac-head-txt p {
  margin: 3px 0 0;
  font-size: .83rem;
  line-height: 1.5;
  color: var(--pp-muted);
}
.ac-chip {
  flex: none;
  margin-left: auto;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--pp-violet);
  background: #F4EFFF;
  border: 1px solid #E4DBFB;
  border-radius: 999px;
  padding: 7px 14px;
}
.ac-head .status-badge { margin-left: auto; }

/* ============================ 3. MA COMMANDE =========================== */
.ac-orders {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ac-orders .order-item { padding: 18px 18px 18px 22px; }
.orders-empty {
  display: block;
  padding: 16px 18px;
  font-weight: 600;
}

/* ============================== 4. BONUS =============================== */
.ac-bonus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.ac-bonus-grid:empty { display: none; }
.bonus-dl {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--pp-line);
  border-radius: 16px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.bonus-dl:hover {
  transform: translateY(-3px);
  box-shadow: var(--pp-sh-1);
  border-color: #DDD5FA;
}
.bonus-dl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.bonus-dl-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  padding: 6px;
  background: #FBFAFF;
  border: 1px solid var(--pp-line);
  border-radius: 14px;
}
.bonus-dl-val {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: #00787D;
  background: #E6FBFC;
  border: 1px solid #B6EFF1;
  border-radius: 999px;
  padding: 5px 11px;
}
.bonus-dl h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--pp-ink);
}
.bonus-dl p {
  margin: 0;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--pp-muted);
}
.bonus-dl-meta span {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--pp-ink-2);
  background: #FAFBFE;
  border: 1px solid var(--pp-line-2);
  border-radius: 999px;
  padding: 5px 11px;
}
/* Verrouillé : cadenas, aucun bouton */
.ac-panel--bonus:not(.unlocked) .bonus-dl {
  background: linear-gradient(180deg, #FBFCFE, #F6F8FD);
  border-style: dashed;
  border-color: #D7DDEE;
}
.ac-panel--bonus:not(.unlocked) .bonus-dl:hover {
  transform: none;
  box-shadow: none;
  border-color: #D7DDEE;
}
.bonus-dl-lock {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 14px;
  font-size: .77rem;
  font-weight: 700;
  color: var(--pp-muted);
  background: #fff;
  border: 1px dashed #CBD3E8;
  border-radius: 12px;
  text-align: center;
}
.ac-panel--bonus.unlocked .bonus-dl-lock { display: none; }
.ac-panel--bonus:not(.unlocked) .bonus-dl-btn { display: none; }
.bonus-dl-btn {
  margin-top: auto;
  min-height: 46px;
  font-size: .87rem;
}
.bonus-dl-btn::after { content: '\2193'; font-weight: 800; }
.ac-panel--bonus.unlocked #acBonusState {
  color: #0F7A3B;
  background: #EDFBF2;
  border-color: #C4EED5;
  box-shadow: 0 8px 18px -12px rgba(18, 163, 74, .9);
}

/* ========================== 5. OFFRES MEMBRES ========================== */
.ac-offer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.ac-offer-grid:empty { display: none; }
.ac-offer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFBFF 100%);
  border: 1px solid var(--pp-line);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ac-offer::after {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 42, 232, .12), transparent 70%);
  pointer-events: none;
}
.ac-offer:hover {
  transform: translateY(-3px);
  box-shadow: var(--pp-sh-1);
  border-color: #DDD5FA;
}
.ac-offer.is-owned {
  border-color: #C4EED5;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5FDF8 100%);
}
.ac-offer.is-owned::after { background: radial-gradient(circle, rgba(18, 163, 74, .14), transparent 70%); }
.ac-offer-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ac-offer-ic {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-size: 1.2rem;
  line-height: 1;
  background: linear-gradient(135deg, #F4EFFF, #EAFBFC);
  border: 1px solid #E7E0FF;
}
.ac-offer-tag {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pp-violet);
  background: #F4EFFF;
  border: 1px solid #E4DBFB;
  border-radius: 999px;
  padding: 5px 11px;
}
.ac-offer h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--pp-ink);
}
.ac-offer-desc {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: .81rem;
  line-height: 1.55;
  color: var(--pp-muted);
}
.ac-offer-price {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.ac-offer-price strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.03em;
  background: var(--pp-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ac-offer-price del { font-size: .92rem; color: #9AA3BD; font-weight: 600; }
.ac-offer-member {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0F7A3B;
  background: #EDFBF2;
  border: 1px solid #C4EED5;
  border-radius: 999px;
  padding: 4px 10px;
}
.ac-offer-cta {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}
.ac-offer-owned {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  font-size: .84rem;
  font-weight: 800;
  color: #0F7A3B;
  background: #EDFBF2;
  border: 1px dashed #A9E5C4;
  border-radius: 12px;
}
.ac-offer-note {
  margin: 16px 0 0;
  padding: 11px 15px;
  font-size: .77rem;
  line-height: 1.55;
  color: var(--pp-muted);
  background: #F7F9FF;
  border: 1px dashed #DDE3F2;
  border-radius: 12px;
}

/* ========================= 6. NOUS ÉCRIRE ============================== */
.ac-msg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.ac-field { margin-bottom: 14px; }
.ac-field label {
  display: block;
  margin-bottom: 7px;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pp-muted);
}
.ac-req { color: var(--pp-violet); }
.ac-field .form-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 15px;
  font-size: .93rem;
  background: #FBFCFE;
  border: 1.5px solid var(--pp-line);
  border-radius: 13px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ac-field textarea.form-input { min-height: 138px; resize: vertical; line-height: 1.55; }
.ac-field .form-input::placeholder { color: #9AA3BD; }
.ac-field .form-input:focus {
  background: #fff;
  border-color: var(--pp-violet);
  box-shadow: 0 0 0 4px rgba(125, 42, 232, .14);
}
.ac-msg-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ac-msg-status { font-size: .8rem; font-weight: 700; color: var(--pp-muted); }
.ac-msg-status.ok { color: #0F7A3B; }
.ac-msg-status.err { color: #B91C1C; }
.ac-msg-send { min-height: 48px; padding: 0 22px; }
.ac-msg-send:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.ac-thread {
  padding: 18px;
  background: #FAFBFE;
  border: 1px solid var(--pp-line);
  border-radius: 16px;
}
.ac-thread-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: .95rem;
  font-weight: 800;
  color: var(--pp-ink);
}
.ac-thread-title .ac-chip { margin-left: auto; }
.ac-msg-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 460px;
  overflow-y: auto;
}
.msg-item {
  padding: 16px 17px;
  background: #fff;
  border: 1px solid var(--pp-line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(11, 16, 51, .04);
  transition: border-color .18s ease;
}
.msg-item:hover { border-color: #DDD5FA; }
.msg-item.replied { border-color: #CFEEDC; background: linear-gradient(180deg, #F6FDF9, #fff 55%); }
.msg-top strong { font-size: .93rem; }
.msg-meta { font-size: .74rem; }
.msg-body {
  font-size: .85rem;
  background: #FAFBFE;
  border: 1px solid var(--pp-line-2);
  border-radius: 12px;
  padding: 11px 13px;
}
.msg-reply {
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, var(--pp-violet), var(--pp-cyan)) 1;
  background: linear-gradient(180deg, #F6F1FF, #F1FBFC);
  border-radius: 0 12px 12px 0;
  padding: 12px 15px;
}
.msg-reply-ic {
  display: block;
  margin-bottom: 4px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--pp-violet);
}
.msg-reply p { margin: 0; font-size: .85rem; color: var(--pp-ink-2); line-height: 1.5; }
.messages-empty {
  padding: 16px 17px;
  font-size: .85rem;
  background: #FAFBFE;
  border: 1px dashed var(--pp-line);
  border-radius: 12px;
}

/* =========================== 7. AIDE & SESSION ========================= */
.ac-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 20px 26px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--pp-r-lg);
  background:
    radial-gradient(110% 160% at 100% 0%, rgba(0, 196, 204, .34), transparent 58%),
    linear-gradient(135deg, #171B4B 0%, #2C1C78 62%, #42269F 100%);
  box-shadow: var(--pp-sh-2);
}
.ac-help-txt strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
}
.ac-help-txt p {
  margin: 5px 0 0;
  font-size: .83rem;
  color: rgba(255, 255, 255, .78);
}
.ac-help-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ac-help .btn-outline {
  min-height: 44px;
  padding: 0 18px;
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .26);
  color: #fff;
  backdrop-filter: blur(4px);
}
.ac-help .btn-outline:hover { background: #fff; color: var(--pp-ink); border-color: #fff; }
.ac-logout {
  min-height: 44px;
  padding: 0 18px;
  background: rgba(255, 110, 110, .14);
  border: 1px solid rgba(255, 140, 140, .42);
  color: #FFC9C9;
}
.ac-logout:hover { background: #DC2626; border-color: #DC2626; color: #fff; }

/* ============================== MOUVEMENT ============================== */
@media (prefers-reduced-motion: no-preference) {
  .ac-status,
  .ac-panel,
  .ac-help {
    animation: acRise .5s cubic-bezier(.16, 1, .3, 1) both;
  }
  .ac-panel:nth-of-type(2) { animation-delay: .05s; }
  .ac-panel:nth-of-type(3) { animation-delay: .1s; }
  .ac-panel:nth-of-type(4) { animation-delay: .15s; }
  .ac-help { animation-delay: .2s; }
}
@keyframes acRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ============================== RESPONSIVE ============================= */
@media (max-width: 960px) {
  .ac-bonus-grid,
  .ac-offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-msg-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  /* Le message d'accueil doit rester lisible : pas de troncature de l'e-mail */
  .dash-hello {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word;
    line-height: 1.3 !important;
  }

  .ac-status {
    margin-top: 14px;
    padding: 18px 16px;
    gap: 13px;
    border-radius: 18px;
  }
  .ac-status-ic { width: 42px; height: 42px; font-size: 1.05rem; }
  .ac-status-title { font-size: 1.02rem; }
  .ac-status-sub { font-size: .84rem; }
  .ac-status-meta li { font-size: .7rem; padding: 5px 11px; }

  .ac-panel {
    margin-top: 14px;
    padding: 20px 16px 22px;
    border-radius: 18px;
  }
  .ac-head { gap: 11px; margin-bottom: 15px; align-items: flex-start; }
  .ac-head-ic { width: 42px; height: 42px; border-radius: 13px; font-size: 1.15rem; }
  .ac-head-txt h2 { font-size: 1.02rem; }
  .ac-head-txt p { font-size: .8rem; }
  .ac-chip { padding: 6px 12px; font-size: .68rem; }
  .ac-head .status-badge { padding-top: 6px; padding-bottom: 6px; font-size: .7rem; }

  .ac-bonus-grid,
  .ac-offer-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .bonus-dl { padding: 16px 15px; }
  .ac-offer { padding: 18px 16px; gap: 9px; }
  .ac-offer-price strong { font-size: 1.55rem; }

  /* Cibles tactiles : boutons internes des commandes portés à 44 px min */
  .order-resend,
  .cred-copy,
  .canva-creds .cred-copy { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
  .access-steps a.canva-switch { display: inline-block; padding: 11px 0; }

  .ac-msg-layout { gap: 18px; }
  .ac-thread { padding: 15px 14px; }
  .ac-msg-list { max-height: none; overflow: visible; }
  .ac-msg-foot { gap: 10px; }
  .ac-msg-send { width: 100%; }
  .ac-msg-status:empty { display: none; }

  .ac-help {
    margin-top: 14px;
    padding: 20px 18px;
    border-radius: 18px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .ac-help-actions { justify-content: center; }
  .ac-help-actions .btn,
  .ac-logout { flex: 1 1 auto; min-height: 46px; }
}

@media (max-width: 480px) {
  .ac-status { flex-direction: row; }
  .ac-status-meta { gap: 6px; }
  .ac-offer-price strong { font-size: 1.45rem; }
  .ac-help-actions { flex-direction: column; }
  .ac-help-actions .btn { width: 100%; }
}
