:root {
  --bg: #0f0b10;
  --panel: #1a141c;
  --panel-2: #241b27;
  --line: #352a38;
  --text: #f3ece9;
  --muted: #a8979f;
  --accent: #c9405a;
  --accent-2: #e7a24a;
  --ok: #4fbf8a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(ellipse at top, #2a1520 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
h1, h2, h3 { font-family: 'Cormorant Garamond', serif; font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: 2.4rem; } h2 { font-size: 1.8rem; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.logo { font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.logo span { color: var(--accent); font-style: italic; }
.logo.big { font-size: 3rem; margin-bottom: 12px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: rgba(15, 11, 16, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); background: var(--panel-2); }
.badge { background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 12px; margin-left: 4px; }

main { max-width: 1100px; margin: 0 auto; padding: 28px 16px 60px; }
.foot { text-align: center; color: var(--muted); padding: 20px; font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 10px 18px; border-radius: 99px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #9c2c4a); border: none; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { color: #ff8a9b; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.narrow { max-width: 480px; margin: 20px auto; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; }
.check input { width: auto; margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: 13px; user-select: none; }
.chip.on { background: var(--accent); border-color: var(--accent); }
.tag { display: inline-block; padding: 4px 10px; border-radius: 99px; background: var(--panel-2); font-size: 13px; margin: 0 6px 6px 0; }
.err { color: #ff8a9b; margin-top: 12px; min-height: 1em; }

/* Landing */
.hero { text-align: center; padding: 40px 0 20px; }
.hero h1 { font-size: 3.2rem; line-height: 1.1; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 24px; font-size: 17px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 40px; }
.features .card h3 { font-size: 1.4rem; }

/* Grille de profils */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 20px; align-items: end; }
.filters label { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.pcard { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: transform .15s; }
.pcard:hover { transform: translateY(-3px); }
.pcard .ph { aspect-ratio: 3/4; background: var(--panel-2) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 48px; color: var(--line); }
.pcard .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 12px 12px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.pcard .name { font-weight: 600; font-size: 16px; }
.pcard .sub { font-size: 13px; color: #ddd; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-left: 6px; }
.empty { text-align: center; color: var(--muted); padding: 50px 0; }

/* Profil */
.profile { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .profile { grid-template-columns: 1fr; } .hero h1 { font-size: 2.3rem; } }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery .main { grid-column: span 3; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.gallery .main img { aspect-ratio: 4/5; }
.locked { aspect-ratio: 1; border-radius: 10px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; color: var(--muted); padding: 8px; }

/* Mes photos */
.myphotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.myphoto { background: var(--panel-2); border-radius: 10px; overflow: hidden; }
.myphoto img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.myphoto .ctl { padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }

/* Messagerie */
.convs { display: flex; flex-direction: column; gap: 8px; }
.conv { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.conv:hover { border-color: var(--muted); }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--panel-2) center/cover; flex-shrink: 0; }
.conv .last { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .grow { flex: 1; min-width: 0; }
.chat { display: flex; flex-direction: column; height: calc(100vh - 200px); min-height: 400px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 75%; padding: 9px 14px; border-radius: 18px; background: var(--panel-2); word-wrap: break-word; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: var(--accent); }
.msg time { display: block; font-size: 11px; opacity: .6; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.typing { font-size: 12px; color: var(--muted); height: 16px; }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat b { display: block; font-size: 28px; font-family: 'Cormorant Garamond', serif; }

/* Divers */
.agegate { position: fixed; inset: 0; z-index: 100; background: rgba(8, 5, 9, .97); display: flex; align-items: center; justify-content: center; padding: 20px; }
.agegate-box { max-width: 480px; text-align: center; }
.agegate-box p { color: var(--muted); margin-bottom: 24px; }
.agegate-box .row { justify-content: center; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: 12px 20px; border-radius: 99px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 60; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 8px; }
.legal { max-width: 760px; margin: 0 auto; }
.legal h2 { margin-top: 1.2em; }

/* Champs mot de passe */
.pw { position: relative; }
.pw input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; display: flex; border-radius: 8px; }
.pw-eye:hover { color: var(--text); }
.pw-rules { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.pw-rules li::before { content: '○ '; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: '✓ '; }
.pw-match { font-size: 12px; margin-top: 6px; min-height: 1em; }
.pw-match.ok { color: var(--ok); }
.pw-match.bad { color: #ff8a9b; }
