:root {
  --bg-main: #950f1a;
  --bg-card: #f4f4f4;
  --bg-subtle: #efe6df;
  --text-main: #111;
  --text-light: #fff4de;
  --accent: #f18900;
  --accent-dark: #ca6f00;
  --line: #d8d2cc;
  --radius: 18px;
}

html {
  font-size: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Roboto", "Trebuchet MS", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 10% 0%, #a6242b 0%, rgba(0, 0, 0, 0) 40%),
    var(--bg-main);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

.container {
  width: min(1320px, 94vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(6px);
  background: rgba(78, 6, 11, 0.72);
  border-bottom: 1px solid rgba(255, 228, 173, 0.22);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}

.header-home,
.header-title {
  font-family: "Roboto", "Trebuchet MS", sans-serif;
  font-size: 1.2rem;
  color: #ffd79e;
  letter-spacing: 0.02em;
}

.header-home {
  justify-self: start;
  font-weight: 700;
}

.header-title {
  justify-self: center;
  text-align: center;
  font-weight: 800;
  text-decoration: none;
}

.main-nav {
  display: flex;
  gap: 20px;
  justify-self: end;
}

.main-nav a {
  color: #ffe8c2;
  font-weight: 600;
}

.intro {
  margin: 28px 0 18px;
  color: #ffe7c7;
}

h1,
h2,
h3,
legend {
  font-family: "Roboto", "Trebuchet MS", sans-serif;
}

.intro h1 {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 2.4vw, 2.4rem);
}

.filters-panel {
  margin: 0 0 24px;
  padding: 18px 20px;
  background: rgba(78, 6, 11, 0.34);
  border: 1px solid rgba(255, 228, 173, 0.22);
  border-radius: var(--radius);
  color: #ffe7c7;
}

.filters-panel h2,
.filters-panel p,
.filters-panel label,
.filters-panel a,
.filters-panel button {
  color: #ffe7c7;
}

.filters-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.filters-head h2 {
  margin: 0 0 6px;
  color: #ffe7c7;
}

.filters-head p {
  margin: 0;
  color: #ffe7c7;
}

.filters-count {
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 244, 222, 0.1);
  border: 1px solid rgba(255, 228, 173, 0.22);
  color: #ffe7c7;
  font-weight: 700;
  text-align: right;
}

.filters-form {
  display: grid;
  gap: 16px;
}

.search-row {
  display: grid;
  gap: 8px;
}

.search-label {
  color: #ffe7c7;
  font-weight: 700;
}

.search-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input {
  width: min(100%, 560px);
  border: 1px solid rgba(255, 228, 173, 0.3);
  border-radius: 12px;
  background: rgba(255, 244, 222, 0.12);
  color: #fff4de;
  padding: 12px 14px;
  font-size: 1rem;
}

.search-input::placeholder {
  color: rgba(255, 231, 199, 0.72);
}

.search-input:focus {
  outline: 2px solid rgba(241, 185, 116, 0.5);
  outline-offset: 2px;
  border-color: rgba(255, 228, 173, 0.45);
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  position: relative;
}

.filter-chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.filter-pill {
  --badge-color: #c76700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  color: #ffe7c7;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  background: rgba(255, 244, 222, 0.1);
  border-color: rgba(255, 228, 173, 0.22);
}

.filter-pill::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--badge-color);
}

.filter-chip input:checked + .filter-pill {
  border-color: var(--badge-color);
  background: var(--badge-color);
  color: #fffaf2;
  box-shadow: 0 0 0 3px rgba(149, 15, 26, 0.18);
  transform: translateY(-1px);
}

.filter-chip input:focus-visible + .filter-pill {
  outline: 2px solid #7f2f00;
  outline-offset: 2px;
}

.filter-chip input:checked + .filter-pill::before {
  background: #fffaf2;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.filters-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.association-list {
  margin-bottom: 32px;
}

.alphabet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.alphabet-link,
.alphabet-reset {
  min-width: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d3bfa6;
  background: #fff2df;
  color: #8f4a00;
  font-weight: 700;
  text-align: center;
}

