/* Daidau — stiluri după kitul Libellula (../libelula/luminous_agency/DESIGN.md):
   canvas bleumarin închis, accent lavandă, CTA galben în formă de pastilă, Inter. */
:root {
  --canvas: #0B1B2B;
  --surface: #112338;
  --surface-2: #172E49;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #FFFFFF;
  --text-soft: #d4e4fa;
  --text-dim: rgba(255, 255, 255, 0.6);
  --lavender: #8C76C4;
  --lavender-soft: #d0bcff;
  --yellow: #FCE941;
  --error: #ffb4ab;
  --ok: #7be0a3;
  --radius: 8px;
  --radius-lg: 16px;
  --pill: 9999px;
  --glow: 0 8px 32px -8px rgba(140, 118, 196, 0.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--text-soft);
  font: 400 16px/1.5 Inter, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
a { color: var(--lavender-soft); text-decoration: none; }
a:hover { color: var(--text); }
img { max-width: 100%; display: block; }
h1, h2, h3 { color: var(--text); margin: 0 0 12px; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 12px; }
small, .dim { color: var(--text-dim); font-size: 14px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 64px; }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 200px; min-width: 0; }

/* navigație */
.nav { border-bottom: 1px solid var(--line); background: rgba(11, 27, 43, 0.9); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.nav .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-weight: 800; font-size: 22px; color: var(--text); letter-spacing: -0.03em; }
.brand span { color: var(--yellow); }
.nav-links { display: flex; gap: 4px 16px; align-items: center; flex-wrap: wrap; margin-left: auto; font-size: 14px; font-weight: 600; }
.nav-links a { color: var(--text-soft); }
.nav-links a:hover { color: var(--lavender-soft); }
.badge-count { background: var(--yellow); color: var(--canvas); border-radius: var(--pill); padding: 0 7px; font-size: 12px; font-weight: 700; margin-left: 4px; }

/* butoane */
.btn, button, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font: 600 15px/1.2 inherit; padding: 11px 18px; border-radius: var(--radius);
  background: transparent; color: var(--text); border: 1px solid var(--line-strong);
  transition: transform .12s, border-color .12s, background .12s, color .12s;
}
.btn:hover, button:hover, input[type=submit]:hover { border-color: var(--lavender); color: var(--lavender-soft); background: rgba(140, 118, 196, 0.08); }
.btn-primary, button.btn-primary, button[type=submit].primary {
  background: var(--yellow); color: var(--canvas); border-color: var(--yellow); border-radius: var(--pill);
  font-weight: 700; padding: 12px 28px;
}
.btn-primary:hover, button.btn-primary:hover { background: var(--yellow); color: var(--canvas); border-color: var(--yellow); transform: scale(1.02); box-shadow: 0 8px 24px -4px rgba(252, 233, 65, 0.25); }
.btn-accent, button.btn-accent { background: var(--lavender); border-color: var(--lavender); color: #fff; }
.btn-accent:hover, button.btn-accent:hover { filter: brightness(1.1); color: #fff; background: var(--lavender); }
.btn-danger, button.btn-danger { border-color: rgba(255, 180, 171, 0.5); color: var(--error); }
.btn-small { padding: 7px 12px; font-size: 13px; }
.linklike { background: none; border: none; padding: 0; color: var(--lavender-soft); font: inherit; font-weight: 600; cursor: pointer; }
.linklike:hover { background: none; color: var(--text); }

/* formulare */
label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=time],
input[type=tel], input[type=url], select, textarea {
  width: 100%; background: rgba(11, 27, 43, 0.6); border: 1px solid rgba(255, 255, 255, 0.15); color: var(--text);
  border-radius: var(--radius); padding: 11px 14px; font: inherit;
}
input::placeholder, textarea::placeholder { color: rgba(255, 255, 255, 0.4); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(140, 118, 196, 0.2); }
select option { background: var(--surface); }
input[type=checkbox], input[type=radio] { accent-color: var(--yellow); width: 18px; height: 18px; }
input[type=file] { color: var(--text-dim); font-size: 14px; max-width: 100%; }
.field { margin-bottom: 14px; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text-soft); }
.helptext, .field small { display: block; margin-top: 4px; color: var(--text-dim); font-size: 13px; }
ul.errorlist, .errors { list-style: none; margin: 0 0 12px; padding: 12px 14px; border-radius: var(--radius); background: rgba(147, 0, 10, 0.25); border: 1px solid rgba(255, 180, 171, 0.35); color: var(--error); font-size: 14px; }
.errors li + li { margin-top: 4px; }

/* carduri */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.card.pad-lg { padding: 28px; }
.card.highlight { border-color: rgba(140, 118, 196, 0.5); box-shadow: var(--glow); }
.notice { background: rgba(140, 118, 196, 0.12); border: 1px solid rgba(140, 118, 196, 0.35); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; }
.notice.warn { background: rgba(252, 233, 65, 0.08); border-color: rgba(252, 233, 65, 0.35); color: #f3e9a0; }
.flash { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 12px; font-size: 14px; background: rgba(123, 224, 163, 0.1); border: 1px solid rgba(123, 224, 163, 0.35); color: var(--ok); }
.flash.error { background: rgba(147, 0, 10, 0.25); border-color: rgba(255, 180, 171, 0.35); color: var(--error); }

.chip { display: inline-block; border-radius: var(--pill); padding: 3px 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: rgba(140, 118, 196, 0.15); color: var(--lavender-soft); }
.chip.yellow { background: var(--yellow); color: var(--canvas); }
.chip.muted { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }

/* hero + filtre */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: 40px; }
.hero h1 em { font-style: normal; color: var(--lavender); }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 16px 0 24px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr auto; } .hero h1 { font-size: 56px; } }

