/* ==========================================================================
   Coloka — Design System
   ==========================================================================
   Palette : Coloka Blue #2E5FAC
   Philosophie : éditorial, aéré, chaleureux, mobile-first
   ========================================================================== */

/* -------- Design Tokens -------- */
:root {
  /* Brand */
  --coloka-blue:        #2E5FAC;
  --coloka-blue-dark:   #1B3A6B;
  --coloka-blue-deep:   #0F2447;
  --coloka-blue-light:  #E8F0FF;
  --coloka-blue-mist:   #F4F8FF;
  --coloka-accent:      #5B9BD5;
  --coloka-gold:        #F4B942;     /* accent chaleureux */
  --coloka-coral:       #FF7A59;     /* pour CTA secondaire */

  /* Neutres */
  --ink-900: #0B1220;
  --ink-800: #1A1F2E;
  --ink-700: #2A3142;
  --ink-500: #5A6478;
  --ink-400: #8892A6;
  --ink-300: #B7BFCF;
  --ink-200: #DDE3ED;
  --ink-100: #EEF2F8;
  --ink-50:  #F8FAFE;

  /* Sémantique */
  --surface:     #FFFFFF;
  --surface-2:   #F8FAFE;
  --surface-3:   #EEF2F8;
  --border:      #E3E8F0;
  --border-strong: #CAD2E0;
  --text:        var(--ink-900);
  --text-muted:  var(--ink-500);
  --text-dim:    var(--ink-400);

  --success: #15803D;
  --success-bg: #DCFCE7;
  --warning: #B45309;
  --warning-bg: #FEF3C7;
  --error:   #DC2626;
  --error-bg: #FEE2E2;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 999px;

  /* Shadows — subtils mais réels */
  --shadow-xs: 0 1px 2px rgba(11,18,32,0.04);
  --shadow-sm: 0 2px 6px rgba(11,18,32,0.06);
  --shadow-md: 0 6px 20px rgba(11,18,32,0.08);
  --shadow-lg: 0 12px 36px rgba(11,18,32,0.12);
  --shadow-brand: 0 12px 32px rgba(46,95,172,0.25);

  /* Transitions */
  --t-fast: 120ms cubic-bezier(.4,0,.2,1);
  --t-base: 200ms cubic-bezier(.4,0,.2,1);
  --t-slow: 320ms cubic-bezier(.2,.8,.2,1);

  /* Typography */
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --nav-h: 68px;
  --container-max: 1200px;
  --container-narrow: 760px;
}

/* -------- Reset -------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--surface-2);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; }
a { color: var(--coloka-blue); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--coloka-blue-dark); }

/* -------- Containers -------- */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; width: 100%; }
.container.narrow { max-width: var(--container-narrow); }
main { flex: 1; }

/* -------- Typography scale -------- */
.h-display { font-size: clamp(2.2rem, 5vw + 1rem, 4rem); line-height: 1.05; letter-spacing: -0.025em; font-weight: 800; }
.h-1 { font-size: clamp(1.8rem, 2.5vw + 1rem, 2.6rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.h-2 { font-size: clamp(1.4rem, 1.5vw + 0.8rem, 2rem); line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; }
.h-3 { font-size: 1.25rem; line-height: 1.3; font-weight: 600; }
.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--coloka-blue); font-weight: 600;
}
.muted { color: var(--text-muted); }

/* ==========================================================================
   HEADER — glassmorphic sticky, identical across ALL pages
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(227,232,240,0.6);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: box-shadow var(--t-base);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--coloka-blue); text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { color: var(--coloka-blue-dark); text-decoration: none; }
.brand-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 2px 8px rgba(46,95,172,0.18), inset 0 0 0 1px rgba(46,95,172,0.08);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

.site-nav {
  display: flex; align-items: center; gap: 6px;
}
.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-700);
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-link:hover { background: var(--ink-100); color: var(--coloka-blue); text-decoration: none; }
.nav-link.active { color: var(--coloka-blue); }
.nav-link.active::after {
  content: ""; position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px; border-radius: 2px;
  background: var(--coloka-blue);
}

.nav-divider {
  width: 1px; height: 20px; background: var(--border); margin: 0 6px;
}

/* Auth nav (logged-in user chip + logout) */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--ink-100);
  border-radius: var(--r-pill);
  color: var(--ink-800);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background var(--t-fast);
}
.user-chip:hover { background: var(--coloka-blue-light); color: var(--coloka-blue-dark); text-decoration: none; }
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--coloka-blue), var(--coloka-accent));
  color: white; font-weight: 600; font-size: 0.78rem;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.user-chip .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Language toggle — round icon button */