.alphabet-link.is-active,
.alphabet-link:hover,
.alphabet-reset:hover {
  border-color: #f1b974;
  background: #ffdcae;
  color: #7d3300;
}

.association-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.association-index-item {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.association-index-link {
  color: #fff4de;
  font-size: 1.22rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.association-index-link:hover {
  color: #ffd79e;
}

.association-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid #c9c1ba;
  padding: 14px;
  overflow: hidden;
}

.card-main {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
  min-height: 220px;
}

.card-left h2 {
  margin: 10px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.card-left h2 a {
  color: var(--accent);
}

.card-left p,
.card-right p {
  margin: 5px 0;
  font-size: 1.05rem;
}

.card-image {
  width: min(100%, 320px);
  border-radius: 6px;
  border: 1px solid #d2ccca;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.card-right {
  text-align: right;
  align-self: start;
}

.card-footer {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.thematiques {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.label {
  font-weight: 700;
}

.badge {
  --badge-color: #c76700;
  display: inline-block;
  background: var(--badge-color);
  color: #fff;
  font-size: 0.84rem;
  border-radius: 999px;
  padding: 3px 10px;
}

.muted,
.small-note {
  color: #555;
}

.pagination {
  background: #f4e8da;
  border-radius: 999px;
  border: 1px solid #d3bfa6;
  padding: 8px 18px;
  margin: 18px 0 40px;
  display: inline-flex;
  gap: 16px;
}

.association-detail {
  margin: 26px 0 38px;
  padding: 16px 18px 24px;
  color: var(--text-light);
}

.status-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 229, 165, 0.18);
  border: 1px solid rgba(255, 217, 139, 0.55);
}

.association-detail a {
  color: var(--accent);
}

.detail-actions {
  margin: 6px 0 26px 16px;
}

.detail-actions li {
  margin: 8px 0;
  font-size: 1.1rem;
}

.detail-head {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 26px;
}

.detail-cover {
  width: 100%;
  max-width: 320px;
  justify-self: end;
}

.detail-cover img {
  width: 100%;
  max-width: none;
  min-height: 0;
  height: auto;
  max-height: 420px;
  border-radius: 6px;
  border: 1px solid #d2ccca;
  display: block;
  object-fit: contain;
  aspect-ratio: auto;
  background: #fff8ee;
  padding: 8px;
}

.detail-cover .image-placeholder {
  width: 100%;
  min-height: 240px;
}

.detail-head p {
  margin: 8px 0;
  font-size: 1.15rem;
}

.detail-head .association-short-description {
  margin: 4px 0 22px;
  font-size: 1.18rem;
  line-height: 1.5;
  font-style: italic;
}

.social-links {
  display: flex;
  gap: 8px;
  margin: 16px 0 8px;
}

.social {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #fff;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.social:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.social svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.social-fb {
  background: #3168af;
}

.social-ig {
  background: #e64571;
}

.social-yt {
  background: #e20f0f;
}

.detail-info {
  margin-top: 20px;
  max-width: 1100px;
}

.detail-info p {
  margin: 10px 0;
  line-height: 1.5;
  font-size: 1.13rem;
}

.detail-text-block {
  margin: 10px 0;
  line-height: 1.5;
  font-size: 1.13rem;
}

.detail-text-content {
  margin-top: 4px;
  white-space: break-spaces;
}

.detail-text-content p {
  margin: 0 0 10px;
}

.detail-text-content p:last-child {
  margin-bottom: 0;
}

.detail-text-content ul {
  margin: 6px 0 10px 1.4em;
  padding-left: 1.1em;
}

.detail-text-content li + li {
  margin-top: 4px;
}

.gallery {
  margin-top: 24px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.gallery-grid img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery figcaption {
  margin-top: 6px;
  font-size: 0.94rem;
}

.submit-section,
.submit-success {
  margin: 28px 0 42px;
  background: #fff8ee;
  border: 1px solid #e5caa2;
  border-radius: var(--radius);
  padding: 20px;
}

.association-form {
  display: grid;
  gap: 16px;
}

.owner-assignment-block {
  display: grid;
  gap: 4px;
}

.owner-assignment-block .small-note {
  margin: 0 0 2px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.association-form fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.association-form label {
  font-weight: 700;
  margin-top: 6px;
}

.association-form input,
.association-form textarea,
.association-form select {
  width: 100%;
  border: 1px solid #c8c8c8;
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 1rem;
}

.association-form textarea {
  min-height: 86px;
  resize: vertical;
}

.association-form ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.association-form ul li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.char-counter {
  font-size: 0.88rem;
  color: #6a6a6a;
}

.char-counter.warning {
  color: #b60000;
}

.photo-form {
  border: 1px dashed #cfb08f;
  border-radius: 10px;
  padding: 10px;
  margin: 6px 0;
}

.photo-preview {
  margin-bottom: 10px;
}

.photo-preview img {
  display: block;
  width: min(100%, 320px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d8c0a1;
}

.form-errors {
  color: #b10000;
  font-weight: 700;
}

.btn-primary {
  display: inline-block;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #b45700, #f09000);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 16px;
  cursor: pointer;
}

.btn-secondary {
  display: inline-block;
  border: 1px solid #cc9f63;
  border-radius: 999px;
  background: #fff2df;
  color: #8f4a00;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 9px 14px;
  cursor: pointer;
}

.filters-panel .btn-secondary {
  color: #8f4a00;
}

.btn-danger {
  display: inline-block;
  border: none;
  border-radius: 999px;
  background: #9f1a1a;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 9px 14px;
  cursor: pointer;
}

.flash-messages {
  margin-top: 12px;
}

.flash {
  background: #f7eecf;
  border: 1px solid #dec58e;
  border-radius: 10px;
  padding: 10px 12px;
}

.image-placeholder {
  background: #e5e5e5;
  border: 1px dashed #b2b2b2;
  color: #727272;
  display: grid;
  place-items: center;
  border-radius: 8px;
  width: min(100%, 320px);
  aspect-ratio: 4 / 3;
}

.empty-state {
  background: #fff2e0;
  border: 1px solid #e9c8a1;
  border-radius: 12px;
  padding: 14px;
  margin: 0;
}

.edit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #fff0db;
  border: 1px solid #e2b77e;
  color: #9d5600;
  font-size: 1rem;
  vertical-align: middle;
}

.login-panel,
.dashboard-panel {
  margin: 28px 0 42px;
  background: #fff8ee;
  border: 1px solid #e5caa2;
  border-radius: var(--radius);
  padding: 20px;
}

.login-form {
  margin-top: 14px;
  max-width: 420px;
  display: grid;
  gap: 10px;
}

.login-form input {
  width: 100%;
  border: 1px solid #c8c8c8;
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 1rem;
}

.login-form textarea {
  width: 100%;
  border: 1px solid #c8c8c8;
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 1rem;
  resize: vertical;
  min-height: 140px;
}

.auth-action {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.login-alt-action {
  margin: 10px 0 0;
  max-width: 420px;
}

.alt-auth-action {
  font-size: 1rem;
  padding: 10px 16px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-toolbar {
  margin-bottom: 20px;
}

.dashboard-toolbar .search-input {
  background: rgba(48, 4, 8, 0.58);
  border-color: rgba(255, 228, 173, 0.42);
}

.dashboard-toolbar .search-label {
  color: #4b4340;
}

.dashboard-toolbar .search-input::placeholder {
  color: rgba(255, 231, 199, 0.82);
}

.dashboard-list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.dashboard-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #dec5a8;
  border-radius: 12px;
  background: #fffaf1;
}

.dashboard-card h3 {
  margin: 0 0 6px;
}

.dashboard-card p {
  margin: 4px 0;
}

.dashboard-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dashboard-actions form {
  margin: 0;
}

@media (max-width: 960px) {
  .card-main,
  .detail-head {
    grid-template-columns: 1fr;
  }

  .filters-head {
    display: grid;
  }

  .filters-count {
    min-width: 0;
    text-align: left;
  }

  .card-right {
    text-align: left;
  }

  .card-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav {
    gap: 12px;
    font-size: 0.95rem;
  }

  .dashboard-card {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .header-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
  }

  .header-home,
  .header-title,
  .main-nav {
    justify-self: center;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}
