/**
 * SyndicPilot — public pages (landing, login, inscription)
 * Design tokens + layout. Does not alter backend or JS contracts (ids preserved).
 */

:root {
  --sp-primary: #0f766e;
  --sp-primary-dark: #0d5c56;
  --sp-primary-light: #14b8a6;
  --sp-accent: #f59e0b;
  --sp-accent-hover: #d97706;
  --sp-ink: #0f172a;
  --sp-ink-muted: #475569;
  --sp-surface: #ffffff;
  --sp-surface-alt: #f8fafc;
  --sp-border: #e2e8f0;
  --sp-radius: 12px;
  --sp-radius-lg: 20px;
  --sp-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --sp-shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --sp-font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

/* ---------- Base ---------- */
.sp-body {
  font-family: var(--sp-font);
  color: var(--sp-ink);
  background: var(--sp-surface-alt);
  -webkit-font-smoothing: antialiased;
}

.sp-body a {
  color: var(--sp-primary);
  text-decoration: none;
}
.sp-body a:hover {
  color: var(--sp-primary-dark);
}

/* ---------- Landing navbar ---------- */
.sp-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  transition: box-shadow 0.2s ease;
}
.sp-nav.scrolled {
  box-shadow: var(--sp-shadow);
}

/* Header foncé + logo clair (ex. page d’accueil) */
.sp-nav.sp-nav--dark {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sp-nav.sp-nav--dark.scrolled {
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
.sp-nav.sp-nav--dark .sp-navbar-menu a {
  color: rgba(255, 255, 255, 0.88);
}
.sp-nav.sp-nav--dark .sp-navbar-menu a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.sp-nav.sp-nav--dark .sp-btn-ghost {
  color: rgba(255, 255, 255, 0.92);
}
.sp-nav.sp-nav--dark .sp-btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.sp-nav.sp-nav--dark .hamburger,
.sp-nav.sp-nav--dark .hamburger::before,
.sp-nav.sp-nav--dark .hamburger::after {
  background: #fff;
}

.sp-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--sp-ink);
}
.sp-nav-brand img {
  height: auto;
  max-height: 40px;
  width: auto;
  max-width: min(200px, 55vw);
  display: block;
}
/* Header accueil : icône + texte (le SVG « full » avec <text> est peu fiable en <img>) */
.sp-body .sp-nav.sp-nav--dark .sp-nav-brand--home,
.sp-body .sp-nav.sp-nav--dark .sp-nav-brand--home:visited {
  color: #fff;
}
.sp-body .sp-nav.sp-nav--dark .sp-nav-brand--home:hover {
  color: #fff;
  opacity: 0.95;
}
.sp-nav-brand--home {
  gap: 0.65rem;
}
.sp-nav-brand__mark {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  max-height: none;
  max-width: none;
  margin-bottom: 0;
  object-fit: contain;
}
.sp-nav-brand__text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}
.sp-nav-brand__pilot {
  color: #99f6e4;
}
/* Barre claire : wordmark foncé */
.sp-body .sp-nav:not(.sp-nav--dark) .sp-nav-brand--home,
.sp-body .sp-nav:not(.sp-nav--dark) .sp-nav-brand--home:visited {
  color: var(--sp-ink);
}
.sp-body .sp-nav:not(.sp-nav--dark) .sp-nav-brand--home:hover {
  color: var(--sp-ink);
  opacity: 0.9;
}
.sp-nav:not(.sp-nav--dark) .sp-nav-brand__pilot {
  color: var(--sp-primary);
}
/* Même classe que login/inscription quand tu utilises le logo image seul ailleurs */
.sp-nav-brand .sp-auth-logo:not(.sp-nav-brand__mark) {
  max-height: 40px;
  max-width: min(220px, 55vw);
  width: auto;
  margin-bottom: 0;
  opacity: 1;
}
.sp-nav-brand span {
  letter-spacing: -0.02em;
}
.sp-nav-brand .sp-dot {
  color: var(--sp-primary);
}

.sp-navbar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.sp-navbar-menu a {
  display: block;
  padding: 0.5rem 0.85rem;
  color: var(--sp-ink-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.sp-navbar-menu a:hover {
  color: var(--sp-primary);
  background: rgba(15, 118, 110, 0.08);
}

.sp-nav-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sp-btn-ghost {
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--sp-ink-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
}
.sp-btn-ghost:hover {
  color: var(--sp-primary);
  background: rgba(15, 118, 110, 0.08);
}
.sp-btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #fff;
  background: linear-gradient(135deg, var(--sp-primary) 0%, var(--sp-primary-light) 100%);
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.sp-btn-solid:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.4);
}