.lang-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 42px; height: 34px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-700);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: all var(--t-fast);
}
.lang-btn:hover { background: var(--ink-100); border-color: var(--border-strong); color: var(--coloka-blue); }
.lang-btn:active { transform: scale(0.94); }

/* Mobile menu toggle */
.nav-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  color: var(--ink-800);
}
.nav-burger:hover { background: var(--ink-100); }

/* ==========================================================================
   BUTTONS — unifiés
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  font-size: 0.92rem; font-weight: 600;
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-primary {
  background: var(--coloka-blue);
  color: white;
  box-shadow: 0 4px 12px rgba(46,95,172,0.2);
}
.btn-primary:hover:not(:disabled) {
  background: var(--coloka-blue-dark);
  box-shadow: 0 6px 18px rgba(46,95,172,0.3);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink-800);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--ink-50);
  border-color: var(--border-strong);
  color: var(--coloka-blue);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-700);
}
.btn-ghost:hover:not(:disabled) { background: var(--ink-100); color: var(--coloka-blue); text-decoration: none; }

.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #B91C1C; color: white; text-decoration: none; }

.btn-danger-outline {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(220,38,38,0.3);
}
.btn-danger-outline:hover:not(:disabled) { background: var(--error-bg); color: #991B1B; text-decoration: none; }

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--r-md); }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: var(--r-sm); }
.btn-pill { border-radius: var(--r-pill); }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; }

/* CTA emphasis variant (used on hero / landing) */
.btn-cta {
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  background: white;
  color: var(--coloka-blue);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}
.btn-cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--coloka-blue-dark); text-decoration: none; }

/* ==========================================================================
   HERO (index)
   ========================================================================== */
