/* =========================================================================
   FLEMME — espace personnel (espace.html) et lien « Mon espace » de l'en-tête.
   Réutilise les variables et les cartes de styles.css.
   ========================================================================= */

/* En-tête : étiquette bêta + lien vers l'espace */
.head-right { display: flex; align-items: center; gap: 10px; }
.head-link { font-size: 14px; font-weight: 850; color: var(--ink); text-decoration: none; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 99px; background: #fff; }
.head-link:hover { background: var(--acid); }

/* Liens présentés comme des boutons */
.btn-link { display: inline-block; text-align: center; text-decoration: none; }
a.full { display: block; }

/* Connexion */
.espace .sent { color: var(--muted); line-height: 1.5; }
.espace .fine { display: block; margin-top: 22px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.espace .fine a { color: inherit; }
#codeForm .back, #mailForm .back, #pwdForm .back { margin: 14px 0 0; }
#code { letter-spacing: 6px; font-size: 22px; }

/* Liste des demandes */
.espace:has(#space:not([hidden])) { max-width: 820px; }
.space-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.space-head h2 { margin-bottom: 8px; }
.who { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.space-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.loading { color: var(--muted); }
.demandes { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.demande-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ref { font-size: 12px; font-weight: 850; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.demande .besoin { font-size: 19px; line-height: 1.45; margin: 16px 0 6px; overflow-wrap: anywhere; color: var(--ink); }
.meta { font-size: 13px; color: var(--muted); margin: 4px 0; }
.demande .timeline { margin-top: 22px; }
.demande .timeline div { padding-bottom: 18px; }
.timeline .refused::before { background: #c0392b; }
.team-msg { margin-top: 18px; padding: 16px 18px; border-radius: 16px; background: var(--soft); }
.team-msg b { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.team-msg p { margin: 6px 0 0; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
#empty h3 { margin-top: 0; }
#empty p { color: var(--muted); line-height: 1.5; }

/* Pastilles de statut */
.pill { font-size: 12px; font-weight: 850; padding: 6px 11px; border-radius: 99px; background: var(--soft); color: var(--ink); }
.pill-en_etude { background: #fff3c4; }
.pill-acceptee, .pill-en_cours { background: #dff5e8; color: #14532d; }
.pill-terminee { background: var(--acid); }
.pill-refusee { background: #fde8e6; color: #8a1c12; }

/* Lien de suivi sur l'écran de confirmation */
.track-box { margin-top: 6px; padding: 18px; border-radius: 16px; background: var(--soft); }
.track-box p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.track-box .primary { width: 100%; }

@media (max-width: 600px) {
  .head-link { padding: 7px 11px; font-size: 13px; }
  .head-right .beta-tag { display: none; }
  .space-actions, .space-actions > * { width: 100%; }
}

/* Connexion Google / Apple (boutons conformes aux chartes des deux marques) */
.social { display: grid; gap: 10px; margin-top: 24px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 14px 18px; border-radius: 14px; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.social-btn.google { background: #fff; color: #1f1f1f; border: 1px solid #747775; }
.social-btn.apple { background: #000; color: #fff; border: 1px solid #000; }
.social-btn:hover { filter: brightness(.95); }
.or { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Sécurité et données du compte */
.account { margin-top: 24px; }
.account summary { cursor: pointer; font-weight: 850; }
.account p { color: var(--muted); line-height: 1.5; font-size: 14px; }
.account button { display: block; width: 100%; margin-top: 10px; }
.danger { border: 2px solid #8a1c12; border-radius: 14px; padding: 14px 20px; background: #fff; color: #8a1c12; font: inherit; font-weight: 900; font-size: 15px; cursor: pointer; }
.danger:hover { background: #fde8e6; }

/* Discussion avec l'équipe */
.chat { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.chat summary { cursor: pointer; font-weight: 850; font-size: 15px; }
.chat-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; }
.msg p { margin: 0; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.msg span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.msg-client { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg-client span { color: #c9cbc0; }
.msg-equipe { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 4px; }
.msg-empty { font-size: 14px; color: var(--muted); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.chat-form textarea { flex: 1; min-height: 52px !important; resize: vertical; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 16px; }
.chat-form .primary { padding: 14px 18px; }

/* Onglets « Se connecter » / « Créer mon compte » */
.tabs { display: flex; gap: 4px; margin: 14px 0 4px; padding: 4px; border-radius: 14px; background: var(--soft); }
.tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 15px; font-weight: 800; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.card input[type=password] { width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 16px; }
.opt { font-weight: 500; color: var(--muted); }
.pseudo-form { margin: 0 0 18px; }
.pseudo-form .row { display: flex; gap: 8px; margin-top: 8px; }
.pseudo-form .row input { flex: 1; min-width: 0; }
.ok { margin: 8px 0 0; font-size: 14px; font-weight: 700; color: #1f7a47; }
.account .pseudo-form .row button { width: auto; flex: 0 0 auto; margin: 0; padding-left: 18px; padding-right: 18px; }
.pseudo-form label { margin-top: 18px; }

/* Précisions et pièces jointes d'une demande (espace et page équipe) */
.pieces-box { margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: var(--soft, #f6f5ff); display: grid; gap: 6px; }
.pieces-box b { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.precisions-txt { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pieces { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pieces li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pieces a { overflow-wrap: anywhere; }
.pieces audio { max-width: 100%; }
