/* Общий стиль всех страниц: светлый фон, крупный текст, один цвет — один смысл. */

/* Golos Text (SIL Open Font License) лежит у нас — страница не зависит от внешних сайтов */
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/static/fonts/golos-text-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/static/fonts/golos-text-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #f1f3f6;
  --card: #ffffff;
  --text: #14181f;
  --muted: #5b6472;
  --line: #d5dae2;
  --action: #1656d9;
  --action-dark: #0f44b3;
  --ok: #15803d;
  --ok-bg: #e8f6ed;
  --warn: #b45309;
  --warn-bg: #fff4e0;
  --bad: #c62828;
  --bad-bg: #fdecec;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  padding: 32px 16px 64px;
}
main { max-width: 760px; margin: 0 auto; }

h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.15; margin: 0 0 8px; font-weight: 700; letter-spacing: -.01em; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.top form { flex: none; margin: 0; }
.intro { margin: 0 0 28px; color: var(--muted); font-size: 18px; }
h2 { font-size: 24px; margin: 0; font-weight: 700; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 48px 0 16px; }
.list-head.first { margin-top: 0; }
.list-count { font-size: 15px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }

/* ---------- шаги ---------- */
.step { display: flex; gap: 16px; padding: 20px; margin-bottom: 12px; align-items: flex-start; }
.badge {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-content: center;
  font-size: 22px; font-weight: 700;
  background: var(--text); color: #fff;
  transition: background .2s;
}
.step.done .badge { background: var(--ok); }
.step.locked { opacity: .55; }
.step-body { flex: 1; min-width: 0; }
.step-title { font-size: 20px; font-weight: 600; margin: 8px 0 12px; }
.step-title small { display: block; font-size: 15px; font-weight: 400; color: var(--muted); margin-top: 2px; }

.drop {
  position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px; min-height: 84px;
  border: 2px dashed #aab3c2; border-radius: 12px; background: #f8f9fb;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop:focus-within { border-color: var(--action); background: #eef3fe; }
.drop.drag { border-color: var(--action); background: #dfe9fd; border-style: solid; }
.drop input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.pick {
  flex: none; padding: 12px 18px; border-radius: 10px;
  background: #fff; border: 2px solid var(--action); color: var(--action);
  font-weight: 600; font-size: 17px;
}
.drop-text { color: var(--muted); font-size: 16px; min-width: 0; word-break: break-word; }
.step.done .drop { border: 2px solid var(--ok); background: var(--ok-bg); }
.step.done .drop-text { color: var(--text); font-weight: 600; }
.step.done .drop-text::before { content: "✓ "; color: var(--ok); }
.step.done .pick { border-color: var(--line); color: var(--muted); font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 14px 28px; border: 0; border-radius: 12px;
  font-family: inherit; font-weight: 600; font-size: 20px; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  background: var(--action); color: #fff;
  transition: background .15s, transform .05s;
}
.btn:hover:not(:disabled) { background: var(--action-dark); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { background: #c3cad6; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.green { background: var(--ok); }
.btn.green:hover { background: #116932; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.step-hint { margin: 10px 0 0; font-size: 15px; color: var(--muted); }

/* ---------- сообщения ---------- */
.msg { border-radius: 16px; padding: 22px; margin-top: 16px; border: 2px solid; }
.msg h3 { margin: 0 0 6px; font-size: 24px; font-weight: 700; }
.msg p { margin: 0 0 16px; }
.msg.ok { background: var(--ok-bg); border-color: var(--ok); }
.msg.ok h3 { color: var(--ok); }
.msg.bad { background: var(--bad-bg); border-color: var(--bad); }
.msg.bad h3 { color: var(--bad); font-size: 20px; }
.msg.bad p { margin: 0; }

.warn-box {
  background: var(--warn-bg); border: 2px solid var(--warn); border-radius: 12px;
  padding: 14px 16px; margin: 0 0 16px;
}
.warn-box strong { color: var(--warn); display: block; margin-bottom: 4px; }
.warn-box ul { margin: 8px 0 0; padding: 0; list-style: none; max-height: 220px; overflow: auto; }
.warn-box li { padding: 5px 0; border-top: 1px solid #f0d9ad; display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.warn-box li span { color: var(--muted); white-space: nowrap; }

/* ---------- прошлые файлы ---------- */
.run { padding: 16px 20px; margin-bottom: 10px; }
.run-main { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.run-info { flex: 1; min-width: 220px; }
.run-date { font-size: 15px; color: var(--muted); }
.run-name { font-weight: 600; word-break: break-word; }
.run-status { display: inline-block; margin: 6px 8px 0 0; padding: 3px 10px; border-radius: 99px; font-size: 14px; font-weight: 600; }
.run-status.ok { background: var(--ok-bg); color: var(--ok); }
.run-status.warn { background: var(--warn-bg); color: var(--warn); }
.run-count { font-size: 14px; color: var(--muted); }
.run-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.small { min-height: 48px; padding: 10px 18px; font-size: 17px; border-radius: 10px; }
.link {
  min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; text-decoration: none;
  font-family: inherit; font-weight: 500; font-size: 16px;
  display: inline-flex; align-items: center;
}
.link:hover { border-color: var(--text); }
.link.danger { color: var(--bad); }
.link.danger:hover { border-color: var(--bad); background: var(--bad-bg); }

.details { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.details-files { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.table-wrap { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { position: sticky; top: 0; background: #eef0f4; font-weight: 600; font-size: 14px; white-space: nowrap; }
td.codes { font-variant-numeric: tabular-nums; }
td.codes div { white-space: nowrap; }
td.soft { color: var(--muted); }
tr.miss td { background: var(--warn-bg); }
tr:last-child td { border-bottom: 0; }

.empty { padding: 24px 20px; color: var(--muted); }
.more { margin-top: 6px; width: 100%; justify-content: center; }

[hidden] { display: none !important; }
@media (max-width: 560px) {
  body { padding-top: 20px; }
  .step { padding: 16px; gap: 12px; }
  .badge { width: 36px; height: 36px; font-size: 18px; }
  .step-title { margin-top: 4px; }
  .run-buttons, .run-buttons .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- переход ко всем файлам ---------- */
.all { margin-top: 6px; width: 100%; justify-content: center; font-weight: 600; min-height: 56px; font-size: 17px; }
.back { margin-bottom: 20px; }

/* ---------- вход ---------- */
.login-page { min-height: calc(100vh - 96px); display: grid; place-items: center; }
.login-page main { width: 100%; max-width: 420px; }
.app-name { text-align: center; color: var(--muted); font-size: 16px; margin: 0 0 16px; }
.login-card { padding: 28px; }
.login-card h1 { font-size: 32px; margin-bottom: 20px; }
.field { display: block; font-weight: 600; margin: 16px 0 6px; }
.input {
  width: 100%; min-height: 56px; padding: 12px 16px;
  font-family: inherit; font-size: 19px; color: var(--text);
  border: 2px solid #aab3c2; border-radius: 12px; background: #fff;
}
.input:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 4px #dfe9fd; }
.login-card .btn { margin-top: 24px; }
.alert {
  margin: 0 0 4px; padding: 14px 16px; border-radius: 12px;
  border: 2px solid var(--bad); background: var(--bad-bg); color: var(--bad); font-weight: 600;
}
