/* ============================================================
   ÉCRITURE DE SOIE — Page compte (auth + tableau de bord)
   Réutilise les variables & composants de main.css
   ============================================================ */

.account-body {
  min-height: 100vh;
  background:
    radial-gradient(120% 80% at 90% -10%, var(--cream) 0%, transparent 55%),
    radial-gradient(90% 70% at -10% 110%, var(--ivory-2) 0%, transparent 55%),
    var(--ivory);
}

.nav--app { color: var(--ink); }
.nav--app::before { background: rgba(244, 239, 246, 0.85); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 var(--line); }

.account {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(7rem, 14vh, 9rem) var(--gutter) 5rem;
}

/* ─── Chargement ─── */
.account__loading { text-align: center; padding: 4rem 0; color: var(--ink-soft); }
.spinner {
  display: inline-block; width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--silk-deep);
  animation: spin 0.8s linear infinite; margin-bottom: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Avertissement config ─── */
.config-warning {
  max-width: 620px; margin: 0 auto; padding: 2rem 2.2rem; border-radius: var(--radius);
  background: var(--cream); border: 1px solid var(--line); border-left: 3px solid var(--silk-deep);
}
.config-warning h2 { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 0.8rem; }
.config-warning code { background: var(--ivory-2); padding: 0.1rem 0.4rem; border-radius: 5px; font-size: 0.9em; }

/* ═══════════════ AUTH ═══════════════ */
.auth { display: grid; grid-template-columns: 1fr; gap: 2.5rem; max-width: 520px; margin: 0 auto; }
.auth__intro { text-align: center; }
.auth__title { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; margin: 0.6rem 0 1rem; }
.auth__sub { color: var(--ink-soft); max-width: 42ch; margin: 0 auto; }

