/* e-ingenium — Design System
   Paleta și proporțiile sunt valorile DEFAULT (fallback dacă Supabase
   nu a răspuns încă / e offline). Valorile reale sunt citite din
   settings.config.colors la runtime de color-harmony.js și suprascriu
   aceste custom properties pe :root — vezi CLAUDE.md regula 38-39. */

:root {
  --vio:        #5049df;
  --vio-l:      #9692e8;
  --vio-d:      #201a9e;
  --vio-pale:   #ebebf5;
  --vio-mid:    #dad9f2;
  --bg:         #f5f5f9;
  --card:       #ffffff;
  --border:     #e4e3ed;
  --border2:    #cdcce1;
  --text:       #141325;
  --text2:      #3e3d57;
  --muted:      #7a7891;
  --cream:      #bda375;
  --coral:      #e0895c;
  --coral-pale: #f9f0eb;
  --grad:       linear-gradient(135deg, var(--vio-l), var(--vio-d));
  --shadow:     0 2px 12px rgba(80,73,223,0.08);
  --shadow-h:   0 8px 28px rgba(80,73,223,0.16);
  --r-card:     16px;
  --r-btn:      12px;
  --r-badge:    8px;
  --r-pill:     999px;
  --phi:        1.618;

  /* spațieri derivate din φ, bază 8px */
  --sp-1: 8px;
  --sp-2: 13px;   /* 8 * φ  */
  --sp-3: 21px;   /* 13 * φ */
  --sp-4: 34px;   /* 21 * φ */
  --sp-5: 55px;   /* 34 * φ */
  --sp-6: 89px;   /* 55 * φ */
}

/* ── Reset minimal ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { max-width: 100%; display: block; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--vio); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 var(--sp-2) 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
p  { margin: 0 0 var(--sp-2) 0; color: var(--text2); }

.label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ── Layout ────────────────────────────────────────────────────── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-3);
}

.container-wide {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-3);
}

/* ── Card ──────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: var(--sp-4);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--r-btn);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover:not(:disabled) { box-shadow: var(--shadow-h); transform: translateY(-1px); }

.btn-secondary {
  background: var(--vio-pale);
  color: var(--vio-d);
}
.btn-secondary:hover:not(:disabled) { background: var(--vio-mid); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}

.btn-block { width: 100%; }

/* ── Forms ─────────────────────────────────────────────────────── */
.field { margin-bottom: var(--sp-3); }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--r-btn);
  font-family: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--vio);
  box-shadow: 0 0 0 3px var(--vio-pale);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: var(--sp-2); }
.checkbox-row input { margin-top: 3px; }
.checkbox-row label { font-size: 13px; color: var(--text2); }

/* ── Badge / Pill ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--r-badge);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--vio-pale);
  color: var(--vio-d);
}
.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border2);
  background: #fff;
  cursor: pointer;
}
.pill.active { background: var(--vio); color: #fff; border-color: var(--vio); }

/* ── Progress bar (test) ───────────────────────────────────────── */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--vio-pale);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--grad);
  border-radius: var(--r-pill);
  transition: width 0.3s ease;
}

/* ── Header / Nav ──────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.logo { font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: -0.02em; }
.logo span { color: var(--vio); }

.lang-select {
  padding: 8px 10px;
  border-radius: var(--r-badge);
  border: 1px solid var(--border2);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* ── Dimension bar (rezultate) — bidirecțională (+ dreapta / − stânga),
   cu scală -100..+100 și descriptori comportamentali (ambele extreme),
   în oglindă cu graficul diverging din raportul PDF (pdf-builder.js) —
   cerere Sorin 27.08.2026: numele complet (nu doar codul de 3 litere),
   scală vizibilă, și ce reprezintă fiecare extremă. ── */
.dim-scale {
  display: flex;
  justify-content: space-between;
  padding: 0 1px;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.dim-row { margin-bottom: 24px; }
.dim-row:last-child { margin-bottom: 0; }

.dim-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 4px;
}
.dim-row-top .dim-name { font-weight: 800; font-size: 13.5px; color: var(--vio-d); }
.dim-row-top .dim-name .dim-code { color: var(--muted); font-weight: 700; font-size: 12px; }
.dim-row-top .dim-val { font-size: 13.5px; font-weight: 800; color: var(--text2); flex-shrink: 0; }

.dim-indicator { font-size: 11.5px; color: var(--muted); margin: 4px 0; line-height: 1.4; }
/* Săgeata + textul indicatorului pozitiv aliniate la dreapta — în oglindă
   cu bara pozitivă, care crește tot spre dreapta de la linia de zero
   (.dim-fill.positive, left:50%) — cerere Sorin 27.08.2026. Negativul
   rămâne aliniat la stânga, spre partea unde crește bara sa. */
.dim-indicator.positive { text-align: right; }
.dim-indicator.positive::before { content: "▲ "; color: var(--vio); }
.dim-indicator.negative::before { content: "▼ "; color: var(--cream); }

.dim-track {
  height: 10px;
  background: var(--vio-pale);
  border-radius: var(--r-pill);
  position: relative;
}
.dim-track::before {
  /* linia de zero, la mijlocul track-ului */
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: var(--border2);
}
.dim-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 5px;
}
.dim-fill.positive { background: var(--grad); }
.dim-fill.negative { background: var(--cream); }

/* ── Blurred / locked premium content ─────────────────────────── */
.locked {
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
}
.locked .locked-content { filter: blur(6px); pointer-events: none; user-select: none; }
.locked .locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: rgba(255,255,255,0.55);
  text-align: center;
  padding: var(--sp-3);
}

/* ── Maintenance page ──────────────────────────────────────────── */
.maintenance-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad);
  color: #fff;
  text-align: center;
  padding: var(--sp-4);
}
.maintenance-screen .card {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  color: #fff;
  max-width: 480px;
}
.maintenance-screen p { color: rgba(255,255,255,0.85); }

/* ── Utility ───────────────────────────────────────────────────── */
.text-center { text-align: center; }
.muted { color: var(--muted); }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.hidden { display: none !important; }

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--vio-pale);
  border-top-color: var(--vio);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer public (29.08.2026) — link-uri catre paginile legale,
   altfel neatinse din nicio pagina publica ── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--sp-5);
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.site-footer-inner nav { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.site-footer-inner a { color: var(--muted); text-decoration: none; }
.site-footer-inner a:hover { color: var(--vio-d); text-decoration: underline; }