/* grila de anunțuri */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.offer-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; color: var(--text-soft); transition: transform .15s, border-color .15s; }
.offer-card:hover { transform: translateY(-4px); border-color: rgba(140, 118, 196, 0.4); color: var(--text-soft); }
.thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 13px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.offer-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.gives { color: var(--text); font-weight: 600; }
.wants { font-size: 14px; }
.wants b { color: var(--yellow); font-weight: 600; }
.value { color: var(--lavender-soft); font-weight: 600; font-size: 14px; }

/* detaliu anunț */
.gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.gallery img { border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; width: 100%; }
.option { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.option + .or { text-align: center; color: var(--text-dim); font-size: 13px; font-weight: 700; letter-spacing: .08em; margin: 10px 0; }
.item + .item { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.two-col { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: 3fr 2fr; align-items: start; } }

/* editor */
.item-row { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; background: rgba(11, 27, 43, 0.35); }
.item-row.changed { border-color: rgba(252, 233, 65, 0.5); }
.want-row { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .want-row { grid-template-columns: 2fr 1fr; } }

/* tabele simple / liste */
.list > * { border-top: 1px solid var(--line); padding: 14px 0; }
.list > *:first-child { border-top: none; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--text-dim); }
dl.kv dd { margin: 0; color: var(--text); }

/* chat */
.bubbles { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: rgba(140, 118, 196, 0.3); color: var(--text); }
.bubble img { border-radius: 8px; margin-bottom: 6px; max-height: 280px; }
.bubble time { display: block; font-size: 11px; color: var(--text-dim); margin-top: 4px; }

footer.site { border-top: 1px solid var(--line); padding: 24px 0; color: var(--text-dim); font-size: 13px; }
table { border-collapse: collapse; }

/* butoanele din meniu își păstrează culoarea de text, nu pe cea a linkurilor */
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: var(--canvas); }

/* paginile de autentificare (django-allauth) */
.auth button[type=submit] { background: var(--yellow); color: var(--canvas); border-color: var(--yellow); border-radius: var(--pill); font-weight: 700; padding: 12px 28px; }
.auth form p { margin-bottom: 14px; }
.auth hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.auth ul:not(.errorlist) { list-style: none; padding: 0; margin: 0; }
.auth ul:not(.errorlist) a { display: block; text-align: center; padding: 11px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); font-weight: 600; }
.auth ul:not(.errorlist) a:hover { border-color: var(--lavender); color: var(--lavender-soft); background: rgba(140, 118, 196, 0.08); }
.auth .provider-btn { display: flex; width: 100%; color: var(--text); }
video.clip { display: block; width: 100%; max-height: 420px; margin-top: 10px; border-radius: var(--radius); background: #000; }

/* miniaturile de pe pagina anunțului */
.gallery .media { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; background: var(--surface-2); cursor: zoom-in; }
.gallery .media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform .2s; }
.gallery .media:hover img { transform: scale(1.04); }
.gallery .media:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.gallery .media.video { cursor: pointer; }
.gallery .media .play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%; background: rgba(11, 27, 43, 0.75); border: 2px solid #fff; }
.gallery .media .play::after { content: ''; position: absolute; left: 20px; top: 14px; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #fff; }

/* galeria deschisă peste pagină */
body.lightbox-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: auto 1fr auto; background: rgba(4, 12, 22, 0.94); backdrop-filter: blur(6px); }
.lightbox[hidden] { display: none; }
.lightbox-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #fff; }
.lightbox-caption { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-counter { color: var(--text-dim); font-size: 14px; font-variant-numeric: tabular-nums; }
.lightbox-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 56px; }
.lightbox-stage img, .lightbox-stage video { max-width: 100%; max-height: 100%; border-radius: var(--radius); object-fit: contain; box-shadow: 0 16px 60px rgba(0, 0, 0, 0.6); background: #000; }
.lightbox button { border-radius: 50%; width: 44px; height: 44px; padding: 0; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-strong); color: #fff; font-size: 22px; line-height: 1; }
.lightbox button:hover { background: rgba(140, 118, 196, 0.35); border-color: var(--lavender); color: #fff; }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-strip { display: flex; gap: 8px; padding: 12px 16px 16px; overflow-x: auto; justify-content: safe center; }
.lightbox .lightbox-thumb { flex: 0 0 auto; width: 64px; height: 64px; border-radius: var(--radius); background: var(--surface-2) center / cover no-repeat; opacity: 0.55; position: relative; }
.lightbox .lightbox-thumb.is-current { opacity: 1; border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow); }
.lightbox .lightbox-thumb.is-video::after { content: ''; position: absolute; left: 26px; top: 22px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff; filter: drop-shadow(0 0 3px #000); }
.lightbox.is-single .lightbox-prev, .lightbox.is-single .lightbox-next, .lightbox.is-single .lightbox-strip { display: none; }
@media (max-width: 640px) {
  /* pe telefon săgețile stau peste marginile pozei; se poate și glisa */
  .lightbox-stage { padding: 0 8px; }
  .lightbox .lightbox-prev, .lightbox .lightbox-next { width: 38px; height: 38px; background: rgba(11, 27, 43, 0.7); }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
}

/* obiectele existente, de refolosit într-un anunț */
.spare-list > summary { display: inline-block; cursor: pointer; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); font-weight: 600; font-size: 14px; list-style: none; }
.spare-list > summary::-webkit-details-marker { display: none; }
.spare-list > summary:hover, .spare-list[open] > summary { border-color: var(--lavender); color: var(--lavender-soft); }
.item-row.spare { padding: 12px 16px; }
.item-row.spare.offered { border-color: var(--yellow); background: rgba(252, 233, 65, 0.06); }