.auth__card {
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.5rem; box-shadow: 0 30px 60px -40px rgba(42, 32, 54, 0.5);
}
.auth__tabs { display: flex; gap: 0.3rem; padding: 0.4rem; background: var(--ivory-2); border-radius: calc(var(--radius) - 6px); margin-bottom: 0.4rem; }
.auth__tab {
  flex: 1; padding: 0.7rem; border-radius: calc(var(--radius) - 9px); font-family: var(--body);
  font-size: 0.96rem; color: var(--ink-soft); transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
.auth__tab.is-active { background: var(--cream); color: var(--ink); box-shadow: 0 4px 14px -8px rgba(42, 32, 54, 0.4); }
.auth__form { padding: 1.4rem 1.5rem 1.6rem; }
.auth__forgot { margin: 0.7rem 0 0; text-align: center; font-size: 0.9rem; }
.auth__forgot a { color: var(--ink-soft, #6b5f55); text-decoration: underline; text-underline-offset: 3px; }
.auth__forgot a:hover { color: var(--ink, #2a2036); }

/* ═══════════════ TABLEAU DE BORD ═══════════════ */
.dash__head {
  display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; justify-content: space-between;
  padding-bottom: 1.8rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem;
}
.dash__hello { font-family: var(--serif); font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1; }
.dash__status { text-align: right; }
.dash__status-label { display: block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.4rem; }

.badge {
  display: inline-block; padding: 0.38rem 0.9rem; border-radius: 100px;
  font-size: 0.9rem; font-weight: 500; letter-spacing: 0.01em;
  background: var(--ivory-2); color: var(--ink);
}
.badge--pending { background: rgba(201, 162, 74, 0.18); color: #8a6d1f; }
.badge--valid   { background: rgba(122, 142, 110, 0.2); color: #46603a; }
.badge--refused { background: rgba(190, 58, 82, 0.16); color: var(--red-deep); }

/* bandeau « compte refusé » */
.dash__refused {
  background: rgba(190, 58, 82, 0.1); border: 1px solid rgba(190, 58, 82, 0.28);
  border-left: 3px solid var(--red-deep); border-radius: 14px;
  padding: 1rem 1.3rem; margin-bottom: 1.8rem; line-height: 1.55; color: var(--ink);
}
.dash__refused strong { color: var(--red-deep); }

/* onglets */
.dash__tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.dash__tab {
  padding: 0.6rem 1.2rem; border-radius: 100px; font-family: var(--body); font-size: 0.95rem;
  color: var(--ink-soft); border: 1px solid var(--line); transition: all 0.3s var(--ease);
}
.dash__tab:hover { border-color: var(--silk-deep); color: var(--ink); }
.dash__tab.is-active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* panneaux */
.panel { display: none; animation: fade 0.5s var(--ease); }
.panel.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.panel__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 1.4rem; }
.card-block {
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem 1.8rem 2rem;
}
.card-block__title { font-family: var(--serif); font-size: 1.4rem; margin-bottom: 1.4rem; }
.card-block__foot { margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }

/* champs (dérivés des champs de main.css, version claire) */
.account .field { margin-bottom: 1.05rem; }
.account .field__label { display: block; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.45rem; }
.account .field__opt { text-transform: none; letter-spacing: 0; opacity: 0.7; font-style: italic; }
.account .field__hint { display: block; font-size: 0.82rem; font-style: italic; color: var(--ink-soft); opacity: 0.8; margin-top: 0.4rem; }
.account .field input {
  width: 100%; padding: 0.85rem 1rem; border-radius: 11px; font: inherit;
  background: var(--ivory); border: 1px solid var(--line); color: var(--ink);
  transition: border-color 0.3s, background 0.3s;
}
.account .field input::placeholder { color: rgba(42, 32, 54, 0.35); }
.account .field input:focus { outline: none; border-color: var(--silk-deep); background: var(--cream); box-shadow: 0 0 0 3px rgba(163, 31, 61, 0.08); }

.account .btn--ghost { border-color: var(--line); }
.account .btn { margin-top: 0.4rem; }

/* statut de formulaire */
.form__status { margin-top: 0.9rem; font-style: italic; font-size: 0.95rem; min-height: 1.3em; }
.form__status[data-kind="error"] { color: var(--red-deep); font-style: normal; }
.form__status[data-kind="ok"] { color: #46603a; }

/* ─── Listes (réservations / commandes) ─── */
.list { display: flex; flex-direction: column; gap: 0.9rem; }
.list__empty { color: var(--ink-soft); font-style: italic; padding: 1.5rem 0; }
.list__empty a { color: var(--silk-deep); text-decoration: underline; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem;
  padding: 1.3rem 1.5rem; background: var(--cream); border: 1px solid var(--line);
  border-radius: 14px; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.row:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -26px rgba(42, 32, 54, 0.35); }
.row__title { font-family: var(--serif); font-size: 1.2rem; margin-bottom: 0.25rem; }
.row__meta { font-size: 0.9rem; color: var(--ink-soft); }
.row__amount { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); white-space: nowrap; }
.tag { padding: 0.32rem 0.8rem; border-radius: 100px; font-size: 0.82rem; white-space: nowrap; background: var(--ivory-2); color: var(--ink-soft); }
.tag--confirmee, .tag--payee { background: rgba(122, 142, 110, 0.2); color: #46603a; }
.tag--en_attente { background: rgba(201, 162, 74, 0.18); color: #8a6d1f; }
.tag--annulee, .tag--remboursee { background: rgba(190, 58, 82, 0.14); color: var(--red-deep); }

/* côté droit d'une ligne (montant + bouton facture) */
.row__side { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; justify-content: flex-end; }

/* petit bouton d'action (facture, lire, publier…) */
.mini-btn {
  font: inherit; font-size: 0.85rem; padding: 0.42rem 0.85rem; border-radius: 100px; cursor: pointer;
  background: var(--ivory); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  white-space: nowrap; transition: all 0.25s var(--ease);
}
.mini-btn:hover { border-color: var(--silk-deep); color: var(--silk-deep); }
.mini-btn--solid { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.mini-btn--solid:hover { background: var(--silk-deep); border-color: var(--silk-deep); color: var(--cream); }
.row__hint { font-size: 0.78rem; color: var(--ink-soft); font-style: italic; white-space: nowrap; }

/* ─── Mes écrits (privés) ─── */
.ecrits-note {
  font-size: 0.9rem; line-height: 1.6; color: var(--ink-soft);
  background: rgba(171, 147, 214, 0.12); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.9rem 1.1rem; margin-bottom: 0.4rem;
}
.ecrits-note a { color: var(--silk-deep); text-decoration: underline; }
.my-ecrit {
  background: var(--cream); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 0.8rem;
}
.my-ecrit__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.my-ecrit__head .badge { font-size: 0.78rem; padding: 0.18rem 0.6rem; vertical-align: middle; }
.my-ecrit__body { border-top: 1px solid var(--line); padding-top: 0.8rem; }
.my-ecrit__text { white-space: pre-wrap; line-height: 1.7; font-family: var(--serif); color: var(--ink); }
.my-ecrit__foot { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding-top: 0.4rem; border-top: 1px dashed var(--line); }

/* ─── Responsive ─── */
@media (max-width: 720px) {
  .panel__grid { grid-template-columns: 1fr; }
  .dash__head { align-items: flex-start; }
  .dash__status { text-align: left; }
  .row { flex-wrap: wrap; gap: 0.6rem; }
  .row__side { width: 100%; justify-content: space-between; }
}

/* accès rapides depuis l'espace membre (groupes, écrire, écrits) */
.dash__access {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem; margin: 0 0 1.8rem;
}
.dash__access-card {
  display: flex; align-items: center; gap: 0.8rem; text-decoration: none; color: inherit;
  background: var(--cream); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.9rem 1.1rem; transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.dash__access-card:hover { transform: translateY(-2px); border-color: var(--silk-deep); box-shadow: 0 18px 34px -26px rgba(42, 32, 54, 0.5); }
.dash__access-ico { font-size: 1.4rem; color: var(--silk-deep); line-height: 1; }
.dash__access-card small { color: var(--ink-soft); opacity: 0.85; }
