:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #6b7682;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --ok: #1a7f4b;
  --err: #c0392b;
  --line: #e4e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px 24px;
}

.card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px 24px;
  margin-top: 6vh;
}

h1 {
  font-size: 22px;
  margin: 0 0 18px;
}

.head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.head-row h1 { margin-bottom: 18px; }
.help-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
}

/* Страница инструкции */
.card.help { line-height: 1.5; }
.help-h2 { font-size: 16px; margin: 20px 0 8px; }
.help-steps { padding-left: 22px; margin: 0; }
.help-steps li { margin-bottom: 12px; }
.help-notes { padding-left: 20px; margin: 0; color: var(--ink); }
.help-notes li { margin-bottom: 10px; }
.help-back {
  display: inline-block;
  margin-top: 22px;
  color: var(--accent);
  text-decoration: none;
  font-size: 16px;
}

.hint {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 14px;
  line-height: 1.45;
}
.hint.small { font-size: 13px; margin: 8px 0 0; }

form { display: flex; flex-direction: column; gap: 12px; }

input[type="text"],
input[type="password"] {
  width: 100%;
  font-size: 17px;            /* >=16px - iOS не зумит поле */
  padding: 14px 14px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
}

input:focus {
  outline: none;
  border-color: var(--accent);
}

button[type="submit"] {
  font-size: 17px;
  font-weight: 600;
  padding: 14px;
  border: none;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

button[type="submit"]:disabled { opacity: .55; }

.link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px;
  background: #fbfcfd;
  margin-bottom: 4px;
}

.order-num { font-size: 17px; margin-bottom: 6px; }
.order-line { color: var(--muted); font-size: 15px; line-height: 1.4; }
.phase2-note { color: var(--muted); font-style: italic; font-size: 14px; }

.file-label {
  display: block;
  text-align: center;
  padding: 14px;
  border: 1.5px dashed var(--accent);
  border-radius: 11px;
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
}
.file-label input[type="file"] { display: none; }

.progress {
  margin-top: 12px;
  height: 8px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
}
#progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .15s ease;
}

.done-mark {
  font-size: 44px;
  color: var(--ok);
  text-align: center;
  line-height: 1;
  margin-bottom: 10px;
}
.done-mark.warn {
  color: var(--err);
  font-weight: 700;
}
.done-text { font-size: 16px; margin: 0 0 14px; }
#folder-link { display: inline-block; margin-bottom: 16px; }

.msg {
  margin: 14px 0 0;
  font-size: 15px;
  min-height: 1.2em;
}
.msg.ok  { color: var(--ok); }
.msg.err { color: var(--err); }
