/* ============================================================
   compte.css — Espace personnel (design v3)
   ============================================================ */

/* ── Page ──────────────────────────────────────────────────── */
.compte-page {
  background: var(--cream);
  padding-bottom: 96px;
}

/* ── En-tête ───────────────────────────────────────────────── */
.compte-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding-block: 64px 40px;
  flex-wrap: wrap;
}

.compte-greet {
  font-family: var(--f-display);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 500;
  color: var(--ink);
  margin: 8px 0 0;
  line-height: 1.1;
}

.compte-greet__name {
  font-style: italic;
  color: var(--terracotta);
}

/* ── Onglets ───────────────────────────────────────────────── */
.compte-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 48px;
}

.compte-tabs::-webkit-scrollbar { display: none; }

.compte-tab {
  flex-shrink: 0;
  padding: 16px 20px;
  font-family: var(--f-sans);
  font-size: 14px;
  color: var(--ink-2, oklch(0.38 0.012 60));
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
  white-space: nowrap;
}

.compte-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--terracotta);
  opacity: 0;
  transition: opacity 0.15s;
}

.compte-tab.active {
  color: var(--ink);
  font-weight: 500;
}

.compte-tab.active::after {
  opacity: 1;
}

/* ── Panneaux d'onglets ────────────────────────────────────── */
.compte-panel {
  display: none;
}

.compte-panel.active {
  display: block;
}

/* ── Messages ──────────────────────────────────────────────── */
.compte-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md, 8px);
  font-size: 14px;
  margin-bottom: 24px;
}

.compte-alert--success {
  background: oklch(0.93 0.04 140);
  border: 1px solid var(--olive);
  color: oklch(0.30 0.06 140);
}

.compte-alert--error {
  background: oklch(0.95 0.05 25);
  border: 1px solid var(--terracotta);
  color: var(--terracotta-2, oklch(0.50 0.10 38));
}

/* ── Onglet 1 : Aperçu ─────────────────────────────────────── */
.compte-overview {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Carte fidélité ─────────────────────────────────────────────*/
.fidelite-card {
  background: linear-gradient(140deg, oklch(0.30 0.05 35), oklch(0.20 0.04 30));
  border-radius: var(--radius-lg, 16px);
  padding: 36px;
  color: var(--cream);
  position: relative;
  overflow: hidden;
}

.fidelite-card__decor {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, oklch(0.55 0.12 38) 0%, transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.fidelite-card__kicker {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: oklch(0.72 0.06 70);
  margin: 0 0 16px;
}

.fidelite-card__points {
  font-family: var(--f-display);
  font-size: clamp(44px, 5vw, 60px);
  font-style: italic;
  font-weight: 500;
  color: var(--cream);
  line-height: 1;
  margin: 0 0 6px;
}

.fidelite-card__punti {
  font-family: var(--f-display);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 500;
  color: var(--cream);
  opacity: 0.7;
}

.fidelite-bar {
  height: 6px;
  background: oklch(0.36 0.04 30);
  border-radius: 999px;
  margin: 24px 0 10px;
  overflow: hidden;
}

.fidelite-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--terracotta), oklch(0.72 0.12 70));
  transition: width 0.6s ease;
}

.fidelite-card__meta {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(0.55 0.04 50);
  margin-bottom: 16px;
}

.fidelite-card__reward {
  font-size: 14px;
  color: oklch(0.65 0.03 60);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Mini cards stack ───────────────────────────────────────────*/
.compte-cards-stack {
  display: grid;
  gap: 16px;
}

.compte-card {
  background: var(--cream-2, oklch(0.96 0.008 70));
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 8px);
  padding: 24px;
}

.compte-card__kicker {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0 0 10px;
}

.compte-card__title {
  font-family: var(--f-display);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.2;
}

.compte-card__sub {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2, oklch(0.38 0.012 60));
  margin-bottom: 16px;
}

.compte-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compte-card__empty {
  font-size: 14px;
  color: var(--ink-2, oklch(0.38 0.012 60));
  font-style: italic;
}

/* Allergy chips inline ───────────────────────────────────────*/
.compte-allergy-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

/* ── Onglet 2 : Fidélité ───────────────────────────────────── */
.fidelite-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}

.fidelite-hero__title {
  font-family: var(--f-display);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.1;
}

.fidelite-hero__text {
  font-size: 17px;
  color: var(--ink-2, oklch(0.38 0.012 60));
  line-height: 1.7;
  max-width: 480px;
}

.fidelite-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.fidelite-qr__frame {
  width: 180px;
  height: 180px;
  padding: 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 8px);
  box-shadow: var(--shadow-sm, 0 2px 8px oklch(0 0 0 / .07));
  display: flex;
  align-items: center;
  justify-content: center;
}

.fidelite-qr__frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.fidelite-qr__code {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2, oklch(0.38 0.012 60));
  text-align: center;
}

.fidelite-qr__actions {
  display: flex;
  gap: 8px;
}

/* History table ──────────────────────────────────────────────*/
.fidelite-history {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.fidelite-history__title {
  font-family: var(--f-display);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 24px;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history-item {
  display: grid;
  grid-template-columns: 160px 1fr 80px;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.history-item:last-child { border-bottom: none; }

.history-item__date {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2, oklch(0.38 0.012 60));
}

.history-item__reason {
  font-size: 14px;
  color: var(--ink);
}

.history-item__pts {
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.history-item__pts.pos { color: var(--olive); }
.history-item__pts.neg { color: var(--terracotta); }

/* Rewards grid ───────────────────────────────────────────────*/
.rewards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.reward-tile {
  padding: 24px;
  background: var(--cream-2, oklch(0.96 0.008 70));
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 8px);
}

.reward-tile.current {
  background: var(--terracotta-soft, oklch(0.93 0.025 38));
  border-color: var(--terracotta);
}

.reward-tile__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.reward-tile__pts {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.reward-tile__next {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.reward-tile__name {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.2;
}

.reward-tile__desc {
  font-size: 14px;
  color: var(--ink-2, oklch(0.38 0.012 60));
  line-height: 1.5;
}

/* ── Onglet 3 : Réservations ───────────────────────────────── */
.resa-empty {
  text-align: center;
  padding: 80px 0;
}

.resa-empty__text {
  font-family: var(--f-display);
  font-size: 22px;
  font-style: italic;
  color: var(--ink-2, oklch(0.38 0.012 60));
  margin: 12px 0 24px;
}

.resa-table {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
}

.resa-row {
  display: flex;
  gap: 24px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.resa-row:last-child { border-bottom: none; }

.resa-row__num {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-2, oklch(0.38 0.012 60));
  min-width: 40px;
  flex-shrink: 0;
}

.resa-row__main {
  flex: 1;
  min-width: 0;
}

.resa-row__date {
  font-family: var(--f-display);
  font-size: 22px;
  color: var(--ink);
  line-height: 1.1;
}

.resa-row__sub {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2, oklch(0.38 0.012 60));
  margin-top: 3px;
}

.resa-row__status {
  flex-shrink: 0;
}

.resa-row__action {
  flex-shrink: 0;
}

/* ── Onglet 4 : Profil & Allergies ────────────────────────── */
.compte-profil {
  max-width: 640px;
}

.compte-bloc {
  border-top: 1px solid var(--line);
  padding-top: 32px;
  margin-top: 32px;
}

.compte-bloc:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.compte-bloc__kicker {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0 0 18px;
}

.compte-bloc__desc {
  font-size: 15px;
  color: var(--ink-2, oklch(0.38 0.012 60));
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Fields ─────────────────────────────────────────────────────*/
.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field--full { grid-column: 1 / -1; }

.field label,
.field .mono {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2, oklch(0.38 0.012 60));
}

.field input,
.field textarea,
.field select {
  padding: 13px 16px;
  background: var(--cream);
  border: 1px solid var(--line-2, oklch(0.80 0.015 75));
  border-radius: var(--radius-sm, 4px);
  font-family: var(--f-sans);
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--terracotta);
  outline: none;
}

/* Allergen chips ─────────────────────────────────────────────*/
.allergen-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.allergen-chip {
  position: relative;
  display: inline-flex;
}

.allergen-chip input[type="checkbox"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.allergen-chip__body {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--cream);
  border: 1px solid var(--line-2, oklch(0.80 0.015 75));
  border-radius: 999px;
  font-family: var(--f-sans);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s;
}

.allergen-chip input:checked + .allergen-chip__body {
  background: var(--terracotta-soft, oklch(0.93 0.025 38));
  border-color: var(--terracotta);
}

.form-actions-bottom {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* ── Auth pages (login / register) ─────────────────────────── */
.auth-wrap {
  display: grid;
  grid-template-columns: 1fr 40%;
  min-height: 100vh;
  background: var(--cream);
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 48px;
}

.auth-inner {
  width: 100%;
  max-width: 480px;
}

.auth-title {
  font-family: var(--f-display);
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 500;
  color: var(--ink);
  margin: 12px 0 28px;
  line-height: 1.1;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-note {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2, oklch(0.38 0.012 60));
  margin-top: 16px;
  text-align: center;
}

.auth-note a {
  color: var(--terracotta);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.auth-note a:hover { border-bottom-color: var(--terracotta); }

.auth-side {
  position: relative;
  overflow: hidden;
}

.auth-side .photo--terra {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.auth-side__label {
  position: absolute;
  bottom: 28px;
  left: 28px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.55;
  z-index: 1;
}

/* ── QR fullscreen modal ────────────────────────────────────── */
.qr-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 400;
}

.qr-modal[aria-hidden="false"] { display: block; }

.qr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0 0 0 / .70);
}

.qr-modal__content {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.qr-modal__content img {
  width: min(80vmin, 600px);
  height: auto;
  border-radius: var(--radius-md, 8px);
  background: var(--cream);
  padding: 12px;
}

.qr-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 28px;
  line-height: 1;
  background: transparent;
  border: none;
  color: var(--cream);
  cursor: pointer;
  opacity: 0.8;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .compte-overview {
    grid-template-columns: 1fr;
  }

  .rewards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fidelite-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-side { display: none; }
}

@media (max-width: 880px) {
  .rewards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .compte-header { padding-block: 40px 28px; }

  .resa-row {
    flex-wrap: wrap;
    padding: 16px 20px;
    gap: 12px;
  }

  .fields-grid {
    grid-template-columns: 1fr;
  }

  .field--full { grid-column: 1; }

  .rewards-grid {
    grid-template-columns: 1fr;
  }

  .history-item {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .history-item__reason { grid-column: 1 / -1; font-size: 13px; }

  .auth-main { padding: 48px 24px; }
}
