/* ============================================================
   Image Passion Évreux — Espace membre
   Aligné sur la charte du site public (ink / paper / ochre,
   Cormorant Garamond + Inter, style éditorial sobre).
   ============================================================ */

:root {
  /* Palette principale (identique au site public) */
  --ink:        #0E1116;
  --ink-soft:   #1a1f27;
  --paper:      #F4F1EC;
  --paper-soft: #EBE6DC;
  --surface:    #FFFFFF;
  --text:       #0E1116;
  --text-muted: #8a8780;
  --border:     rgba(14, 17, 22, 0.12);
  --line:       rgba(14, 17, 22, 0.12);

  /* Boutons / accent */
  --primary:        #0E1116;
  --primary-hover:  #2a2f37;
  --accent:         #C29545;
  --accent-deep:    #a07a31;

  /* États (créneaux / matériel) */
  --free:       #ebf2ec;
  --free-hover: #dbe7dd;
  --free-text:  #1e7a3f;
  --booked:     #f0e2e2;
  --booked-text:#b3261e;
  --past:       #ede9e2;
  --past-text:  #b3aca0;
  --bg:         #F4F1EC;

  /* Élévation */
  --shadow:   0 1px 2px rgba(14, 17, 22, 0.04), 0 6px 16px rgba(14, 17, 22, 0.04);
  --radius:   4px;

  /* Typographies */
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter, 1.75rem);
}

/* =================== Header / nav =================== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 1.75rem;
  max-width: 1240px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 500;
}
.brand-logo {
  height: 42px;
  width: auto;
  display: block;
  filter: invert(1); /* le PNG est blanc → noir sur fond paper/blanc */
}
.brand-tag {
  font-family: var(--sans);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent-deep);
  border-left: 1px solid var(--border);
  padding-left: 14px;
  font-weight: 500;
}

.site-header nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav-toggle-input { display: none; }
.nav-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  width: 40px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text);
  user-select: none;
  font-family: inherit;
}
.nav-burger:hover { background: var(--bg); }
.burger-icon-close { display: none; }
.nav-toggle-input:checked ~ .nav-burger .burger-icon-open { display: none; }
.nav-toggle-input:checked ~ .nav-burger .burger-icon-close { display: inline; }

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
  transition: color .2s ease;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent-deep); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--accent);
}

/* Liens accessibles seulement aux admins — masqués pour les membres */
body:not([data-role="admin"]) .admin-only { display: none !important; }

/* Petit bouton déconnexion dans la nav */
.nav-link--logout {
  border: 1px solid var(--border) !important;
  padding: 6px 12px !important;
  margin-left: 0.5rem;
}
.nav-link--logout:hover {
  background: var(--booked);
  color: var(--booked-text);
  border-color: var(--booked-text) !important;
}

