/* ════════════════════════════════════════════════════════════
   diaspora.ro — Global Design System v4-SAFE
   Tokens + utilitare identice cu homepage-ul.
   Folosim :where() = specificitate ZERO → paginile cu propriul
   CSS (hub, intra, cont, melissa, anima…) NU vor fi afectate.
   ════════════════════════════════════════════════════════════ */

/* ── TOKEN VARS (overridable de orice pagina) ─────────────── */
:root {
  --bg:        #f8fafc;
  --bg-2:      #eef2f7;
  --ink:       #0b1220;
  --muted:     #5b6878;
  --line:      #e2e8f0;
  --card:      #ffffff;
  --card-line: #e6ebf2;
  --brand:     #1a56db;
  --brand-2:   #1e40af;
  --accent:    #ea580c;
  --success:   #16a34a;
  --danger:    #dc2626;
  --warn:      #d97706;
  --shadow:    0 1px 2px rgba(15,23,42,.06),0 4px 14px rgba(15,23,42,.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,.08),0 1px 4px rgba(15,23,42,.05);
  --radius:    14px;
  --font:      system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}

/* ── BASE (specificitate 0 via :where) ───────────────────── */
:where(*, *::before, *::after) { box-sizing: border-box; }
:where(html, body) {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
:where(a) { color: var(--brand); text-decoration: none; }
:where(a:hover) { text-decoration: underline; }
:where(img, svg) { max-width: 100%; display: block; }
:where(h1,h2,h3,h4,h5,h6) {
  margin: 0 0 .5em; font-weight: 800;
  letter-spacing: -.02em; line-height: 1.2; color: var(--ink);
}
:where(h1) { font-size: clamp(24px,4vw,40px); }
:where(h2) { font-size: clamp(20px,3vw,30px); }
:where(h3) { font-size: clamp(16px,2vw,22px); }
:where(p)  { margin: 0 0 1em; }

/* ── BUTTON UTILITIES ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 18px; border-radius: 9px;
  font-weight: 700; font-size: 14px; font-family: var(--font);
  border: 1px solid transparent; cursor: pointer;
  transition: all .15s; text-decoration: none;
  white-space: nowrap; line-height: 1.3;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-success { background: var(--success); color: #fff; }
.btn-sm  { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn-lg  { padding: 13px 24px; font-size: 15px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ── CARD ────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-hover { transition: transform .2s, box-shadow .2s, border-color .2s; }
.card-hover:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md);
  border-color: rgba(26,86,219,.3);
}

/* ── HEADER ──────────────────────────────────────────────── */
.dg-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(15,23,42,.05);
}
.dg-header-in {
  max-width: 1200px; margin: 0 auto;
  padding: 12px 18px; display: flex; align-items: center; gap: 12px;
}
.dg-logo { font-size: 20px; font-weight: 900; color: var(--brand); text-decoration: none; letter-spacing: -.03em; flex-shrink: 0; }
.dg-logo:hover { color: var(--brand-2); text-decoration: none; }
.dg-logo .dot { color: var(--accent); }
.dg-breadcrumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dg-breadcrumb::before { content: "/"; }

/* ── FORM utilities (only inside .dg-form) ───────────────── */
:where(.dg-form) input,
:where(.dg-form) textarea,
:where(.dg-form) select {
  font-family: var(--font); font-size: 14px;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 13px; outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
:where(.dg-form) input:focus,
:where(.dg-form) textarea:focus,
:where(.dg-form) select:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
:where(.dg-form) label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--muted); margin-bottom: 5px;
}
:where(.dg-form) textarea { resize: vertical; min-height: 80px; }

/* ── BADGE ───────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-orange { background: #fed7aa; color: #9a3412; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: var(--bg-2); color: var(--muted); }

/* ── SECTION ─────────────────────────────────────────────── */
.dg-section { padding: 36px 18px; }
.dg-section-in { max-width: 1200px; margin: 0 auto; }
.dg-section-h { text-align: center; margin-bottom: 28px; }
.dg-section-h h2 { margin-bottom: 6px; }
.dg-section-h p { color: var(--muted); font-size: 15px; margin: 0; }

/* ── GRIDS ───────────────────────────────────────────────── */
.dg-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.dg-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
@media (max-width: 768px) { .dg-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .dg-grid-3,.dg-grid-2 { grid-template-columns: 1fr; } }

/* ── TOGGLE ──────────────────────────────────────────────── */
.dg-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; background: var(--line); border: none; border-radius: 12px; cursor: pointer; transition: background .2s; padding: 0; }
.dg-toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.dg-toggle.on { background: var(--brand); }
.dg-toggle.on::after { transform: translateX(20px); }

/* ── DIVIDER ─────────────────────────────────────────────── */
.dg-divider { border: none; border-top: 1px solid var(--line); margin: 20px 0; }

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }
