/* ═══════════════════════════════════════════════════════════════════
   PLATFORMA DE SEMNARE — PÎCE · ONDRL
   Culori din identitatea EQIP (bleumarin + cele patru bare) și ONDRL.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --navy:        #26357f;
  --navy-deep:   #1b2766;
  --blue:        #1259aa;
  --eq-yellow:   #f6b40e;
  --eq-blue:     #1f4f9d;
  --eq-green:    #179a62;
  --eq-orange:   #ef6b22;
  --eq-red:      #d42a1f;

  --bg:          #f4f5fa;
  --surface:     #ffffff;
  --surface-2:   #f7f8fc;
  --border:      #e1e4ef;
  --text:        #1c2240;
  --muted:       #646b86;
  --faint:       #9ea3b8;

  --primary:       var(--navy);
  --primary-hover: var(--navy-deep);
  --primary-soft:  #e9ecf8;
  --on-primary:    #ffffff;
  --link:          var(--blue);

  --ok:        #17804f;  --ok-soft:    #e5f5ec;
  --warn:      #a24b0d;  --warn-soft:  #fdf0e4;
  --active:    #c25a00;  --active-soft:#fff2e2;
  --danger:    #b3261e;  --danger-soft:#fdeceb;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 28, 70, .06);
  --shadow:    0 6px 22px rgba(20, 28, 70, .08), 0 1px 3px rgba(20, 28, 70, .06);
  --shadow-lg: 0 18px 50px rgba(20, 28, 70, .18);
  --ease:      cubic-bezier(.16, 1, .3, 1);
  --font:      "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:      ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:          #0e1122;
  --surface:     #161a31;
  --surface-2:   #1c2140;
  --border:      #2a3156;
  --text:        #e7e9f4;
  --muted:       #a0a6c2;
  --faint:       #6c7395;
  --primary:       #4c63d2;
  --primary-hover: #5f75e0;
  --primary-soft:  #232a52;
  --link:          #8fb3ff;
  --ok:        #4fc48a;  --ok-soft:    #15302a;
  --warn:      #f0a368;  --warn-soft:  #34241a;
  --active:    #ffb25e;  --active-soft:#35271a;
  --danger:    #ff8a80;  --danger-soft:#3a1d22;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow:    0 6px 22px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ── BAZĂ ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
p > svg, .small > svg { display: inline; width: 14px; height: 14px; vertical-align: -2px; }

/* ── ANTET CU LOGO-URI (mereu alb, ca pe panourile oficiale) ─────── */
.brand {
  background: #fff;
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--eq-yellow) 0 25%, var(--eq-blue) 25% 50%, var(--eq-green) 50% 75%, var(--eq-orange) 75% 100%) 1;
}
.logos {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 28px;
}
.logos img { height: 40px; width: auto; }