/* =================== Hero =================== */
.hero {
  text-align: center;
  padding: 4.5rem 0 2.5rem;
}
.hero h1 {
  font-family: var(--serif);
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.hero-sub {
  margin: 0 auto;
  max-width: 56ch;
  color: var(--text-muted);
  font-size: 1rem;
}

/* =================== Boutons (style éditorial) =================== */
.btn-primary, .btn-secondary, .btn-danger {
  padding: 0.85rem 1.5rem;
  border-radius: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid currentColor;
  font-family: inherit;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: transparent;
  color: var(--ink);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn-danger {
  background: transparent;
  border-color: var(--booked-text);
  color: var(--booked-text);
  padding: 0.5rem 0.9rem;
  font-size: 0.68rem;
}
.btn-danger:hover {
  background: var(--booked-text);
  color: var(--paper);
}

/* =================== Cartes calendrier =================== */
.calendar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow);
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.calendar-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: -0.01em;
}
.nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  width: 38px;
  height: 38px;
  border-radius: 0;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
  transition: background .15s, border-color .15s;
}
.nav-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-free { background: var(--free-text); }
.dot-booked { background: var(--booked-text); }
.dot-past { background: var(--past-text); }

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.weekdays > div {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 8px 0;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 128px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.day-cell.empty {
  background: transparent;
  border: 1px dashed transparent;
}
.day-number {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.day-cell.today .day-number {
  color: var(--accent-deep);
  font-weight: 600;
}
.slot {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 6px 8px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .05s;
  font-family: inherit;
}
.slot:active { transform: scale(0.98); }
.slot-free {
  background: var(--free);
  color: var(--free-text);
}
.slot-free:hover { background: var(--free-hover); }
.slot-booked {
  background: var(--booked);
  color: var(--booked-text);
  cursor: not-allowed;
}
.slot-past {
  background: var(--past);
  color: var(--past-text);
  cursor: not-allowed;
}

/* =================== Modale =================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 17, 22, 0.7);
}
.modal-panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 30px 80px rgba(14, 17, 22, 0.25);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  line-height: 1;
  transition: color .2s;
}
.modal-close:hover { color: var(--text); }
.modal-panel h3 {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
}
.modal-slot {
  margin: 0 0 1.5rem;
  color: var(--accent-deep);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* =================== Formulaires =================== */
.booking-form .field {
  margin-bottom: 1rem;
}
.booking-form label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}
.booking-form input,
.booking-form select,
.booking-form textarea {
  width: 100%;
  padding: 0.7rem 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  font-size: 1rem;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  transition: border-color .2s;
}
.booking-form input:focus,
.booking-form select:focus,
.booking-form textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: none;
}
.booking-form input:invalid:not(:placeholder-shown) {
  border-bottom-color: #d97777;
}
.booking-form textarea { resize: vertical; min-height: 90px; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* =================== Confirmation =================== */
.confirmation {
  text-align: center;
  padding: 1rem 0;
}
.confirmation-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--free);
  color: var(--free-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 1rem;
}
.confirmation h4 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
}
.confirmation p {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

/* =================== Admin / tableaux =================== */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-stats {
  display: flex;
  gap: 1.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}
.admin-stats strong {
  font-family: var(--serif);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  margin-right: 0.4rem;
}

.bookings-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.bookings-table th, .bookings-table td {
  padding: 1rem 1.1rem;
  text-align: left;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
}
.bookings-table th {
  background: var(--bg);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}
.bookings-table tr:last-child td { border-bottom: none; }
.bookings-table tr:hover td { background: rgba(244, 241, 236, 0.5); }

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.empty-state p { font-family: var(--serif); font-style: italic; font-size: 1.1rem; }

/* =================== Footer =================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.75rem 0;
  text-align: center;
  color: var(--text-muted);
  margin-top: 4rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

/* =================== Matériel (listing) =================== */
.equipment-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.filter-input,
.filter-select {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.filter-input { flex: 1; min-width: 180px; }
.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194, 149, 69, 0.15);
}

.equipment-stats {
  display: flex;
  gap: 1.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.equipment-stats strong {
  font-family: var(--serif);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  margin-right: 0.4rem;
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.equipment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.equipment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(14, 17, 22, 0.08);
}
.equipment-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.category-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: rgba(194, 149, 69, 0.12);
  padding: 4px 8px;
  border-radius: 0;
}
.status-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 0;
}
.status-available {
  background: var(--free);
  color: var(--free-text);
}
.status-borrowed {
  background: var(--booked);
  color: var(--booked-text);
}
.equipment-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.equipment-description {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.borrower-info {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.85rem;
}
.borrower-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.borrower-name { font-weight: 600; color: var(--text); }
.borrower-date { color: var(--text-muted); margin-top: 2px; }
.equipment-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

/* =================== Modale réservation matériel — 2 colonnes =================== */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.field-row .field { margin-bottom: 0; }

/* =================== Pages de gestion =================== */
.manage-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
  align-items: start;
}
.manage-form-card,
.manage-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.manage-form-card h2,
.manage-list-card h2 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.manage-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.manage-list-header h2 { margin: 0; }
.manage-list-card .bookings-table {
  border: none;
  border-radius: 0;
}
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .manage-layout { grid-template-columns: 1fr; }
}

/* =================== Responsive =================== */
@media (max-width: 720px) {
  .hero h1 { font-size: 2rem; }
  .day-cell { min-height: 110px; padding: 6px; }
  .slot { font-size: 0.62rem; padding: 4px 6px; }
  .calendar-card { padding: 1rem; }
  .modal-panel { padding: 1.5rem; }
  .bookings-table th, .bookings-table td { padding: 0.75rem 0.6rem; font-size: 0.85rem; }
  .equipment-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .header-inner { padding: 14px 1rem; position: relative; flex-wrap: wrap; }
  .nav-burger { display: inline-flex; }
  .brand-logo { height: 36px; }
  .brand-tag { padding-left: 10px; font-size: 0.6rem; }
  .site-header nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-direction: column;
    padding: 12px 16px;
    min-width: 200px;
    gap: 14px;
    margin-top: 6px;
    z-index: 11;
  }
  .nav-toggle-input:checked ~ nav { display: flex; }
  .site-header nav .nav-link {
    padding: 4px 0;
    font-size: 0.8rem;
  }
  .site-header nav .nav-link.active::after { display: none; }
  .equipment-toolbar { gap: 0.6rem; }
  .equipment-stats { gap: 0.85rem; }
}