.hero {
  position: relative;
  padding: 100px 0 120px;
  background:
    radial-gradient(ellipse at top left, rgba(91,155,213,0.25), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(244,185,66,0.12), transparent 55%),
    linear-gradient(180deg, var(--coloka-blue-deep) 0%, var(--coloka-blue) 60%, var(--coloka-blue-dark) 100%);
  color: white;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><g fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"><path d="M30 0v60M0 30h60"/></g></svg>');
  opacity: 0.4;
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; text-align: center; max-width: 820px; }
.hero .eyebrow { color: rgba(255,255,255,0.85); }
.hero h1 {
  font-size: clamp(2.4rem, 5vw + 1rem, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 14px 0 20px;
}
.hero h1 .accent {
  background: linear-gradient(135deg, #FFE694, var(--coloka-gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
.hero p.lead {
  font-size: clamp(1rem, 0.6vw + 0.9rem, 1.2rem);
  opacity: 0.9;
  max-width: 620px;
  margin: 0 auto 32px;
}
.hero-cta-row {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 12px;
}
.hero-stats {
  display: flex; justify-content: center; gap: 40px; flex-wrap: wrap;
  margin-top: 56px; padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.15);
  opacity: 0.9;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
.hero-stat .label { font-size: 0.8rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.08em; }

/* Decorative floating cards in hero */
.hero-decor {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.hero-decor .float-card {
  position: absolute;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-lg);
  padding: 16px;
  color: white;
  box-shadow: var(--shadow-lg);
  animation: floatY 6s ease-in-out infinite;
}
.hero-decor .float-card:nth-child(1) { top: 15%; left: 5%; transform: rotate(-6deg); width: 180px; }
.hero-decor .float-card:nth-child(2) { top: 55%; left: 8%; transform: rotate(4deg); width: 160px; animation-delay: 1.5s; }
.hero-decor .float-card:nth-child(3) { top: 20%; right: 6%; transform: rotate(7deg); width: 170px; animation-delay: 0.7s; }
.hero-decor .float-card:nth-child(4) { top: 58%; right: 4%; transform: rotate(-5deg); width: 175px; animation-delay: 2.2s; }
.hero-decor .float-card .emoji { font-size: 1.8rem; margin-bottom: 6px; }
.hero-decor .float-card .title { font-size: 0.82rem; font-weight: 600; }
.hero-decor .float-card .price { font-size: 0.92rem; font-weight: 700; color: var(--coloka-gold); margin-top: 4px; }
@keyframes floatY {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-12px) rotate(var(--r, 0deg)); }
}
@media (max-width: 960px) { .hero-decor { display: none; } }

/* ==========================================================================
   FEATURES grid (index)
   ========================================================================== */
.section { padding: 80px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem); letter-spacing: -0.02em; font-weight: 700; }
.section-head p { color: var(--text-muted); margin-top: 10px; font-size: 1.05rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--coloka-blue), var(--coloka-accent));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-slow);
}
.feature-card:hover {
  border-color: var(--coloka-blue-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.feature-card:hover::before { transform: scaleX(1); }
.feature-card .icon {
  width: 52px; height: 52px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--coloka-blue-light), #D6E8FF);
  color: var(--coloka-blue);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

/* ==========================================================================
   LISTINGS PAGE (Explorer)
   ========================================================================== */
.explorer-head {
  background: linear-gradient(180deg, var(--coloka-blue-mist) 0%, transparent 100%);
  padding: 48px 0 24px;
}
.explorer-head h1 { font-size: clamp(1.8rem, 2.5vw + 1rem, 2.8rem); letter-spacing: -0.025em; font-weight: 800; }
.explorer-head .subtitle { color: var(--text-muted); margin-top: 8px; }

/* Search hero — a searchbar that feels like a primary action */
.search-hero {
  background: var(--surface);
  border-radius: var(--r-2xl);
  padding: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 4px;
  margin-top: 28px;
  align-items: stretch;
}
.search-hero .sh-field {
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--r-lg);
  transition: background var(--t-fast);
}
.search-hero .sh-field:hover { background: var(--surface-2); }
.search-hero .sh-field + .sh-field { border-left: 1px solid var(--border); }
.search-hero .sh-field .sh-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
}
.search-hero .sh-field input,
.search-hero .sh-field select {
  border: 0; outline: 0;
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  padding: 0;
  width: 100%;
}
.search-hero .sh-field input::placeholder { color: var(--text-dim); }
.search-hero .sh-submit {
  align-self: center;
  padding: 14px 22px;
}

/* Responsive search hero — stacks */
@media (max-width: 720px) {
  .search-hero { grid-template-columns: 1fr; }
  .search-hero .sh-field + .sh-field { border-left: 0; border-top: 1px solid var(--border); }
  .search-hero .sh-submit { margin: 4px; }
}

/* Filter bar — sticky chips below the search hero */
.filter-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 20;
  background: rgba(248,250,254,0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  margin-top: 24px;
}
.filter-row {
  display: flex; gap: 10px; align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.filter-row::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-700);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t-fast);
  user-select: none;
}
.chip:hover { border-color: var(--coloka-blue); color: var(--coloka-blue); }
.chip.active {
  background: var(--coloka-blue);
  color: white;
  border-color: var(--coloka-blue);
  box-shadow: 0 4px 10px rgba(46,95,172,0.25);
}
.chip.active:hover { background: var(--coloka-blue-dark); }
.chip .x { font-size: 1.05rem; line-height: 1; opacity: 0.7; }
.chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.8;
}

.filter-divider {
  width: 1px; align-self: stretch; background: var(--border); margin: 4px 4px;
  flex-shrink: 0;
}

/* Sort + view controls */
.filter-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.view-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
}
.view-toggle button {
  padding: 6px 10px;
  border-radius: calc(var(--r-md) - 3px);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--t-fast);
  display: inline-flex; align-items: center; gap: 4px;
}
.view-toggle button.active {
  background: var(--coloka-blue);
  color: white;
}

.sort-select {
  padding: 8px 34px 8px 14px;
  border: 1px solid var(--border);
  background: var(--surface) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="%235A6478"><path d="M6 8L2 4h8z"/></svg>') no-repeat right 12px center;
  border-radius: var(--r-md);
  font-size: 0.86rem;
  color: var(--ink-700);
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.sort-select:focus { outline: 2px solid var(--coloka-blue-light); border-color: var(--coloka-blue); }

/* Results header */
.results-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin: 28px 0 20px;
}
.results-count {
  font-size: 1rem;
  color: var(--text-muted);
}
.results-count strong {
  color: var(--text); font-weight: 700; font-size: 1.15rem;
}

/* Listings grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding-bottom: 60px;
}
.listings-grid.list-view {
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Listing card */
.listing-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  animation: cardIn var(--t-slow) both;
}
.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--coloka-blue-light);
  text-decoration: none;
  color: inherit;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.listing-card .media {
  position: relative;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--coloka-blue-light), var(--surface-3));
  overflow: hidden;
}
.listing-card .media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 400ms cubic-bezier(.2,.8,.2,1);
}
.listing-card:hover .media img { transform: scale(1.04); }
.listing-card .media .media-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--coloka-blue); font-size: 2.4rem; opacity: 0.6;
}
.listing-card .media .type-badge {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-800);
  box-shadow: var(--shadow-xs);
}
.listing-card .media .fav-btn {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-500);
  transition: all var(--t-fast);
  box-shadow: var(--shadow-xs);
}
.listing-card .media .fav-btn:hover { color: var(--error); transform: scale(1.08); }
.listing-card .media .fav-btn.active { color: var(--error); }

.listing-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-card .body .city-row {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 0.82rem;
}
.listing-card .body h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-card .body .meta {
  display: flex; gap: 10px; color: var(--text-muted); font-size: 0.82rem;
  margin-top: 2px; flex-wrap: wrap;
}
.listing-card .body .meta .dot { color: var(--ink-300); }
.listing-card .body .price-row {
  display: flex; align-items: baseline; gap: 4px;
  margin-top: auto; padding-top: 10px;
}
.listing-card .body .price-row .price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.listing-card .body .price-row .per {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* List view — horizontal layout */
.listings-grid.list-view .listing-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
}
.listings-grid.list-view .listing-card .media {
  aspect-ratio: auto;
  height: 100%;
  min-height: 180px;
}
@media (max-width: 640px) {
  .listings-grid.list-view .listing-card { grid-template-columns: 1fr; }
  .listings-grid.list-view .listing-card .media { aspect-ratio: 4/3; min-height: 0; }
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--ink-100) 0%, var(--ink-50) 50%, var(--ink-100) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.skeleton-card .sk-media { aspect-ratio: 4/3; }
.skeleton-card .sk-body { padding: 16px 18px 18px; }
.skeleton-card .sk-line { height: 12px; margin-bottom: 10px; border-radius: 4px; }
.skeleton-card .sk-line.short { width: 40%; }
.skeleton-card .sk-line.medium { width: 70%; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 20px 60px;
}
.empty-state .illustration {
  width: 120px; height: 120px;
  margin: 0 auto 20px;
  color: var(--coloka-blue);
  opacity: 0.7;
}
.empty-state h3 { font-size: 1.3rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); max-width: 420px; margin: 0 auto 20px; }

/* Pagination / load more */
.pagination-wrap {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  padding: 20px 0 60px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 40px; height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-700);
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--t-fast);
  display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover:not(:disabled) { border-color: var(--coloka-blue); color: var(--coloka-blue); }
.page-btn.active {
  background: var(--coloka-blue);
  color: white;
  border-color: var(--coloka-blue);
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-ellipsis { color: var(--text-dim); padding: 0 4px; }

/* ==========================================================================
   LISTING DETAIL PAGE
   ========================================================================== */
.listing-detail { padding: 20px 0 60px; }

/* Back bar — sticky sous le header, retour explicite */
.back-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--ink-800);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--t-fast);
}
.back-link:hover {
  background: var(--coloka-blue-light);
  border-color: var(--coloka-blue-light);
  color: var(--coloka-blue-dark);
  text-decoration: none;
  transform: translateX(-2px);
}
.back-link svg { flex-shrink: 0; }

.share-actions { display: inline-flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--ink-700);
  transition: all var(--t-fast);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--coloka-blue-light);
  color: var(--coloka-blue);
  border-color: var(--coloka-blue-light);
  transform: translateY(-1px);
}
.icon-btn.active { color: var(--error); background: var(--error-bg); border-color: var(--error-bg); }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--coloka-blue); }
.breadcrumb .sep { opacity: 0.5; }

/* Gallery grid 2+4 = Airbnb-style */
.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 220px 220px;
  gap: 8px;
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
}
.gallery > .g-img {
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.gallery > .g-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--t-slow);
}
.gallery > .g-img:hover img { transform: scale(1.05); }
.gallery > .g-img::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,0); transition: background var(--t-fast);
}
.gallery > .g-img:hover::after { background: rgba(0,0,0,0.08); }
.gallery .g-main {
  grid-row: 1 / span 2;
  background: linear-gradient(135deg, var(--coloka-blue-light), var(--surface-3));
}
.gallery .g-more {
  position: absolute;
  right: 16px; bottom: 16px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-radius: var(--r-pill);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-800);
  box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; gap: 6px;
  border: 0;
  cursor: pointer;
  transition: all var(--t-fast);
}
.gallery .g-more:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.gallery-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 2.4rem; color: var(--coloka-blue); opacity: 0.4;
}

@media (max-width: 720px) {
  .gallery {
    grid-template-columns: 1fr; grid-template-rows: 280px;
    gap: 0;
  }
  .gallery > .g-img:not(.g-main) { display: none; }
  .gallery .g-main { grid-row: auto; }
}

/* Lightbox — fullscreen gallery viewer */
.lightbox {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 200ms ease-out;
}
.lightbox.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img-wrap {
  position: relative;
  max-width: 92vw; max-height: 86vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img {
  max-width: 100%; max-height: 86vh;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: lbZoom 250ms cubic-bezier(.2,.8,.2,1);
}
@keyframes lbZoom {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  color: white;
  border: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  z-index: 2;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.28);
  transform: scale(1.06);
}
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover,
.lightbox-next:hover { transform: translateY(-50%) scale(1.06); }
.lightbox-counter {
  position: absolute;
  top: 24px; left: 50%; transform: translateX(-50%);
  color: white;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  padding: 6px 14px;
  border-radius: var(--r-pill);
}

/* Detail: key-facts card */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.fact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  transition: border-color var(--t-fast);
}
.fact:hover { border-color: var(--coloka-blue-light); }
.fact .fact-label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.fact .fact-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
}

/* ==========================================================================
   APP GATE — mobile interstitial for listing pages
   Full-screen install prompt shown before the listing content on mobile.
   Dominant "Install app" CTA with secondary "Continue in browser" link.
   ========================================================================== */
.app-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background:
    radial-gradient(ellipse at top, rgba(91,155,213,0.4), transparent 60%),
    linear-gradient(180deg, var(--coloka-blue-deep) 0%, var(--coloka-blue) 60%, var(--coloka-blue-dark) 100%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  overflow-y: auto;
  animation: appGateIn 280ms cubic-bezier(.2,.8,.2,1);
}
.app-gate.open { display: flex; }
@keyframes appGateIn { from { opacity: 0; } to { opacity: 1; } }

.app-gate-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  color: white;
  padding: 20px 0;
}

.app-gate-icon {
  width: 92px; height: 92px;
  margin: 0 auto 20px;
  background: white;
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.2);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: iconPulse 2.4s ease-in-out infinite;
}
.app-gate-icon img { width: 100%; height: 100%; object-fit: contain; }
@keyframes iconPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 40px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.2); }
  50%      { transform: scale(1.04); box-shadow: 0 16px 48px rgba(91,155,213,0.5), 0 0 0 2px rgba(255,255,255,0.3); }
}

.app-gate-card h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}
.app-gate-card .gate-sub {
  font-size: 1rem;
  opacity: 0.92;
  margin-bottom: 28px;
  line-height: 1.5;
}

.app-gate-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 24px 0;
  text-align: left;
}
.gate-feature {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}
.gate-feature .gate-emoji { font-size: 1.1rem; }

/* Dominant install CTA */
.app-gate-install {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: white;
  color: var(--coloka-blue);
  font-size: 1.05rem;
  font-weight: 700;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  transition: transform var(--t-fast);
  margin-top: 8px;
}
.app-gate-install:hover { transform: translateY(-2px); text-decoration: none; color: var(--coloka-blue); }
.app-gate-install:active { transform: translateY(0); }

