/* Les Étincelles 72 — Application V3.0
   Palette claire harmonisée avec le Kiosk Adhérents. */

:root {
  --bg: #f8f5f1;
  --bg-soft: #fffdfb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #40251a;
  --muted: #7c5c4a;
  --brand: #a56a4b;
  --brand-dark: #7d4936;
  --brand-soft: #f2e4dc;
  --accent: #ffb3a8;
  --accent-soft: #fff3f1;
  --success: #3f8a62;
  --border: rgba(165, 106, 75, 0.18);
  --border-strong: rgba(165, 106, 75, 0.36);
  --shadow: 0 10px 30px rgba(64, 37, 26, 0.08);
  --shadow-hover: 0 16px 36px rgba(64, 37, 26, 0.14);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 179, 168, 0.22), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(165, 106, 75, 0.11), transparent 26rem),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(165, 106, 75, 0.08) 0.8px, transparent 0.8px);
  background-size: 20px 20px;
  opacity: 0.28;
}

::selection {
  color: var(--text);
  background: var(--accent);
}

a {
  color: var(--brand-dark);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.contact-card a,
.link-card {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 17px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

button:hover,
.contact-card a:hover,
.link-card:hover {
  border-color: var(--border-strong);
  background: #ead8ce;
}

button:active,
.card:active {
  transform: scale(0.985);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.card-link:focus-visible {
  outline: 3px solid rgba(165, 106, 75, 0.28);
  outline-offset: 3px;
}

.app-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 390px);
  gap: 24px;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 48px) 10px;
}

.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.app-logo {
  width: min(245px, 70vw);
  height: auto;
  margin: 0;
  filter: drop-shadow(0 10px 22px rgba(64, 37, 26, 0.12));
}

.tagline {
  display: block;
  margin-bottom: 7px;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.app-subtitle h1 {
  max-width: 650px;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-weight: 650;
  line-height: 1.3;
}

.status-card,
.form-card,
.contact-card,
.tool-info-card,
.stat-card,
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.status-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
  width: 100%;
  padding: 18px;
}

.status-card .pulse {
  grid-row: 1 / span 2;
}

.status-card strong {
  font-size: 1rem;
}

.status-card small {
  color: var(--muted);
  line-height: 1.4;
}

.pulse {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(63, 138, 98, 0.12);
}

.auth-actions {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  margin-top: 8px;
}

.auth-actions button:first-child {
  border-color: var(--brand);
  color: #ffffff;
  background: var(--brand);
}

.auth-actions button:first-child:hover {
  background: var(--brand-dark);
}

main {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 24px 34px;
}

.quick-actions {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 6px;
  padding: 14px 8px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(165, 106, 75, 0.09);
  background: rgba(248, 245, 241, 0.86);
  backdrop-filter: blur(14px);
}

.quick-actions button {
  flex: 0 0 auto;
  border-color: transparent;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 16px rgba(64, 37, 26, 0.06);
}

.quick-actions button:hover {
  border-color: var(--border);
  background: var(--surface-strong);
}

.quick-actions button.active,
button[type="submit"] {
  border-color: var(--brand);
  color: #ffffff;
  background: var(--brand);
}

.quick-actions button.active:hover,
button[type="submit"]:hover {
  background: var(--brand-dark);
}

.tab {
  display: none;
  animation: soft-fade 0.22s ease;
}

.tab.active {
  display: block;
}

