/* ============================================================================
   SOLERTA PROTOCOL — BASE DESIGN SYSTEM
   Paletă, reset, tipografie, butoane, panouri, stampe, toasts, atmosferă.
============================================================================ */

/* ---------- tokens ---------- */
:root {
  --ink:      #070708;   /* fundal profund */
  --ink-2:    #0d0d10;
  --panel:    #121216;
  --panel-2:  #17171c;
  --line:     rgba(201, 169, 89, 0.16);

  --blood:    #8f1018;   /* roșu sânge închis */
  --red:      #e11d2e;   /* roșu semnal */
  --neon:     #ff2b3a;   /* neon pentru glow */

  --gold:     #c9a959;   /* aur murdar */
  --gold-hi:  #e8cf8a;
  --gold-dim: #8a743a;

  --bone:     #e9e3d2;   /* text principal, os/pergament */
  --ash:      #9b968a;   /* text secundar */
  --smoke:    #5b5851;   /* text terțiar */

  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body:    "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "Courier New", monospace;

  --radius: 10px;
  --shadow-panel: 0 14px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-hi); }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--blood); color: var(--bone); }

/* scrollbar tematic */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #232228; border-radius: 6px; border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ---------- atmosferă globală: grain + vignette + ploaie ---------- */
.rain-canvas {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .75;
}
body::before { /* vignette */
  content: "";
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 38%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}
body::after { /* film grain static */
  content: "";
  position: fixed; inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
}
.page { position: relative; z-index: 3; } /* conținutul peste atmosferă */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rain-canvas { display: none; }
}

/* ---------- tipografie ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; color: var(--bone); margin: 0 0 .5em; line-height: 1.18; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}
.eyebrow::before { content: "✦ "; color: var(--gold-dim); }
.section-title { font-size: clamp(28px, 4vw, 44px); letter-spacing: .04em; }
.section-sub { color: var(--ash); max-width: 640px; margin: 0 0 8px; }
.mono { font-family: var(--font-mono); }
.gold { color: var(--gold); }
.red { color: var(--red); }
.ash { color: var(--ash); }

/* riglă de titlu cu diamant */
.title-rule {
  display: flex; align-items: center; gap: 14px;
  margin: 6px 0 26px;
}
.title-rule::before, .title-rule::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, var(--line));
}
.title-rule::after { background: linear-gradient(90deg, var(--line), transparent); }
.title-rule .diamond { color: var(--gold-dim); font-size: 12px; }

/* ---------- layout ---------- */
.container { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.section { padding: 96px 0; position: relative; }
.section--tight { padding: 64px 0; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- butoane ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px;
  border-radius: 8px;
  border: 1px solid var(--gold-dim);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone);
  background: linear-gradient(180deg, var(--red), var(--blood));
  box-shadow: 0 8px 24px rgba(143, 16, 24, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  text-decoration: none;
  position: relative;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(224, 29, 46, 0.4); color: #fff; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn--ghost {
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  box-shadow: none;
}
.btn--ghost:hover { background: rgba(201, 169, 89, 0.08); box-shadow: 0 8px 24px rgba(0,0,0,.4); color: var(--gold-hi); }
.btn--small { padding: 9px 16px; font-size: 12px; }
.btn--full { width: 100%; }
.btn[disabled], .btn.is-disabled {
  opacity: .45; pointer-events: none; filter: grayscale(.6);
}

/* ---------- panouri ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  padding: 26px;
}
.panel--flat { box-shadow: none; }

/* ---------- stampe ---------- */
.stamp {
  display: inline-block;
  padding: .3em .75em;
  border: 2px solid currentColor;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  transform: rotate(-5deg);
  opacity: .85;
  white-space: nowrap;
}
.stamp--red { color: var(--red); }
.stamp--gold { color: var(--gold); }
.stamp--ash { color: var(--ash); }
.stamp--rotate-r { transform: rotate(4deg); }

/* ---------- badge-uri de rank (simboluri SVG inline) ---------- */
.icon {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 30px; height: 30px; }

/* ---------- toast-uri ---------- */
.toast-host {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(360px, calc(100vw - 44px));
  pointer-events: none;
}
.toast {
  background: linear-gradient(180deg, #1a1a20, #101014);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  color: var(--bone);
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(12px);
  transition: opacity .35s ease, transform .35s ease;
}
.toast.is-in { opacity: 1; transform: none; }
.toast--success { border-left-color: var(--gold); }
.toast--error { border-left-color: var(--red); }
.toast--info { border-left-color: var(--ash); }

/* ---------- easter egg OMERTÀ ---------- */
.omerta-veil {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(4, 4, 5, 0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  pointer-events: none;
  transition: background .5s ease;
}
.omerta-veil.is-on { background: rgba(4, 4, 5, 0.96); }
.omerta-word {
  font-family: var(--font-display);
  font-size: clamp(48px, 12vw, 160px);
  font-weight: 900;
  letter-spacing: .12em;
  color: var(--bone);
  text-shadow: 0 0 40px rgba(224, 29, 46, .8), 3px 0 0 rgba(224, 29, 46, .55), -3px 0 0 rgba(201, 169, 89, .4);
  opacity: 0; transform: scale(.94);
  transition: opacity .5s ease, transform .5s ease;
}
.omerta-veil.is-on .omerta-word { opacity: 1; transform: scale(1); }
.omerta-sub {
  font-family: var(--font-mono);
  color: var(--ash);
  letter-spacing: .3em;
  text-transform: uppercase;
  font-size: 12px;
  opacity: 0; transition: opacity .8s ease .2s;
}
.omerta-veil.is-on .omerta-sub { opacity: 1; }

/* ---------- formular (dashboard) ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: #0c0c0f;
  border: 1px solid #26262c;
  border-radius: 8px;
  color: var(--bone);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(201, 169, 89, .1);
}
.field textarea { resize: vertical; min-height: 90px; }

/* ---------- tabel generic ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ash);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }

/* ---------- bară de progres ---------- */
.progress {
  height: 8px;
  background: #0c0c0f;
  border: 1px solid #26262c;
  border-radius: 99px;
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blood), var(--red));
  border-radius: 99px;
  transition: width .8s ease;
}
.progress__fill--gold { background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }

/* ---------- tag-uri / chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--ash);
  background: rgba(255, 255, 255, 0.02);
}
.chip--gold { color: var(--gold); border-color: rgba(201, 169, 89, .4); }
.chip--red { color: var(--red); border-color: rgba(224, 29, 46, .4); }

/* ---------- utility ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-2 { margin-bottom: 16px; }
.grid { display: grid; gap: 22px; }
.hidden { display: none !important; }