.menu-toggle {
  display: none;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
}
.hamburger {
  width: 22px;
  height: 2px;
  background: var(--sp-ink);
  position: relative;
  transition: background 0.2s;
}
.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--sp-ink);
  transition: transform 0.2s;
}
.hamburger::before {
  top: -7px;
}
.hamburger::after {
  top: 7px;
}
.hamburger.active {
  background: transparent;
}
.hamburger.active::before {
  top: 0;
  transform: rotate(45deg);
}
.hamburger.active::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 991px) {
  .menu-toggle {
    display: block;
  }
  .sp-navbar-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: var(--sp-surface);
    border-bottom: 1px solid var(--sp-border);
    box-shadow: var(--sp-shadow);
  }
  .sp-navbar-menu.active {
    display: flex;
  }
  .sp-nav.sp-nav--dark .sp-navbar-menu {
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  }
  .sp-nav-cta {
    display: none;
  }
  .sp-nav-cta.sp-mobile-show {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 1rem 1rem;
    background: var(--sp-surface);
    border-bottom: 1px solid var(--sp-border);
  }
}

/* ---------- Hero ---------- */
.sp-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 56px;
}
.sp-hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.sp-hero-video-wrap video,
.sp-hero-video-wrap .sp-hero-bg-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
}
.sp-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.82) 0%,
    rgba(15, 118, 110, 0.55) 50%,
    rgba(15, 23, 42, 0.75) 100%
  );
}
.sp-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 900px;
}
.sp-hero-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #99f6e4;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}
.sp-hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.sp-hero .sp-lead {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: rgba(255, 255, 255, 0.88);
  font-weight: 400;
  margin-bottom: 1.75rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}
.sp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.sp-btn-white {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--sp-ink);
  background: #fff;
  border: none;
  border-radius: 10px;
  box-shadow: var(--sp-shadow);
  transition: transform 0.15s;
}
.sp-btn-white:hover {
  color: var(--sp-ink);
  transform: translateY(-2px);
}
.sp-btn-outline-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: #fff;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.sp-btn-outline-light:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

/* ---------- Sections ---------- */
.sp-section {
  padding: 4rem 0;
}
.sp-section-alt {
  background: var(--sp-surface);
}
.sp-section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sp-ink);
  margin-bottom: 0.75rem;
}
.sp-section-sub {
  color: var(--sp-ink-muted);
  font-size: 1.05rem;
  max-width: 36rem;
}

.sp-feature-card {
  height: 100%;
  padding: 1.75rem;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sp-feature-card:hover {
  border-color: rgba(15, 118, 110, 0.25);
  box-shadow: var(--sp-shadow-lg);
}
.sp-feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(20, 184, 166, 0.15));
  color: var(--sp-primary);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.sp-feature-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--sp-ink);
}
.sp-feature-card p {
  color: var(--sp-ink-muted);
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
  line-height: 1.55;
}

.sp-img-rounded {
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-lg);
}

/* ---------- Auth pages (login / inscription) ---------- */
.sp-auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.sp-auth-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
@media (max-width: 991px) {
  .sp-auth-split {
    grid-template-columns: 1fr;
  }
}
.sp-auth-brand {
  background: linear-gradient(160deg, var(--sp-primary-dark) 0%, var(--sp-primary) 45%, #0d4f4a 100%);
  color: #fff;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.sp-auth-brand::before {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  top: -120px;
  right: -100px;
}
.sp-auth-brand::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  bottom: -80px;
  left: -60px;
}
.sp-auth-brand-inner {
  position: relative;
  z-index: 1;
}
.sp-auth-brand h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.sp-auth-brand p {
  opacity: 0.92;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 22rem;
}
.sp-auth-brand .sp-auth-logo {
  height: auto;
  width: 100%;
  max-width: 220px;
  margin-bottom: 1.5rem;
  opacity: 0.98;
}
.sp-auth-footer-note {
  position: relative;
  z-index: 1;
  font-size: 0.8125rem;
  opacity: 0.75;
}
.sp-auth-footer-note a {
  color: #99f6e4;
}

.sp-auth-panel {
  background: var(--sp-surface-alt);
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sp-auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--sp-surface);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-lg);
  border: 1px solid var(--sp-border);
  overflow: hidden;
}
.sp-auth-card-header {
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--sp-border);
}
.sp-auth-card-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
  color: var(--sp-ink);
}
.sp-auth-card-header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--sp-ink-muted);
}
.sp-auth-card-body {
  padding: 1.5rem 1.75rem;
}
.sp-auth-card-footer {
  padding: 1rem 1.75rem 1.5rem;
  background: var(--sp-surface-alt);
  border-top: 1px solid var(--sp-border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--sp-ink-muted);
}
.sp-auth-card-footer a {
  font-weight: 600;
}

.sp-input-group .input-group-text {
  background: var(--sp-surface-alt);
  border-color: var(--sp-border);
  color: var(--sp-primary);
}
.sp-input-group .form-control {
  border-color: var(--sp-border);
  padding: 0.65rem 0.85rem;
}
.sp-input-group .form-control:focus {
  border-color: var(--sp-primary-light);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}
.sp-btn-submit {
  width: 100%;
  padding: 0.7rem 1rem;
  font-weight: 700;
  font-size: 0.9375rem;
  color: #fff;
  background: linear-gradient(135deg, var(--sp-primary) 0%, var(--sp-primary-light) 100%);
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.sp-btn-submit:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.4);
}
.sp-auth-home {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  transition: background 0.15s;
}
.sp-auth-home:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.25);
}
@media (max-width: 991px) {
  .sp-auth-home {
    top: 1rem;
    right: 1rem;
  }
  .sp-auth-brand {
    min-height: 200px;
    padding: 1.75rem;
  }
}

/* Newsletter (landing footer) */
.sp-newsletter .form-control {
  border-radius: 10px 0 0 10px;
  border: 1px solid var(--sp-border);
  padding: 0.65rem 1rem;
}
.sp-newsletter .btn-sp-go {
  border-radius: 0 10px 10px 0;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  background: var(--sp-primary);
  color: #fff;
  border: 1px solid var(--sp-primary);
}
.sp-newsletter .btn-sp-go:hover {
  background: var(--sp-primary-dark);
  border-color: var(--sp-primary-dark);
  color: #fff;
}

.sp-footer {
  background: var(--sp-ink);
  color: rgba(255, 255, 255, 0.75);
  padding: 3rem 0 2rem;
}
.sp-footer h3 {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.sp-footer a {
  color: #99f6e4;
}
.sp-social a {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  margin-right: 0.35rem;
  transition: background 0.15s;
}
.sp-social a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

/* ---------- Espace résident (resident.html) ---------- */
.sp-resident-hero {
  margin-top: 56px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #115e59 45%, #0d9488 100%);
}
.sp-resident-hero h1 {
  color: #fff;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.sp-resident-hero #name_resident {
  color: #99f6e4 !important;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 600;
  margin: 0;
}
.sp-resident-card {
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow);
  padding: 1.5rem;
  height: 100%;
}
.sp-resident-card .table {
  font-size: 0.9rem;
}
.sp-resident-card .table a {
  color: var(--sp-primary);
  font-weight: 600;
}
.sp-resident-sidebar-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--sp-ink);
  margin-bottom: 1rem;
}
.sp-resident-comment-box {
  background: var(--sp-surface-alt);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
/* Discussions (resident.html) — liste sujets + fil de messages */
.sp-resident-discussion-list {
  min-height: 2rem;
}
#res_commentaire .sp-resident-topic-card {
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
#res_commentaire .sp-resident-topic-card:hover {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: var(--sp-shadow);
}
#res_commentaire .sp-resident-topic-card:focus {
  outline: 2px solid var(--sp-primary);
  outline-offset: 2px;
}
.sp-resident-msg-card {
  background: #f0fdfa;
  border: 1px solid rgba(15, 118, 110, 0.22) !important;
}
/* Bloc Services (resident.html) : bandeau titre + fiches */
.sp-resident-card.sp-resident-services-card {
  padding: 0;
  overflow: hidden;
}
.sp-resident-services-header {
  width: 100%;
  margin: 0;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(135deg, #0f172a 0%, #115e59 48%, #0d9488 100%);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.sp-resident-services-body {
  padding: 1rem 1.25rem 1.25rem;
  background: var(--sp-surface);
}
.sp-resident-service-item {
  background: var(--sp-surface-alt);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}
.sp-resident-service-item:last-child {
  margin-bottom: 0;
}
.sp-resident-service-line {
  font-size: 0.9375rem;
  color: var(--sp-ink);
  line-height: 1.5;
}
.sp-resident-service-label {
  font-weight: 700;
  color: var(--sp-primary);
  margin-right: 0.35rem;
}
.sp-resident-services-empty {
  text-align: center;
  padding: 0.5rem 0;
}
/* Tableau cotisations (resident.html) — en-tête comme le bandeau Services */
.sp-resident-cotisation-table {
  font-size: 0.875rem;
}
.sp-resident-cotisation-table thead th {
  background: linear-gradient(135deg, #0f172a 0%, #115e59 48%, #0d9488 100%);
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 0.65rem 0.75rem;
  white-space: nowrap;
}
.sp-resident-cotisation-table thead th:first-child {
  border-radius: var(--sp-radius) 0 0 0;
}
.sp-resident-cotisation-table thead th:last-child {
  border-radius: 0 var(--sp-radius) 0 0;
}
.sp-resident-cotisation-table tbody td {
  border-color: var(--sp-border);
  padding: 0.55rem 0.75rem;
  vertical-align: middle;
}
.sp-resident-cotisation-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 var(--sp-radius);
}
.sp-resident-cotisation-table tbody tr:last-child td:last-child {
  border-radius: 0 0 var(--sp-radius) 0;
}
@media print {
  .sp-nav,
  .sp-footer,
  .sp-resident-no-print {
    display: none !important;
  }
  .sp-resident-hero {
    margin-top: 0;
    min-height: auto;
    padding: 1rem;
  }
}