/* ── BARA APLICAȚIEI ──────────────────────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px max(24px, calc((100vw - 1280px) / 2 + 24px));
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 12px rgba(10, 16, 50, .25);
}
.appbar-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.appbar-title { display: block; font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.appbar-sub { display: block; font-size: 12px; opacity: .75; letter-spacing: .08em; }
.appbar-right { display: flex; align-items: center; gap: 8px; }

.bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 26px; }
.bars i { display: block; width: 5px; border-radius: 2px; }
.bars i:nth-child(1) { height: 70%; background: var(--eq-yellow); transform: rotate(-4deg); }
.bars i:nth-child(2) { height: 88%; background: #5d86e8; }
.bars i:nth-child(3) { height: 78%; background: #2bc480; }
.bars i:nth-child(4) { height: 100%; background: var(--eq-orange); }
.appbar-brand:hover .bars i { animation: bar-bounce .9s var(--ease); }
.appbar-brand:hover .bars i:nth-child(2) { animation-delay: .06s; }
.appbar-brand:hover .bars i:nth-child(3) { animation-delay: .12s; }
.appbar-brand:hover .bars i:nth-child(4) { animation-delay: .18s; }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border: 0; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff;
  transition: background .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .2); }
.icon-btn svg { width: 18px; height: 18px; }

.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 3px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; background: var(--eq-yellow); color: var(--navy-deep);
}
.user-mail { font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .icon-btn { width: 30px; height: 30px; background: transparent; }

/* ── PAGINĂ ───────────────────────────────────────────────────────── */
.page { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 18px 24px 36px; display: flex; flex-direction: column; gap: 14px; }
.foot { text-align: center; font-size: 12px; color: var(--faint); padding: 18px 20px 26px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.enter { animation: enter .45s var(--ease) both; }
.enter:nth-child(2) { animation-delay: .05s; }
.enter:nth-child(3) { animation-delay: .1s; }
.enter:nth-child(4) { animation-delay: .15s; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: clamp(20px, 3.2vw, 26px); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.back:hover { color: var(--text); }
.back svg { width: 14px; height: 14px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ── BUTOANE ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px;
  border: 1px solid transparent; border-radius: 11px;
  font-weight: 600; font-size: 14px; text-decoration: none;
  background: var(--primary); color: var(--on-primary);
  transition: transform .18s var(--ease), box-shadow .18s, background .18s, opacity .18s;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.lg { min-height: 50px; font-size: 15px; padding: 12px 22px; }
.btn.orange { background: var(--eq-orange); }
.btn.orange:hover:not(:disabled) { background: #d85b14; }
.btn.green { background: var(--eq-green); }
.btn.green:hover:not(:disabled) { background: #11834f; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft); box-shadow: none; }
.btn.danger-solid { background: var(--danger); color: #fff; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.done { background: var(--ok) !important; color: #fff !important; border-color: transparent !important; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* ── LOADER EQIP (cele patru bare) ───────────────────────────────── */
.loader-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 56px 20px; color: var(--muted); }
.eq-loader { display: flex; align-items: flex-end; gap: 7px; height: 54px; }
.eq-loader span { width: 13px; height: 100%; border-radius: 4px; transform-origin: bottom; animation: bar-load 1.1s ease-in-out infinite; }
.eq-loader span:nth-child(1) { background: linear-gradient(var(--eq-yellow), #ef8b0b); animation-delay: 0s; }
.eq-loader span:nth-child(2) { background: linear-gradient(#2357a8, #23285a); animation-delay: .12s; }
.eq-loader span:nth-child(3) { background: linear-gradient(#1aa067, #0c4a2c); animation-delay: .24s; }
.eq-loader span:nth-child(4) { background: linear-gradient(var(--eq-orange), var(--eq-red)); animation-delay: .36s; }
.loader-text { font-size: 14px; animation: pulse-text 1.6s ease-in-out infinite; }

.overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(4px);
  animation: fade .2s ease both;
}
.overlay .loader-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 34px 44px; }

.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk-row { height: 66px; margin-bottom: 10px; }

/* ── ALERTE, ETICHETE ─────────────────────────────────────────────── */
.alert { display: flex; gap: 12px; padding: 13px 15px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.alert b { display: block; margin-bottom: 2px; }
.alert .alert-body { flex: 1; min-width: 0; }
.alert.info    { background: var(--primary-soft); color: color-mix(in srgb, var(--primary) 70%, var(--text)); }
.alert.ok      { background: var(--ok-soft);      color: color-mix(in srgb, var(--ok) 75%, var(--text)); }
.alert.warn    { background: var(--warn-soft);    color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.alert.active  { background: var(--active-soft);  color: color-mix(in srgb, var(--active) 80%, var(--text)); }
.alert.danger  { background: var(--danger-soft);  color: color-mix(in srgb, var(--danger) 80%, var(--text)); }
:root[data-theme="dark"] .alert.info { color: #c9d3ff; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok     { background: var(--ok-soft); color: var(--ok); }
.badge.active { background: var(--active-soft); color: var(--active); }
.badge.wait   { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.active .dot { animation: ping 1.4s ease-out infinite; }

/* ── PROGRES ──────────────────────────────────────────────────────── */
.progress { display: flex; flex-direction: column; gap: 7px; }
.progress-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.progress-top b { color: var(--text); font-family: var(--mono); font-size: 13px; }
.track { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--eq-yellow), var(--eq-blue) 40%, var(--eq-green) 70%, var(--eq-orange));
  background-size: 200% 100%;
  transition: width 1s var(--ease);
  animation: flow 3s linear infinite;
}
.fill.full { background: var(--ok); animation: none; }

/* ── PANOU (dashboard) ────────────────────────────────────────────── */
.hello h1 { font-size: clamp(21px, 3.4vw, 28px); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.s1 { border-top: 3px solid var(--eq-orange); }
.stat.s2 { border-top: 3px solid var(--eq-green); }
.stat.s3 { border-top: 3px solid var(--eq-blue); }

.new-doc {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 18px 20px; border-radius: var(--radius);
  border: 2px dashed color-mix(in srgb, var(--primary) 40%, var(--border));
  background: var(--primary-soft); color: var(--text); text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.new-doc:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }
.new-doc .plus { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--primary); color: #fff; flex-shrink: 0; transition: transform .3s var(--ease); }
.new-doc:hover .plus { transform: rotate(90deg); }
.new-doc .plus svg { width: 22px; height: 22px; }
.new-doc b { display: block; font-size: 16px; }

.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tabs { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.tab { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.search { flex: 1; min-width: 160px; max-width: 280px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }

.doc-list { display: flex; flex-direction: column; gap: 9px; }
.doc-item {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center;
  padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
  animation: enter .4s var(--ease) both;
}
.doc-item:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow); }
.doc-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
:root[data-theme="dark"] .doc-icon { color: #b8c4ff; }
.doc-icon svg { width: 20px; height: 20px; }
.doc-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-sub { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.mini-track { width: 90px; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.mini-fill { height: 100%; background: var(--eq-green); border-radius: 999px; }
.empty { text-align: center; padding: 26px 14px; color: var(--muted); font-size: 14px; border: 1px dashed var(--border); border-radius: 12px; }

/* ── FORMULAR ─────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.input {
  width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.step-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; margin-right: 8px; }
.form-step + .form-step { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.form-step h2 { font-size: 16px; display: flex; align-items: center; margin-bottom: 12px; }

.chips { display: flex; flex-direction: column; gap: 7px; }
.chip {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 10px;
  border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border);
  animation: pop .3s var(--ease) both; cursor: grab;
}
.chip.dragging { opacity: .4; }
.chip.drop-target { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.chip .nr { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
:root[data-theme="dark"] .chip .nr { color: #c9d3ff; }
.chip .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: transparent; color: var(--faint); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.chip button:hover { background: var(--danger-soft); color: var(--danger); }
.chip button svg { width: 15px; height: 15px; }
.add-row { display: flex; gap: 8px; }
.add-row .input { flex: 1; }

/* ── DROP ZONE ────────────────────────────────────────────────────── */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 30px 18px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--muted);
  transition: border-color .2s, background .2s, transform .2s var(--ease), color .2s;
}
.dropzone:hover { border-color: var(--primary); color: var(--text); }
.dropzone.over { border-style: solid; border-color: var(--eq-orange); background: var(--active-soft); transform: scale(1.015); color: var(--active); }
.dropzone.ready { border-style: solid; border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.dropzone.shake { animation: shake .4s; border-color: var(--danger); }
.dz-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .3s var(--ease); }
.dz-icon svg { width: 26px; height: 26px; }
.dropzone:hover .dz-icon, .dropzone.over .dz-icon { transform: translateY(-4px); }
.dropzone.over .dz-icon { animation: bob .8s ease-in-out infinite; }
.dz-main { font-weight: 600; color: inherit; word-break: break-word; }
.dz-sub { font-size: 12px; }
.dz-change { font-size: 12px; text-decoration: underline; }

/* ── CASCADA DE SEMNATARI ─────────────────────────────────────────── */
.cascade { list-style: none; margin: 0; padding: 0; position: relative; }
.cascade li { position: relative; display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; padding: 11px 0; animation: enter .45s var(--ease) both; }
.cascade li:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 44px; bottom: -11px; width: 2px; background: var(--border); }
.cascade li.signed:not(:last-child)::before { background: var(--ok); }
.node {
  position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; border: 2px solid var(--border); background: var(--surface); color: var(--muted);
}
.node svg { width: 16px; height: 16px; }
li.signed .node { background: var(--ok); border-color: var(--ok); color: #fff; animation: pop .4s var(--ease) both; }
li.active .node { border-color: var(--active); color: var(--active); background: var(--active-soft); }
li.active .node::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--active); animation: ring 1.6s ease-out infinite; }
li.me .who b::after { content: " · tu"; color: var(--primary); font-weight: 600; }
.who { min-width: 0; }
.who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { display: block; font-size: 12px; color: var(--muted); }
.who .warn-line { color: var(--warn); font-weight: 600; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ── PAȘII SEMNATARULUI ───────────────────────────────────────────── */
.stepper { display: grid; gap: 12px; }
.step {
  display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 16px; border-radius: 13px;
  border: 1px solid var(--border); background: var(--surface); transition: border-color .3s, box-shadow .3s, opacity .3s;
}
.step .snum { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 2px solid var(--border); transition: all .3s var(--ease); }
.step .snum svg { width: 18px; height: 18px; }
.step h3 { font-size: 15px; margin-bottom: 3px; }
.step p { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.step.current { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.step.current .snum { background: var(--primary); color: #fff; border-color: var(--primary); }
.step.done .snum { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.todo { opacity: .75; }

.timer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.timer { display: flex; align-items: center; gap: 10px; }
.timer svg { width: 38px; height: 38px; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 4; }
.timer .t-bg { stroke: var(--border); }
.timer .t-fg { stroke: var(--eq-green); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer.urgent .t-fg { stroke: var(--danger); }
.timer-val { font-family: var(--mono); font-size: 18px; font-weight: 700; }
.timer.urgent .timer-val { color: var(--danger); animation: pulse-text 1s ease-in-out infinite; }
.timer-label { font-size: 12px; color: var(--muted); }

.wait-box { text-align: center; padding: 26px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hourglass { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--active-soft); color: var(--active); animation: breathe 2.2s ease-in-out infinite; }
.hourglass svg { width: 30px; height: 30px; animation: flip 2.2s var(--ease) infinite; }

/* ── SUCCES ───────────────────────────────────────────────────────── */
.success { text-align: center; padding: 22px 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.check-anim { width: 84px; height: 84px; }
.check-anim circle { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 3; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw .7s var(--ease) forwards; }
.check-anim path { fill: none; stroke: var(--ok); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .45s .5s var(--ease) forwards; }
.success h2 { font-size: 22px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 22px; border-radius: 3px; animation: fall linear forwards; }

/* ── LANDING ──────────────────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: center; }
.hero h1 { font-size: clamp(24px, 4vw, 34px); color: var(--primary); margin-bottom: 10px; }
:root[data-theme="dark"] .hero h1 { color: #c9d3ff; }
.hero p.lead { color: var(--muted); font-size: 16px; margin-bottom: 18px; }
.how { display: grid; gap: 10px; }
.how-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); animation: enter .5s var(--ease) both; }
.how-item:nth-child(2) { animation-delay: .1s; }
.how-item:nth-child(3) { animation-delay: .2s; }
.how-item .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.how-item .ic svg { width: 18px; height: 18px; }
.how-item:nth-child(1) .ic { background: var(--eq-orange); }
.how-item:nth-child(2) .ic { background: var(--eq-blue); }
.how-item:nth-child(3) .ic { background: var(--eq-green); }
.how-item b { display: block; font-size: 14px; }
.how-item span { font-size: 13px; color: var(--muted); }
.login-card { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.gbtn { min-height: 44px; display: flex; align-items: center; max-width: 100%; }
.gbtn svg { max-width: 20px; max-height: 20px; } /* plasă de siguranță dacă stilurile Google nu se încarcă */
.gbtn-ph { font-size: 13px; color: var(--muted); }
.login-opt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--border); background: var(--surface-2); }
.login-opt p { font-size: 13px; color: var(--muted); flex: 1; min-width: 220px; }

/* ── TOAST + DIALOG ───────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 15px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 14px; animation: toast-in .35s var(--ease) both; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.out { animation: toast-out .3s ease forwards; }

.dlg { border: 1px solid var(--border); border-radius: 16px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dlg[open] { animation: pop .3s var(--ease) both; }
.dlg::backdrop { background: rgba(10, 14, 40, .45); backdrop-filter: blur(3px); }
.dlg-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.dlg-body h2 { font-size: 18px; }
.dlg-body p { color: var(--muted); font-size: 14px; }
.dlg-acts { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; }

/* ── ANIMAȚII ─────────────────────────────────────────────────────── */
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bar-load { 0%, 100% { transform: scaleY(.35); } 45% { transform: scaleY(1); } }
@keyframes bar-bounce { 0%, 100% { transform: scaleY(1); } 40% { transform: scaleY(.55); } 70% { transform: scaleY(1.08); } }
@keyframes pulse-text { 50% { opacity: .55; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes flow { to { background-position: -200% 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 currentColor; } 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes ring { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes breathe { 50% { transform: scale(1.06); } }
@keyframes flip { 0%, 40% { transform: rotate(0); } 60%, 100% { transform: rotate(180deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── MOBIL ────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .logos { justify-content: center; gap: 10px 18px; padding: 10px 14px; }
  .logos img { height: 32px; }
  .hero { grid-template-columns: 1fr; }
  .user-mail { display: none; }
}
@media (max-width: 560px) {
  .page { padding: 18px 14px 40px; }
  .card { padding: 16px; }
  .appbar { padding: 9px 14px; }
  .appbar-sub { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 21px; }
  .cascade li { grid-template-columns: 34px 1fr; }
  .cascade .acts { grid-column: 2; justify-content: flex-start; }
  .doc-item { grid-template-columns: 36px 1fr; }
  .doc-item .badge { grid-column: 2; justify-self: start; }
  .step { grid-template-columns: 1fr; }
  .search { max-width: none; }
}

/* ── LAYOUT DENS PE ECRAN LAT (coloane + panou lateral) ───────────── */
.card { padding: 18px 20px; }
.layout, .grid2 { display: grid; gap: 14px; align-items: start; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.side-tools .btn { width: 100%; justify-content: flex-start; }
.hello .stats { display: flex; gap: 8px; }
.hello .stat { padding: 6px 12px; min-width: 92px; }
.hello .stat b { font-size: 20px; }
.form-step + .form-step { margin-top: 16px; padding-top: 16px; }
.dropzone { padding: 22px 16px; }
.chips { max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.cascade li { padding: 8px 0; }
.cascade li:not(:last-child)::before { top: 40px; bottom: -8px; }
.step { padding: 13px 14px; }
@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .col-side { position: sticky; top: 64px; }
  .hero { gap: 34px; }
}
@media (max-width: 760px) {
  .hello .stats { width: 100%; }
  .hello .stat { flex: 1; min-width: 0; }
}
.col-side .doc-item { grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 12px; }
.col-side .doc-item .badge { grid-column: 2; justify-self: start; }
.col-side .doc-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.col-side .doc-sub { flex-wrap: wrap; gap: 4px 8px; }
.col-side .doc-icon { width: 34px; height: 34px; }
/* Reîmprospătările automate nu re-animă pagina */
.quiet *, .quiet { animation: none !important; }
.quiet .fill { transition: none; }

/* ── LINK UNIC + ALEGEREA NUMELUI ─────────────────────────────────── */
.link-card { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: linear-gradient(180deg, var(--primary-soft), var(--surface) 70%); }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.link-field { flex: 1; min-width: 240px; font-size: 12.5px; background: var(--surface); }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pick {
  display: grid; grid-template-columns: 34px 1fr 18px; gap: 12px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; animation: enter .4s var(--ease) both;
}
.pick > svg { width: 18px; height: 18px; color: var(--faint); transition: transform .2s var(--ease), color .2s; }
.pick:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }
.pick:hover:not(:disabled) > svg { color: var(--primary); transform: translateX(3px); }
.pick:disabled { cursor: default; opacity: .7; }
.pick .node { width: 34px; height: 34px; }
.pick.signed .node { background: var(--ok); border-color: var(--ok); color: #fff; }
.pick.active .node { border-color: var(--active); color: var(--active); background: var(--active-soft); }
.pick .who span { font-size: 12px; color: var(--muted); }
.linklike { border: 0; background: none; padding: 0; color: var(--link); text-decoration: underline; font-size: inherit; cursor: pointer; }