@keyframes soft-fade {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid,
.tools-grid,
.stats-grid {
  display: grid;
  gap: 18px;
}

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

.cards .welcome-card {
  grid-column: 1 / -1;
}

.welcome-list {
  margin: 12px 0;
  padding-left: 20px;
  line-height: 1.55;
}

.welcome-list li {
  margin-bottom: 6px;
}

.welcome-note {
  font-size: 0.92rem;
}

.card {
  min-height: 176px;
  padding: 22px;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.card.featured {
  border-color: rgba(255, 179, 168, 0.72);
  background: linear-gradient(145deg, var(--accent-soft), #ffffff);
}

.card span {
  display: block;
  margin-bottom: 9px;
  font-size: 1.9rem;
}

.card h2,
.section-title h2 {
  margin: 0 0 9px;
  color: var(--text);
}

.card h2 {
  font-size: 1.35rem;
}

.card p,
.card small,
.section-title p,
label,
td,
footer,
.mini-stats,
.empty-state {
  color: var(--muted);
}

.card p {
  margin: 0;
  line-height: 1.55;
}

.card small {
  display: inline-block;
  margin-top: 14px;
  font-weight: 650;
}

.card-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.section-title {
  margin: 28px 0 18px;
}

.section-title h2 {
  font-size: clamp(1.55rem, 3vw, 2rem);
}

.section-title p {
  margin: 0;
  line-height: 1.5;
}

#toolsGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#toolsGrid .card {
  min-height: 205px;
  border-top: 4px solid var(--brand);
}

#toolsGrid .card.welcome-card {
  grid-column: 1 / -1;
  border-top-color: var(--accent);
  background: linear-gradient(145deg, var(--accent-soft), #ffffff);
}

.tools-dashboard {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
  margin: 18px 0;
}

.tool-info-card {
  padding: 20px;
}

.toolbar {
  margin: 18px 0;
}

.form-card {
  display: grid;
  gap: 15px;
  padding: 24px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 13px 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 2px rgba(64, 37, 26, 0.035);
}

input::placeholder,
textarea::placeholder {
  color: #a08577;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(165, 106, 75, 0.1);
}

input[readonly] {
  background: #f3efeb;
}

textarea {
  min-height: 105px;
  resize: vertical;
}

.form-card button[type="button"] {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 112px;
  padding: 18px;
}

.stat-card strong {
  color: var(--brand-dark);
  font-size: 1.65rem;
  line-height: 1.2;
}

.stat-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.volunteer-toolbar {
  display: grid;
  grid-template-columns: 1.5fr 1fr repeat(2, 0.8fr) auto;
  gap: 10px;
  margin: 18px 0;
}

.mini-stats,
.empty-state,
.loading-line {
  margin: 10px 0 16px;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text);
  background: var(--brand-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(255, 179, 168, 0.08);
}

#agendaGrid {
  grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
}

#agendaGrid .card {
  display: flex;
  flex-direction: column;
  min-height: 330px;
}

#agendaGrid .card .desc {
  flex-grow: 1;
  margin-top: 8px;
  font-size: 0.92rem;
}

#agendaGrid .card .date {
  color: var(--brand-dark);
  font-weight: 700;
}

#agendaGrid .card .location {
  font-size: 0.92rem;
}

#agendaGrid .card .address {
  margin-top: 12px;
  font-size: 0.82rem;
}

.badge {
  align-self: flex-start;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--text);
  background: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
}

.contact-card {
  margin-top: 28px;
  padding: 28px;
}

.contact-card a {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  border-color: var(--brand);
  color: #ffffff;
  background: var(--brand);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 48px);
  border-top: 1px solid rgba(165, 106, 75, 0.1);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .app-top {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }

  .status-card {
    max-width: 620px;
    margin: 0 auto;
  }

  .cards,
  #toolsGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards .card:first-child {
    grid-column: 1 / -1;
  }

  .tools-dashboard,
  .volunteer-toolbar {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .app-top {
    padding-right: 14px;
    padding-left: 14px;
  }

  .app-logo {
    width: min(215px, 74vw);
  }

  .app-subtitle h1 {
    max-width: 340px;
    font-size: 1.12rem;
  }

  main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .quick-actions {
    justify-content: flex-start;
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .quick-actions button {
    padding: 11px 15px;
    font-size: 0.92rem;
  }

  .cards,
  #toolsGrid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .cards .card:first-child,
  .cards .welcome-card {
    grid-column: auto;
  }

  .card,
  #toolsGrid .card.welcome-card {
    grid-column: auto;
  }

  #toolsGrid .card {
    min-height: 0;
    padding: 19px;
  }

  .form-card,
  .contact-card {
    padding: 19px;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
