/* Medworks — Evidență tratament injectabil
   Stil comun pentru aplicație și installer. */
@import url('fonts.css');

:root {
  --red: #ce071e;
  --red-dark: #9e0517;
  --ink: #232323;
  --ink-strong: #262626;
  --muted: #5a5a5a;
  --line: #e3e3df;
  --line-strong: #c9c9c4;
  --bg: #f4f4f2;
  --card: #ffffff;
  --soft: #f2f2f0;
  --ok-bg: #e4f2e9; --ok-ink: #14532d; --ok-dot: #15803d;
  --warn-bg: #fdebd3; --warn-ink: #7c3504;
  --err-bg: #fff5f6; --err-line: #e8a5ae; --err-ink: #7f0f2e; --err-strong: #9f1239;
  --info-bg: #e6edfa; --info-ink: #1e3a8a;
  --radius: 14px;
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.5; }
a { color: #b0061a; }
a:hover { color: #80040f; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; color: var(--ink-strong); margin: 0; line-height: 1.15; }
h1 { font-size: clamp(30px, 4vw, 38px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; font-family: var(--font); }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #1e3a8a; outline-offset: 2px; }

/* Structură */
.mw-header { background: var(--card); border-bottom: 1px solid var(--line); }
.mw-header .inner { max-width: 1120px; margin: 0 auto; padding: 12px clamp(16px, 3vw, 32px); display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.mw-header .logo img { width: 124px; display: block; }
.mw-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.mw-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; color: #333; font-weight: 600; text-decoration: none; }
.mw-nav a[aria-current="page"] { background: #fbe9eb; color: var(--red-dark); }
.mw-user { display: flex; align-items: center; gap: 12px; }
.mw-user .who { line-height: 1.2; text-align: right; }
.mw-user .who b { display: block; font-size: 15px; }
.mw-user .who span { font-size: 14px; color: var(--muted); }
.container { max-width: 1120px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 32px) 56px; display: flex; flex-direction: column; gap: 22px; }
.container.narrow { max-width: 760px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.page-head { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: flex-end; }
.eyebrow { color: var(--muted); font-weight: 600; }
.label-caps { font-size: 14px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.strong { border: 2px solid var(--ink-strong); }
.card.center { align-items: center; text-align: center; }

/* Butoane */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 10px; background: var(--red); color: #fff; font: 700 18px/1 var(--font); text-decoration: none; border: 1px solid var(--red); cursor: pointer; }
.btn:hover { background: #b0061a; color: #fff; }
.btn.secondary { background: #fff; color: var(--ink-strong); border-color: var(--line-strong); font-weight: 600; font-size: 17px; }
.btn.secondary:hover { background: var(--soft); color: var(--ink-strong); }
.btn.dark { background: var(--ink-strong); border-color: var(--ink-strong); font-weight: 600; font-size: 17px; }
.btn.dark:hover { background: #000; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 16px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { background: #b5b5b0; border-color: #b5b5b0; color: #fff; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: #b0061a; font: 600 16px var(--font); cursor: pointer; text-decoration: underline; min-height: 44px; }
form.inline { display: inline; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 16px; color: #333; }
.field .hint { font-weight: 400; font-size: 15px; color: var(--muted); order: 1; }
.input, select.input, textarea.input { min-height: 52px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); font: 400 17px var(--font); width: 100%; }
textarea.input { padding: 12px 14px; min-height: 96px; }
.input.mono { font-family: var(--mono); font-size: 16px; }
.input:focus { border-color: var(--ink-strong); outline: 2px solid var(--ink-strong); outline-offset: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; line-height: 1.45; min-height: 44px; }
.check input { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; accent-color: var(--red); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 2px solid #d4d4cf; border-radius: 12px; background: #fff; cursor: pointer; font-weight: 400; }
.choice input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ink-strong); }
.choice b { display: block; font-size: 18px; }
.choice:has(input:checked) { border-color: var(--ink-strong); background: var(--soft); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }

/* Mesaje */
.alert { border-radius: 12px; padding: 14px 18px; line-height: 1.5; border: 1px solid transparent; }
.alert b { display: block; }
.alert.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: #b9dcc6; }
.alert.err { background: var(--err-bg); color: #4a2a30; border-color: var(--err-line); }
.alert.err b { color: var(--err-ink); }
.alert.warn { background: var(--warn-bg); color: #5c2a04; border-color: #f2c99a; }
.alert.info { background: var(--soft); color: #333; border-color: var(--line); }
.pre { white-space: pre-wrap; font-family: var(--mono); font-size: 14px; background: var(--soft); border-radius: 8px; padding: 10px 12px; margin-top: 8px; color: #333; max-height: 220px; overflow: auto; }

/* Etichete de stare */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.fail { background: var(--err-strong); color: #fff; }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.pending, .pill.off { background: #ebebea; color: #3c3c3c; }
.pill.info { background: var(--info-bg); color: var(--info-ink); }
.dot { width: 10px; height: 10px; border-radius: 99px; background: var(--ok-dot); display: inline-block; }

/* Listă de verificări */
.checklist { display: flex; flex-direction: column; }
.check-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 12px 2px; border-top: 1px solid #efefec; align-items: start; }
.check-row:first-child { border-top: 0; }
.check-row .lbl { font-weight: 600; }
.check-row .det { color: var(--muted); font-size: 15px; }
.check-row .fix { grid-column: 1 / -1; background: var(--err-bg); border: 1px solid var(--err-line); border-radius: 10px; padding: 10px 14px; font-size: 15px; color: #4a2a30; }
.check-row.warn .fix { background: var(--warn-bg); border-color: #f2c99a; color: #5c2a04; }
.group-title { font-size: 14px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
.summary-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Tabel responsive */
.table-wrap { overflow-x: auto; border-radius: 10px; }
table.table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.table th { text-align: left; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; font-weight: 700; }
table.table td { padding: 12px 10px; border-top: 1px solid #efefec; vertical-align: top; }

/* Installer: pași */
.steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: #ebebea; color: #444; font-size: 14px; font-weight: 600; }
.steps li .n { width: 26px; height: 26px; border-radius: 99px; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.steps li.done { background: var(--ok-bg); color: var(--ok-ink); }
.steps li.current { background: var(--ink-strong); color: #fff; }
.steps li.current .n { color: var(--ink-strong); }

/* Login cu PIN */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px; display: flex; flex-direction: column; gap: 20px; }
.auth-card .logo { width: 170px; align-self: center; }
.user-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.user-pick a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 76px; border-radius: 12px; border: 2px solid #d4d4cf; background: #fff; color: var(--ink-strong); text-decoration: none; padding: 8px; text-align: center; }
.user-pick a b { font-size: 18px; }
.user-pick a span { font-size: 15px; color: var(--muted); }
.user-pick a[aria-current="true"] { background: var(--ink-strong); border-color: var(--ink-strong); color: #fff; }
.user-pick a[aria-current="true"] span { color: #e5e5e5; }
.pin-input { text-align: center; font-size: 30px !important; letter-spacing: .5em; font-family: var(--mono) !important; }
.pinpad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pinpad button { min-height: 64px; border-radius: 12px; border: 1px solid #d4d4cf; background: #fafaf8; color: var(--ink-strong); font: 600 24px var(--font); cursor: pointer; }
.pinpad button.fn { font-size: 17px; }
.pinpad button:active { background: #ebebea; }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .mw-user .who { display: none; }
  .card { padding: 18px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
}
