/* =========================================================
   NakFix — espace client / carte de fidélité
   ========================================================= */

/* L'attribut hidden doit toujours gagner (les .btn sont en inline-flex). */
[hidden] { display: none !important; }

.account-main { padding-bottom: 4rem; }

.account-hero {
  padding: calc(var(--header-h) + 4.5rem) 0 2.5rem;
}
.account-hero .lead { margin-bottom: 0; }

.account-section { padding: 1rem 0 2rem; }
.account-wrap { width: min(100% - 2.5rem, 980px); margin-inline: auto; }

/* ---------- Messages ---------- */
.account-error {
  margin-bottom: 1.2rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  color: #ffd7d7;
  background: rgba(255, 90, 90, 0.1);
  border: 1px solid rgba(255, 90, 90, 0.35);
}
.account-loading {
  padding: 3rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Connexion / inscription ---------- */
.auth-card {
  max-width: 480px;
  margin-inline: auto;
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.auth-tab {
  padding: 0.6rem 0.5rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, #9d7bfa, #7c3aed);
  box-shadow: 0 8px 20px -10px rgba(124, 58, 237, 0.8);
}

.auth-form .field { margin-bottom: 1rem; }
.auth-note {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--muted);
}
.verify-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

/* ---------- Espace compte ---------- */
.account-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 1.6rem;
  align-items: stretch;
}

/* Carte client */
.loyalty-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 320px;
  padding: 1.5rem;
  border-radius: 22px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 130% at 88% 0%, rgba(196, 181, 253, 0.5), transparent 58%),
    linear-gradient(150deg, #7c3aed 0%, #5b21b6 48%, #2e1065 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 34px 60px -28px rgba(76, 29, 149, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.loyalty-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.14) 50%, transparent 62%);
  pointer-events: none;
}
.loyalty-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.loyalty-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.loyalty-brand em { font-style: normal; color: #c4b5fd; }
.loyalty-chip {
  width: 38px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #f7e0b0, #c9a15a 55%, #f2d79b);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.loyalty-label {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}
.loyalty-number {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.22rem);
  letter-spacing: 0.1em;
  color: #fff;
}
.loyalty-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.loyalty-foot span {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.loyalty-foot strong { font-size: 0.86rem; font-weight: 700; }

/* Panneau fidélité */
.loyalty-panel {
  display: flex;
  flex-direction: column;
  padding: 1.6rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.panel-kicker {
  margin-bottom: 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-head h2 {
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
}
.panel-head h2 span { color: var(--accent-2); }
.panel-count {
  flex: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent-2);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.progress {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}
.progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #a78bfa 70%, #c4b5fd);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.7);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-text {
  margin-top: 0.8rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.reward-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #ede9fe;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.4);
}
.reward-badge svg { width: 18px; height: 18px; flex: none; color: var(--accent-2); }

.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 1.4rem;
}
.account-note {
  margin-top: 0.9rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* Infos du compte */
.account-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.6rem;
}
.account-info > div {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.account-info span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.account-info strong {
  display: block;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

/* ---------- Suivi des réparations ---------- */
.repairs {
  margin-top: 1.6rem;
  padding: 1.4rem 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.repairs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.repairs-head h2 { font-size: clamp(1.05rem, 2.2vw, 1.2rem); }
.repairs-head .btn { flex: none; }

.repairs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.repair {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.repair-main strong { display: block; font-size: 0.9rem; }
.repair-main span { display: block; margin-top: 0.15rem; font-size: 0.76rem; color: var(--muted); }

.repair-status {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.repair-status.is-done {
  color: #c9f7e3;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.repair-status.is-progress {
  color: #fbe4c2;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.repair-status.is-ready {
  color: #e2dbff;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.45);
}
.repair-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.repairs-empty { margin: 0; font-size: 0.86rem; color: var(--muted); }

/* ---------- Infos utiles ---------- */
.client-tips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.2rem;
}
.tip-card {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.tip-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.tip-card p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .account-grid { grid-template-columns: 1fr; }
  .loyalty-card { max-width: 430px; width: 100%; margin-inline: auto; }
}
@media (max-width: 620px) {
  .account-info { grid-template-columns: 1fr; }
  .loyalty-panel { padding: 1.25rem; }
  .account-actions .btn { width: 100%; }
  .client-tips { grid-template-columns: 1fr; }
  .repairs { padding: 1.15rem; }
  .repairs-head { flex-direction: column; }
  .repair { grid-template-columns: 1fr; gap: 0.45rem; }
  .repair-status, .repair-price { justify-self: start; }
}

/* ---------- Animations ---------- */
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes progressShine {
  0% { transform: translateX(-110%); }
  55%, 100% { transform: translateX(110%); }
}
@keyframes cardSheen {
  0%, 50% { transform: translateX(-70%) rotate(8deg); }
  78%, 100% { transform: translateX(70%) rotate(8deg); }
}

/* Badge de récompense : apparition */
.reward-badge:not([hidden]) { animation: popIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Barre de progression : reflet qui balaye */
.progress-fill { position: relative; overflow: hidden; }
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-110%);
  animation: progressShine 3s ease-in-out infinite;
  pointer-events: none;
}

/* Carte client : reflet animé + soulèvement */
.loyalty-card {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
}
.loyalty-card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 44px 76px -30px rgba(76, 29, 149, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.loyalty-card::before {
  content: "";
  position: absolute;
  inset: -45%;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.18) 50%, transparent 58%);
  transform: translateX(-70%) rotate(8deg);
  animation: cardSheen 7.5s ease-in-out infinite;
  pointer-events: none;
}

/* Suivi : lignes en cascade */
.repair { animation: rowIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.repair:nth-child(2) { animation-delay: 0.06s; }
.repair:nth-child(3) { animation-delay: 0.12s; }
.repair:nth-child(4) { animation-delay: 0.18s; }
.repair:nth-child(5) { animation-delay: 0.24s; }
.repair:nth-child(6) { animation-delay: 0.3s; }
.repair:nth-child(n + 7) { animation-delay: 0.36s; }

/* Infos utiles : petit soulèvement */
.tip-card {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.tip-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.repair-warranty{grid-column:1/-1;display:grid;gap:8px;padding-top:9px;color:var(--muted,#a59bac);font-size:12px}.warranty-track{height:7px;display:block;overflow:hidden;border-radius:999px;background:rgba(255,255,255,.1)}.warranty-fill{height:100%;display:block;border-radius:inherit;background:linear-gradient(90deg,#a34fff,#7d4dff);transition:width .35s ease}