/* Play store subtext */
.app-gate-store {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px;
  font-size: 0.78rem;
  opacity: 0.8;
}
.app-gate-store svg { width: 14px; height: 14px; }

/* Secondary "continue in browser" — visually smaller/less dominant */
.app-gate-continue {
  display: block;
  width: 100%;
  margin-top: 32px;
  padding: 12px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--t-fast);
}
.app-gate-continue:hover { color: white; }

/* Hide the close X on mobile gate since "continue" link is the dismiss */
.app-gate-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  color: white;
  border: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast);
}
.app-gate-close:hover { background: rgba(255,255,255,0.2); }

/* Toast (copy success etc.) */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink-900);
  color: white;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 110;
  opacity: 0;
  transition: opacity var(--t-base), transform var(--t-base);
  pointer-events: none;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error { background: var(--error); }
.toast.success { background: var(--success); }

/* Similar listings section */
.similar-section {
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
}
.similar-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}
.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

/* Detail price card improvements */
.price-card .price-total {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.price-card .charges-line {
  display: flex; justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.price-card .charges-line strong { color: var(--text); font-weight: 600; }

.listing-detail .detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  margin-top: 28px;
}
@media (max-width: 960px) {
  .listing-detail .detail-grid { grid-template-columns: 1fr; gap: 20px; }
}
.detail-body h1 {
  font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 8px;
}
.detail-body .city-line {
  color: var(--text-muted); font-size: 1rem;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 20px;
}
.detail-body .badges-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 20px 0;
}
.detail-body .badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--coloka-blue-light);
  color: var(--coloka-blue-dark);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 0.88rem;
  font-weight: 500;
}
.detail-body .description {
  font-size: 1rem;
  white-space: pre-wrap;
  color: var(--ink-800);
  line-height: 1.7;
}

.detail-sidebar { position: sticky; top: calc(var(--nav-h) + 20px); align-self: start; }
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.price-card .price-big {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.price-card .price-big small {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}
.price-card .owner-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.price-card .owner-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--coloka-blue), var(--coloka-accent));
  color: white; font-weight: 600; font-size: 0.9rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.price-card .owner-avatar img { width: 100%; height: 100%; object-fit: cover; }
.price-card .owner-name { font-weight: 600; font-size: 0.92rem; }
.price-card .owner-sub { font-size: 0.8rem; color: var(--text-muted); }

.app-banner {
  background: linear-gradient(135deg, var(--coloka-blue), var(--coloka-accent));
  color: white;
  padding: 22px;
  border-radius: var(--r-xl);
  margin-top: 16px;
  box-shadow: var(--shadow-brand);
}
.app-banner h3 { color: white; font-size: 1.05rem; margin-bottom: 6px; }
.app-banner p { font-size: 0.88rem; opacity: 0.95; margin-bottom: 14px; }
.app-banner .btn-cta { width: 100%; }

/* ==========================================================================
   AUTH pages (login / register)
   ========================================================================== */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
  background:
    radial-gradient(ellipse at top left, rgba(91,155,213,0.15), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(46,95,172,0.1), transparent 50%),
    var(--surface-2);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.auth-card.wide { max-width: 560px; }
