* {
  box-sizing: border-box;
}

:root {
  --ff-primary: #ff5e3a;
  --ff-primary-dark: #d9431e;
  --ff-dark: #1b1f3b;
  --ff-light: #fff8f0;
  --ff-accent: #ffcf3f;
  --ff-radius: 14px;
  --ff-shadow: 0 6px 20px rgba(27, 31, 59, 0.12);
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--ff-light);
  color: var(--ff-dark);
  line-height: 1.5;
}

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

.ff-header {
  background: var(--ff-dark);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--ff-shadow);
}
.ff-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
}
.ff-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ff-accent);
}
.ff-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.ff-nav a {
  font-weight: 600;
  padding: 0.4rem 0.2rem;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
}
.ff-nav a:hover,
.ff-nav a.active {
  border-color: var(--ff-accent);
  color: var(--ff-accent);
}
.ff-btn-primary {
  background: var(--ff-primary);
  padding: 0.5rem 1rem !important;
  border-radius: 30px;
}
.ff-btn-primary:hover {
  background: var(--ff-primary-dark);
  border-color: transparent !important;
  color: white !important;
}
.ff-btn-admin {
  background: var(--ff-accent);
  color: var(--ff-dark) !important;
  padding: 0.4rem 0.9rem !important;
  border-radius: 30px;
  font-weight: 700;
}
.ff-btn-deco {
  opacity: 0.7;
}
.ff-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}
.ff-burger span {
  width: 26px;
  height: 3px;
  background: white;
  border-radius: 2px;
}

.ff-recherche {
  position: relative;
}
#ff-search-input {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  border: none;
  width: 190px;
}
.ff-search-results {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  width: 280px;
  background: white;
  color: var(--ff-dark);
  border-radius: 10px;
  box-shadow: var(--ff-shadow);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.ff-search-results.show {
  display: block;
}
.ff-search-results a {
  display: block;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #eee;
}
.ff-search-results a:hover {
  background: #f5f5f5;
}
.ff-search-empty {
  padding: 0.8rem 1rem;
  color: #888;
  font-size: 0.9rem;
}

.ff-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.ff-page-title {
  font-size: 2rem;
  margin-bottom: 0.3rem;
}
.ff-page-subtitle {
  color: #666;
  margin-bottom: 2rem;
}

.ff-banner {
  background: linear-gradient(
    135deg,
    var(--ff-primary),
    var(--ff-primary-dark)
  );
  color: white;
  padding: 3.5rem 1.5rem;
  text-align: center;
}
.ff-banner h1 {
  font-size: 2.4rem;
  margin: 0 0 0.5rem;
}
.ff-banner p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.ff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.ff-card {
  background: white;
  border-radius: var(--ff-radius);
  box-shadow: var(--ff-shadow);
  overflow: hidden;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
}
.ff-card:hover {
  transform: translateY(-4px);
}
.ff-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: #ddd;
}
.ff-card-body {
  padding: 1rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ff-card-body h3 {
  margin: 0 0 0.4rem;
}
.ff-card-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}
.ff-tag {
  background: #f1e9ff;
  color: #5a3ea8;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
}
.ff-tag.statut-active {
  background: #e2f8ea;
  color: #1e8449;
}
.ff-tag.statut-en_reparation {
  background: #fdecea;
  color: #c0392b;
}
.ff-tag.statut-fermee {
  background: #eee;
  color: #777;
}
.ff-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.8rem;
}

.ff-form {
  background: white;
  border-radius: var(--ff-radius);
  box-shadow: var(--ff-shadow);
  padding: 2rem;
  max-width: 480px;
  margin: 0 auto;
}
.ff-form h2 {
  margin-top: 0;
}
.ff-field {
  margin-bottom: 1rem;
}
.ff-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}
.ff-field input,
.ff-field select,
.ff-field textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}
.ff-field textarea {
  resize: vertical;
  min-height: 90px;
}

.ff-btn {
  display: inline-block;
  background: var(--ff-primary);
  color: white;
  border: none;
  padding: 0.7rem 1.6rem;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.2s;
}
.ff-btn:hover {
  background: var(--ff-primary-dark);
}
.ff-btn.secondary {
  background: transparent;
  color: var(--ff-primary);
  border: 2px solid var(--ff-primary);
  padding: 0.55rem 1.4rem;
}
.ff-btn.danger {
  background: #c0392b;
}
.ff-btn.small {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
}
.ff-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ff-msg {
  padding: 0.8rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  font-weight: 600;
}
.ff-msg.error {
  background: #fdecea;
  color: #c0392b;
}
.ff-msg.success {
  background: #e2f8ea;
  color: #1e8449;
}

.ff-filters {
  background: white;
  border-radius: var(--ff-radius);
  box-shadow: var(--ff-shadow);
  padding: 1.2rem 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 2rem;
}
.ff-filters .ff-field {
  margin: 0;
  min-width: 160px;
}

.ff-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--ff-radius);
  overflow: hidden;
  box-shadow: var(--ff-shadow);
}
.ff-table th,
.ff-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.ff-table th {
  background: var(--ff-dark);
  color: white;
}
.ff-table tr:hover {
  background: #faf6f0;
}

.ff-admin-layout {
  display: flex;
  min-height: 100vh;
}
.ff-admin-sidebar {
  width: 230px;
  background: var(--ff-dark);
  color: white;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}
.ff-admin-sidebar a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.3rem;
  font-weight: 600;
}
.ff-admin-sidebar a:hover,
.ff-admin-sidebar a.active {
  background: var(--ff-primary);
}
.ff-admin-content {
  flex: 1;
  padding: 2rem;
  background: #f4f4f8;
}
.ff-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.ff-stat-card {
  background: white;
  border-radius: var(--ff-radius);
  box-shadow: var(--ff-shadow);
  padding: 1.2rem;
}
.ff-stat-card .val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ff-primary);
}

.ff-signature-box {
  background: white;
  border-radius: var(--ff-radius);
  box-shadow: var(--ff-shadow);
  padding: 1.2rem;
  text-align: center;
}
#ff-signature-pad {
  border: 2px dashed #ccc;
  border-radius: 10px;
  touch-action: none;
  width: 100%;
  max-width: 500px;
  height: 200px;
  background: #fff;
}

.ff-stars {
  color: var(--ff-accent);
  font-size: 1.1rem;
}
.ff-star-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.2rem;
  font-size: 1.6rem;
}
.ff-star-input input {
  display: none;
}
.ff-star-input label {
  color: #ddd;
  cursor: pointer;
}
.ff-star-input input:checked ~ label,
.ff-star-input label:hover,
.ff-star-input label:hover ~ label {
  color: var(--ff-accent);
}

.ff-footer {
  background: var(--ff-dark);
  color: #ccc;
  padding: 2.5rem 1.5rem 1rem;
  margin-top: 3rem;
}
.ff-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}
.ff-footer h4 {
  color: white;
  margin-bottom: 0.6rem;
}
.ff-footer a {
  display: block;
  color: #ccc;
  margin-bottom: 0.3rem;
}
.ff-footer-copy {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.85rem;
  opacity: 0.6;
}

@media (max-width: 900px) {
  .ff-burger {
    display: flex;
  }
  .ff-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ff-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.5rem;
    display: none;
  }
  .ff-nav.open {
    display: flex;
  }
  #ff-search-input {
    width: 100%;
  }
  .ff-admin-layout {
    flex-direction: column;
  }
  .ff-admin-sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
    gap: 0.3rem;
  }
}

.ff-captcha-page {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.ff-captcha-box {
  background: white;
  border-radius: var(--ff-radius);
  box-shadow: var(--ff-shadow);
  padding: 2rem;
  text-align: center;
  width: 100%;
  max-width: 820px;
}
.ff-captcha-box h2 {
  margin: 0 0 0.3rem;
  color: var(--ff-dark);
}
.ff-captcha-box p.ff-captcha-hint {
  color: #777;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}
.ff-captcha-error {
  color: #c0392b;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

#ff-puzzle {
  box-sizing: content-box;
  display: flex;
  flex-wrap: wrap;
  border: 2px solid var(--ff-dark);
  border-radius: 8px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 1.2rem;
  overflow: hidden;
}
.ff-piece {
  width: 50%;
  cursor: grab;
  background-size: cover;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.08);
  touch-action: none;
}
.ff-piece.dragging {
  opacity: 0.4;
}
.ff-piece.drag-over {
  outline: 3px solid var(--ff-primary);
  outline-offset: -3px;
}

@media (max-width: 600px) {
  .ff-captcha-box {
    padding: 1.2rem;
  }
  #ff-puzzle {
    width: 100%;
  }
}