.auth-card h1 {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  font-weight: 700;
  text-align: center;
}
.auth-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink-800);
}
.form-group label .required { color: var(--error); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--coloka-blue);
  box-shadow: 0 0 0 3px rgba(46,95,172,0.15);
}
.form-group input.error,
.form-group select.error { border-color: var(--error); }
.form-group .hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 5px; }
.form-group .field-error { color: var(--error); font-size: 0.8rem; margin-top: 5px; display: none; }
.form-group.has-error .field-error { display: block; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* Password visibility toggle — eye icon */
.password-field { position: relative; }
.password-field input {
  padding-right: 44px;       /* réserve la place du bouton œil */
}
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.password-toggle:hover { color: var(--coloka-blue); background: var(--ink-100); }
.password-toggle:active { transform: translateY(-50%) scale(0.92); }
.password-toggle:focus-visible {
  outline: 2px solid var(--coloka-blue);
  outline-offset: 1px;
}
.password-toggle svg { width: 18px; height: 18px; pointer-events: none; }
/* L'état visible (œil fermé) est affiché seulement quand data-visible="true" */
.password-toggle .eye-open { display: block; }
.password-toggle .eye-closed { display: none; }
.password-toggle[data-visible="true"] .eye-open { display: none; }
.password-toggle[data-visible="true"] .eye-closed { display: block; }

/* Legacy submit-btn kept (used in register/login scripts) */
.submit-btn {
  width: 100%;
  padding: 13px 22px;
  background: var(--coloka-blue);
  color: white;
  border-radius: var(--r-md);
  font-size: 0.98rem;
  font-weight: 600;
  transition: all var(--t-fast);
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(46,95,172,0.2);
}
.submit-btn:hover:not(:disabled) { background: var(--coloka-blue-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(46,95,172,0.3); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Banners */
.banner {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
  border-left-width: 4px;
  border-left-style: solid;
}
.banner.visible { display: block; animation: bannerIn 180ms ease-out; }
@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.banner.banner-error { background: var(--error-bg); border-left-color: var(--error); color: #991B1B; }
.banner.banner-success { background: var(--success-bg); border-left-color: var(--success); color: #166534; }
/* Legacy aliases (register/login use these) */
.form-error-banner { padding: 12px 16px; border-radius: var(--r-md); font-size: 0.9rem; margin-bottom: 16px; display: none; border-left: 4px solid var(--error); background: var(--error-bg); color: #991B1B; }
.form-error-banner.visible { display: block; animation: bannerIn 180ms ease-out; }
.form-success-banner { padding: 12px 16px; border-radius: var(--r-md); font-size: 0.9rem; margin-bottom: 16px; display: none; border-left: 4px solid var(--success); background: var(--success-bg); color: #166534; }
.form-success-banner.visible { display: block; animation: bannerIn 180ms ease-out; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-muted);
}
.auth-footer a { font-weight: 500; }

/* Photo upload */
.photo-upload { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.photo-preview {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--coloka-blue-light);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 2px dashed var(--coloka-blue);
  flex-shrink: 0;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .placeholder-icon { font-size: 1.8rem; color: var(--coloka-blue); }
.photo-preview.has-photo { border-style: solid; }
.photo-upload input[type="file"] { display: none; }
.photo-upload .upload-status { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; }

/* Role selector cards */
.role-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.role-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 10px;
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: center;
  font-size: 0.88rem;
  color: var(--text);
}
.role-card:hover:not(.disabled) { border-color: var(--coloka-blue); transform: translateY(-1px); }
.role-card.selected {
  border-color: var(--coloka-blue);
  background: var(--coloka-blue-light);
  color: var(--coloka-blue-dark);
  font-weight: 600;
}
.role-card.disabled { opacity: 0.5; cursor: not-allowed; }
.role-card .role-icon { font-size: 1.4rem; display: block; margin-bottom: 6px; }
.role-card small { display: block; font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; }

/* ==========================================================================
   PROFILE page
   ========================================================================== */
.profile-page { padding: 48px 0 80px; }
.profile-hero {
  background: linear-gradient(135deg, var(--coloka-blue-deep), var(--coloka-blue));
  color: white;
  padding: 40px;
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-brand);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}
.profile-hero::before {
  content: "";
  position: absolute; top: -40%; right: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(91,155,213,0.35), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.profile-hero .row {
  display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap; position: relative;
}
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.3);
  object-fit: cover;
  flex-shrink: 0;
}
.profile-hero .name { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
.profile-hero .email { opacity: 0.85; font-size: 0.95rem; margin-top: 2px; }
.role-pill {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 10px;
  letter-spacing: 0.02em;
}

.profile-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
}
.profile-panel h3 {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 600;
}
.info-row {
  display: flex;
  justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-muted); }
.info-row .value { color: var(--text); font-weight: 500; }
.info-row .value .dim { color: var(--text-muted); font-weight: 400; font-size: 0.9rem; }

.panel-danger {
  border-color: rgba(220,38,38,0.2);
  background: linear-gradient(180deg, var(--error-bg) 0%, var(--surface) 100%);
}
.panel-danger h3 { color: var(--error); }

/* ==========================================================================
   CONTENT pages (privacy, delete-account)
   ========================================================================== */
.content-page { padding: 48px 0 80px; }
.content-page .container { max-width: 820px; }
.content-page h1 { font-size: clamp(1.8rem, 2vw + 1rem, 2.4rem); letter-spacing: -0.02em; font-weight: 700; margin-bottom: 6px; }
.content-page .subtitle { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 28px; }
.content-page h2 { font-size: 1.3rem; margin: 32px 0 12px; color: var(--coloka-blue-dark); }
.content-page h3 { font-size: 1.05rem; margin: 20px 0 8px; }
.content-page p, .content-page li { margin-bottom: 10px; font-size: 0.96rem; }
.content-page ul, .content-page ol { margin-left: 24px; margin-bottom: 16px; }
.content-page table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 0.92rem; }
.content-page th, .content-page td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.content-page th { background: var(--coloka-blue-mist); font-weight: 600; color: var(--coloka-blue-dark); }
.content-page code { background: var(--ink-100); padding: 2px 6px; border-radius: 4px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.84rem; }

.callout {
  background: var(--coloka-blue-light);
  border-left: 4px solid var(--coloka-blue);
  padding: 16px 20px;
  border-radius: var(--r-md);
  margin: 20px 0;
  font-size: 0.95rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--ink-900);
  color: rgba(255,255,255,0.85);
  padding: 48px 0 28px;
  margin-top: auto;
}
.site-footer .container {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 720px) {
  .site-footer .container { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 440px) {
  .site-footer .container { grid-template-columns: 1fr; }
}
.site-footer .brand {
  color: white; margin-bottom: 12px;
}
.site-footer .brand-icon {
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.site-footer .tagline {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  max-width: 260px;
  line-height: 1.6;
}
.site-footer h4 {
  color: white;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  font-weight: 600;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 9px; }
.site-footer a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: color var(--t-fast);
}
.site-footer a:hover { color: white; text-decoration: none; }
.footer-bottom {
  max-width: var(--container-max);
  margin: 40px auto 0;
  padding: 20px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
}
.footer-socials { display: flex; gap: 10px; }
.footer-socials a {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-fast);
}
.footer-socials a:hover { background: var(--coloka-blue); }

/* Play Store badge */
.play-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: black;
  color: white;
  border-radius: var(--r-md);
  transition: transform var(--t-fast);
}
.play-badge:hover { transform: translateY(-2px); color: white; text-decoration: none; }
.play-badge .play-icon { font-size: 1.2rem; }
.play-badge .play-text { line-height: 1.1; }
.play-badge .play-text small { font-size: 0.65rem; opacity: 0.7; display: block; }
.play-badge .play-text strong { font-size: 0.95rem; font-weight: 600; }

/* ==========================================================================
   STATES (loading / error)
   ========================================================================== */
.state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.state h2 { color: var(--text); font-size: 1.4rem; margin-bottom: 8px; }
.state p { margin-bottom: 20px; }

/* Spinner */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--ink-200);
  border-top-color: var(--coloka-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   MOBILE — header / nav responsiveness
   ========================================================================== */
@media (max-width: 720px) {
  .nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Mobile nav = drawer qui slide depuis le header.
     On utilise display:none (plus fiable que transform pour hiding)
     + animation à l'ouverture. */
  .site-nav {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    z-index: 40;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .site-nav.open {
    display: flex;
    animation: navSlideIn 220ms cubic-bezier(.2,.8,.2,1);
  }
  @keyframes navSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .nav-link { padding: 12px 14px; font-size: 1rem; }
  .nav-link.active::after { display: none; }
  .nav-link.active { background: var(--coloka-blue-light); }
  .nav-divider { width: 100%; height: 1px; margin: 6px 0; }
  .user-chip { justify-content: flex-start; }
  .lang-btn { align-self: flex-start; }
  .filter-bar { top: calc(var(--nav-h)); }
  /* data-auth-nav est un span inline par défaut ; sur mobile il doit devenir colonne */
  [data-auth-nav] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100%;
  }
  [data-auth-nav] .user-chip,
  [data-auth-nav] .nav-link,
  [data-auth-nav] .btn {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
